mirror of
https://github.com/pezkuwichain/phishing.git
synced 2026-04-22 04:28:01 +00:00
Sort all.json inside build (#40)
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
},
|
||||
"scripts": {
|
||||
"build": "polkadot-dev-build-ts",
|
||||
"build:extra": "node scripts/sortAll.mjs",
|
||||
"build:release": "polkadot-ci-ghact-build --skip-beta",
|
||||
"lint": "polkadot-dev-run-lint",
|
||||
"clean": "polkadot-dev-clean-build",
|
||||
|
||||
@@ -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