Sort all.json inside build (#40)

This commit is contained in:
Jaco Greeff
2020-12-30 17:22:27 +01:00
committed by GitHub
parent f75d84dde2
commit 81169894f3
2 changed files with 15 additions and 0 deletions
+14
View File
@@ -0,0 +1,14 @@
// Copyright 2020 @polkadot/phishing authors & contributors
// SPDX-License-Identifier: Apache-2.0
import fs from 'fs';
function sortSection (values) {
return values.sort((a, b) => a.localeCompare(b));
}
const original = JSON.parse(fs.readFileSync('all.json', 'utf-8'));
const allow = sortSection(original.allow);
const deny = sortSection(original.deny);
fs.writeFileSync('all.json', JSON.stringify({ allow, deny }, null, 2));