@adguard/filters-compiler 3.2.0 → 3.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/build.txt CHANGED
@@ -1 +1 @@
1
- version=3.2.0
1
+ version=3.2.2
package/dist/index.cjs CHANGED
@@ -1,6 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var path$1 = require('path');
4
+ var url = require('url');
4
5
  var tsurlfilter = require('@adguard/tsurlfilter');
5
6
  var fs$1 = require('fs');
6
7
  var md5 = require('md5');
@@ -1410,7 +1411,7 @@ const cleanupAndOptimizeRules = function (rules, config, optimizationConfig, fil
1410
1411
 
1411
1412
  /* eslint-disable global-require */
1412
1413
 
1413
- const __dirname$4 = path$1.dirname(new URL((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href))).pathname);
1414
+ const __dirname$4 = path$1.dirname(url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href))));
1414
1415
 
1415
1416
  const RULES_SEPARATOR = '\r\n';
1416
1417
  let filterIdsPool = [];
@@ -2782,7 +2783,7 @@ const optimizeDomainBlockingRules = async (lines) => {
2782
2783
  /* eslint-disable global-require */
2783
2784
 
2784
2785
 
2785
- const __dirname$3 = path$1.dirname(new URL((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href))).pathname);
2786
+ const __dirname$3 = path$1.dirname(url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href))));
2786
2787
 
2787
2788
  const TEMPLATE_FILE = 'template.txt';
2788
2789
  const FILTER_FILE = 'filter.txt';
@@ -3675,7 +3676,7 @@ const schemaValidator = { validate: validate$1 };
3675
3676
 
3676
3677
  /* eslint-disable global-require */
3677
3678
 
3678
- const __dirname$2 = path$1.dirname(new URL((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href))).pathname);
3679
+ const __dirname$2 = path$1.dirname(url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href))));
3679
3680
 
3680
3681
  /**
3681
3682
  * Each filter, group, tag should have two keys.
@@ -4809,7 +4810,7 @@ const platformsConfig = {
4809
4810
  // Sets configuration compatibility
4810
4811
  tsurlfilter.setConfiguration({ compatibility: tsurlfilter.CompatibilityTypes.Corelibs });
4811
4812
 
4812
- const __dirname$1 = path$1.dirname(new URL((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href))).pathname);
4813
+ const __dirname$1 = path$1.dirname(url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href))));
4813
4814
 
4814
4815
  const jsonSchemasConfigDir = path$1.join(__dirname$1, './schemas/');
4815
4816
 
package/dist/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import path$1 from 'path';
2
+ import { fileURLToPath } from 'url';
2
3
  import { RuleFactory, CosmeticRule, NetworkRule, setConfiguration, CompatibilityTypes } from '@adguard/tsurlfilter';
3
4
  import fs$1 from 'fs';
4
5
  import md5 from 'md5';
@@ -1407,7 +1408,7 @@ const cleanupAndOptimizeRules = function (rules, config, optimizationConfig, fil
1407
1408
 
1408
1409
  /* eslint-disable global-require */
1409
1410
 
1410
- const __dirname$3 = path$1.dirname(new URL(import.meta.url).pathname);
1411
+ const __dirname$3 = path$1.dirname(fileURLToPath(import.meta.url));
1411
1412
 
1412
1413
  const RULES_SEPARATOR = '\r\n';
1413
1414
  let filterIdsPool = [];
@@ -2779,7 +2780,7 @@ const optimizeDomainBlockingRules = async (lines) => {
2779
2780
  /* eslint-disable global-require */
2780
2781
 
2781
2782
 
2782
- const __dirname$2 = path$1.dirname(new URL(import.meta.url).pathname);
2783
+ const __dirname$2 = path$1.dirname(fileURLToPath(import.meta.url));
2783
2784
 
2784
2785
  const TEMPLATE_FILE = 'template.txt';
2785
2786
  const FILTER_FILE = 'filter.txt';
@@ -3672,7 +3673,7 @@ const schemaValidator = { validate: validate$1 };
3672
3673
 
3673
3674
  /* eslint-disable global-require */
3674
3675
 
3675
- const __dirname$1 = path$1.dirname(new URL(import.meta.url).pathname);
3676
+ const __dirname$1 = path$1.dirname(fileURLToPath(import.meta.url));
3676
3677
 
3677
3678
  /**
3678
3679
  * Each filter, group, tag should have two keys.
@@ -4806,7 +4807,7 @@ const platformsConfig = {
4806
4807
  // Sets configuration compatibility
4807
4808
  setConfiguration({ compatibility: CompatibilityTypes.Corelibs });
4808
4809
 
4809
- const __dirname = path$1.dirname(new URL(import.meta.url).pathname);
4810
+ const __dirname = path$1.dirname(fileURLToPath(import.meta.url));
4810
4811
 
4811
4812
  const jsonSchemasConfigDir = path$1.join(__dirname, './schemas/');
4812
4813
 
@@ -0,0 +1,11 @@
1
+ ! Allowed rules by FULL trust level:
2
+ ! $redirect
3
+ ! $rewrite:abp-resource
4
+ ! #%#//scriptlet
5
+ ! ##+js
6
+ ! #$#
7
+ ! $replace
8
+ ! #%#
9
+ ! #@%#
10
+ !
11
+ ! The following rules should be excluded:
@@ -0,0 +1,13 @@
1
+ ! Allowed rules by HIGH trust level:
2
+ ! $redirect
3
+ ! $rewrite:abp-resource
4
+ ! #%#//scriptlet
5
+ ! ##+js
6
+ ! #$#
7
+ !
8
+ ! The following rules should be excluded:
9
+ #%#//scriptlet('trusted-
10
+ #%#//scriptlet("trusted-
11
+ $replace
12
+ #%#
13
+ #@%#
@@ -0,0 +1,11 @@
1
+ ! Allowed rules by LOW trust level:
2
+ ! $redirect
3
+ ! $rewrite:abp-resource
4
+ !
5
+ ! The following rules should be excluded:
6
+ #%#//scriptlet
7
+ ##+js
8
+ #$#
9
+ $replace
10
+ #%#
11
+ #@%#
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adguard/filters-compiler",
3
- "version": "3.2.0",
3
+ "version": "3.2.2",
4
4
  "description": "AdGuard filters compiler",
5
5
  "homepage": "http://adguard.com",
6
6
  "type": "module",