Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: abp2blocklist.js

Issue 29426594: Issue 3673 - Merge closely matching rules (Closed) Base URL: https://hg.adblockplus.org/abp2blocklist
Patch Set: Implement merge options "all", "auto", and "none" Created May 24, 2017, 1:24 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | lib/abp2blocklist.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: abp2blocklist.js
===================================================================
--- a/abp2blocklist.js
+++ b/abp2blocklist.js
@@ -17,20 +17,23 @@
"use strict";
let readline = require("readline");
let Filter = require("filterClasses").Filter;
let ContentBlockerList = require("./lib/abp2blocklist.js").ContentBlockerList;
var rl = readline.createInterface({input: process.stdin, terminal: false});
-var blockerList = new ContentBlockerList();
+var blockerList = new ContentBlockerList({merge: "all"});
rl.on("line", line =>
{
if (/^\s*[^\[\s]/.test(line))
blockerList.addFilter(Filter.fromText(Filter.normalize(line)));
});
rl.on("close", () =>
{
- console.log(JSON.stringify(blockerList.generateRules(), null, "\t"));
+ blockerList.generateRules().then(rules =>
+ {
+ console.log(JSON.stringify(rules, null, "\t"));
+ });
});
« no previous file with comments | « no previous file | lib/abp2blocklist.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld