Files
phishing/scripts/sortAll.mjs
T
Jaco Greeff f0d1b7cec1 2021 (#41)
2021-01-03 11:12:06 +01:00

15 lines
438 B
JavaScript

// Copyright 2020-2021 @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));