mirror of
https://github.com/pezkuwichain/phishing.git
synced 2026-04-22 02:08:00 +00:00
Sort all.json inside build (#40)
This commit is contained in:
@@ -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));
|
||||
Reference in New Issue
Block a user