@voxgig/struct 0.3.2 → 0.3.4
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/README.md +6 -6
- package/dist/StructUtility.js +1 -1
- package/package.json +1 -1
- package/src/StructUtility.ts +1 -1
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Struct for TypeScript
|
|
2
2
|
|
|
3
|
-
> The canonical implementation.
|
|
4
|
-
> the behaviour defined here.
|
|
3
|
+
> The canonical implementation. Every other language port matches
|
|
4
|
+
> the behaviour defined here. When the shared test corpus
|
|
5
5
|
> ([`../build/test/`](../build/test/)) and another port disagree, the
|
|
6
6
|
> corpus -- generated from this code -- is right.
|
|
7
7
|
|
|
@@ -91,7 +91,7 @@ import {
|
|
|
91
91
|
## Function reference
|
|
92
92
|
|
|
93
93
|
Every function is documented with its TypeScript signature, a one-line
|
|
94
|
-
description, and a usage example.
|
|
94
|
+
description, and a usage example. Source:
|
|
95
95
|
[`src/StructUtility.ts`](./src/StructUtility.ts).
|
|
96
96
|
|
|
97
97
|
### Predicates
|
|
@@ -775,7 +775,7 @@ Quote inside a `validate` spec, e.g. `` '`$STRING`' ``.
|
|
|
775
775
|
|
|
776
776
|
## `StructUtility` class
|
|
777
777
|
|
|
778
|
-
Wraps every function and constant as instance properties.
|
|
778
|
+
Wraps every function and constant as instance properties. Useful
|
|
779
779
|
when you want to inject the API surface (e.g. for stubbing in tests):
|
|
780
780
|
|
|
781
781
|
```ts
|
|
@@ -807,7 +807,7 @@ adopt the `'__NULL__'` placeholder used by the shared test corpus.
|
|
|
807
807
|
|
|
808
808
|
`walk`, `merge`, `inject`, and `setpath` all rely on lists being
|
|
809
809
|
reference-stable: a mutation through one reference is visible to
|
|
810
|
-
every holder.
|
|
810
|
+
every holder. This is JavaScript's natural behaviour; no wrapper
|
|
811
811
|
needed.
|
|
812
812
|
|
|
813
813
|
### Path syntax
|
|
@@ -859,7 +859,7 @@ portable.
|
|
|
859
859
|
- **Catastrophic backtracking.** ECMAScript `RegExp` uses backtracking;
|
|
860
860
|
nested quantifiers (e.g. `(a+)+`) against a non-matching suffix can be
|
|
861
861
|
exponential in the input length. The discovery panel measures ~180 ms
|
|
862
|
-
on Node 22 for `^(a+)+$` against 22 a
|
|
862
|
+
on Node 22 for `^(a+)+$` against 22 repetitions of `a` plus `!`. RE2-style engines
|
|
863
863
|
finish the same case in under 0.1 ms. Write linear-friendly patterns
|
|
864
864
|
(`a+` instead of `(a+)+`) and keep injected user input in
|
|
865
865
|
character classes, not in alternations.
|
package/dist/StructUtility.js
CHANGED
package/package.json
CHANGED