diff --git a/package.json b/package.json index 3f3b24db8..12fe21189 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/scripts/sortAll.mjs b/scripts/sortAll.mjs new file mode 100644 index 000000000..3e7c98299 --- /dev/null +++ b/scripts/sortAll.mjs @@ -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));