-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
AG-16616 add decimal delay matching for prevent-setTimeout/-setInterval
#247 Merge in ADGUARD-FILTERS/scriptlets from fix/AG-16616 to release/v1.8 Squashed commit of the following: commit 6313c0e Author: Stanislav A <s.atroschenko@adguard.com> Date: Mon Dec 26 15:57:57 2022 +0300 improve helper commit 47b9202 Author: Stanislav A <s.atroschenko@adguard.com> Date: Thu Dec 22 20:40:17 2022 +0300 tweak buggy test commit 55c72f6 Author: Stanislav A <s.atroschenko@adguard.com> Date: Thu Dec 22 17:29:25 2022 +0300 fix typo commit 72946ad Author: Stanislav A <s.atroschenko@adguard.com> Date: Thu Dec 22 12:16:27 2022 +0300 fix parseRawDelay helper commit 5350f36 Author: Stanislav A <s.atroschenko@adguard.com> Date: Wed Dec 21 20:06:15 2022 +0300 fix parseRawDelay helper commit 369c327 Merge: dd79e29 6191100 Author: Stanislav A <s.atroschenko@adguard.com> Date: Wed Dec 21 16:32:20 2022 +0300 merge release/v1.8 commit dd79e29 Author: Stanislav A <s.atroschenko@adguard.com> Date: Mon Dec 19 19:49:08 2022 +0300 improve helper commit 8d52c1b Author: Stanislav A <s.atroschenko@adguard.com> Date: Mon Dec 19 18:49:34 2022 +0300 fix helper description commit 28b374d Author: Stanislav A <s.atroschenko@adguard.com> Date: Mon Dec 19 18:34:22 2022 +0300 improve descriptions commit 6bf00c1 Author: Stanislav A <s.atroschenko@adguard.com> Date: Mon Dec 19 18:17:55 2022 +0300 imporve parseRawDelay and move to prevent-utils commit 491b35f Author: Stanislav A <s.atroschenko@adguard.com> Date: Fri Dec 16 19:34:43 2022 +0300 fix changelog indents commit e35248d Author: Stanislav A <s.atroschenko@adguard.com> Date: Fri Dec 16 15:00:53 2022 +0300 improve and test helper commit baca1d8 Author: Stanislav A <s.atroschenko@adguard.com> Date: Thu Dec 15 21:21:10 2022 +0300 improve raw delay parsing commit e0e6698 Author: Stanislav A <s.atroschenko@adguard.com> Date: Thu Dec 15 19:24:40 2022 +0300 add typecheck for delay + tests commit 60505e9 Author: Stanislav A <s.atroschenko@adguard.com> Date: Thu Dec 15 19:06:15 2022 +0300 update scriptlets descriptions, fix typo in changelog commit f4b48ce Author: Stanislav A <s.atroschenko@adguard.com> Date: Thu Dec 15 17:03:37 2022 +0300 add decimal delay matching for prevent-setTimeout/-setInterval
- Loading branch information
1 parent
6191100
commit 22e41f8
Showing
8 changed files
with
329 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { parseRawDelay } from '../../src/helpers'; | ||
|
||
const { test, module } = QUnit; | ||
const name = 'scriptlets-redirects helpers'; | ||
|
||
module(name); | ||
test('Test parseRawDelay', (assert) => { | ||
assert.strictEqual(parseRawDelay(0), 0, 'parsing number ok'); | ||
assert.strictEqual(parseRawDelay(10), 10, 'parsing number ok'); | ||
assert.strictEqual(parseRawDelay(10.123), 10, 'parsing number ok'); | ||
|
||
assert.strictEqual(parseRawDelay('0'), 0, 'parsing number in string ok'); | ||
assert.strictEqual(parseRawDelay('10'), 10, 'parsing number in string ok'); | ||
assert.strictEqual(parseRawDelay('10.123'), 10, 'parsing number in string ok'); | ||
|
||
assert.strictEqual(parseRawDelay('string'), 'string', 'parsing string ok'); | ||
|
||
assert.strictEqual(parseRawDelay(null), null, 'parsing other types ok'); | ||
assert.strictEqual(parseRawDelay(undefined), undefined, 'parsing other types ok'); | ||
assert.strictEqual(parseRawDelay(false), false, 'parsing other types ok'); | ||
// as NaN !== NaN | ||
assert.strictEqual(parseRawDelay(NaN).toString(), 'NaN', 'parsing other types ok'); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.