footprintjs 9.44.0 → 9.44.1
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.
|
@@ -402,8 +402,29 @@ export declare function useWalkLimit(limit: number): () => void;
|
|
|
402
402
|
* inside one segment — and an ancestor whose NAME matches is masked whole
|
|
403
403
|
* before the walk goes below it, so the name decides. Conservative: `true`
|
|
404
404
|
* whenever in doubt.
|
|
405
|
+
*
|
|
406
|
+
* Linear in the length of `pattern.source`: every scan here is one forward
|
|
407
|
+
* pass ({@link classBodies}) or a regex that does constant work per position.
|
|
405
408
|
*/
|
|
406
409
|
export declare function needsPath(pattern: RegExp): boolean;
|
|
410
|
+
/**
|
|
411
|
+
* The body of each character class in `source`, left to right: the text
|
|
412
|
+
* between a `[` and the first `]` after it that no `\` escapes (a `\` takes
|
|
413
|
+
* the character after it along). ONE forward pass.
|
|
414
|
+
*
|
|
415
|
+
* It replaces `source.matchAll(/\[((?:\\[\s\S]|[^\]\\])*)\]/g)` and gives the
|
|
416
|
+
* same bodies for every string (pinned against that regex as the control,
|
|
417
|
+
* test/lib/memory/security/needs-path-linear.security.test.ts). The regex was
|
|
418
|
+
* quadratic: after a `[` that never closed it retried at every later `[`,
|
|
419
|
+
* each retry rescanning to the end — `\[` repeated 32,000 times took 0.7 s,
|
|
420
|
+
* and `setPolicy` runs once per stage's scope (CodeQL js/polynomial-redos).
|
|
421
|
+
* The pass stops at the first `[` that never closes instead: a later `[`
|
|
422
|
+
* starts its body where the failed scan was also between two tokens, so it
|
|
423
|
+
* reads the same tail the same way and closes nowhere either.
|
|
424
|
+
*
|
|
425
|
+
* @internal Exported for that test only — not on any public door.
|
|
426
|
+
*/
|
|
427
|
+
export declare function classBodies(source: string): string[];
|
|
407
428
|
/**
|
|
408
429
|
* THE TAINT RULE at a subflow mapper boundary (an `inputMapper` seeding a
|
|
409
430
|
* subflow, an `outputMapper` merging it back): a key the mapper writes
|
package/package.json
CHANGED