mirror of https://github.com/gorhill/uBlock.git
[mv3] Indent rulesets with fewer rules
This commit is contained in:
parent
88d9064a30
commit
8d47eac6e6
|
@ -89,9 +89,10 @@ async function main() {
|
||||||
afterRule.id = ruleIdGenerator++;
|
afterRule.id = ruleIdGenerator++;
|
||||||
}
|
}
|
||||||
afterRules.sort((a, b) => a.id - b.id);
|
afterRules.sort((a, b) => a.id - b.id);
|
||||||
|
const indent = afterRules.length > 10 ? undefined : 1;
|
||||||
const lines = [];
|
const lines = [];
|
||||||
for ( const afterRule of afterRules ) {
|
for ( const afterRule of afterRules ) {
|
||||||
lines.push(JSON.stringify(afterRule));
|
lines.push(JSON.stringify(afterRule, null, indent));
|
||||||
}
|
}
|
||||||
writePromises.push(
|
writePromises.push(
|
||||||
fs.writeFile(
|
fs.writeFile(
|
||||||
|
|
Loading…
Reference in New Issue