inferred-types 0.55.23 → 1.0.0-beta.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/README.md +3 -2
- package/modules/constants/dist/index.cjs +8641 -3110
- package/modules/constants/dist/index.cjs.map +1 -1
- package/modules/constants/dist/index.d.cts +4620 -0
- package/modules/constants/dist/index.d.cts.map +1 -0
- package/modules/constants/dist/index.d.ts +3502 -2987
- package/modules/constants/dist/index.d.ts.map +1 -0
- package/modules/constants/dist/index.js +8406 -2897
- package/modules/constants/dist/index.js.map +1 -1
- package/modules/inferred-types/dist/index.cjs +18 -9778
- package/modules/inferred-types/dist/index.d.cts +3 -0
- package/modules/inferred-types/dist/index.d.ts +3 -39237
- package/modules/inferred-types/dist/index.js +3 -9063
- package/modules/runtime/dist/index.cjs +16161 -6430
- package/modules/runtime/dist/index.cjs.map +1 -1
- package/modules/runtime/dist/index.d.cts +14592 -0
- package/modules/runtime/dist/index.d.cts.map +1 -0
- package/modules/runtime/dist/index.d.ts +10550 -11940
- package/modules/runtime/dist/index.d.ts.map +1 -0
- package/modules/runtime/dist/index.js +15545 -5915
- package/modules/runtime/dist/index.js.map +1 -1
- package/modules/types/dist/index.d.mts +28483 -0
- package/modules/types/dist/index.d.mts.map +1 -0
- package/modules/types/dist/index.d.ts +23952 -14621
- package/modules/types/dist/index.d.ts.map +1 -0
- package/modules/types/dist/index.js +224 -201
- package/modules/types/dist/index.js.map +1 -1
- package/modules/types/dist/index.mjs +216 -0
- package/modules/types/dist/index.mjs.map +1 -0
- package/package.json +126 -106
- package/modules/inferred-types/dist/index.cjs.map +0 -1
- package/modules/inferred-types/dist/index.js.map +0 -1
- package/modules/types/dist/index.cjs +0 -249
- package/modules/types/dist/index.cjs.map +0 -1
package/README.md
CHANGED
|
@@ -19,7 +19,7 @@ Under the `src/` folder you'll find the the following subdirectories:
|
|
|
19
19
|
|
|
20
20
|
## Runtime synchronization with Types
|
|
21
21
|
|
|
22
|
-
You will find many runtime functions like `
|
|
22
|
+
You will find many runtime functions like `ensureLeading(str, substring)` which have a similarly named type (in this case `EnsureLeading<TStr, TSubstring>`). This is no accident and at some future point there may even be something approximating 1:1 parity.
|
|
23
23
|
|
|
24
24
|
This connection between the type system and the runtime environment allows both a harmonization of variables across both environments and helps to ensure their consistency but it the runtime environment also often really needs strong type utilities to extract out narrow type definitions in the runtime environment.
|
|
25
25
|
|
|
@@ -49,7 +49,7 @@ const people = pluralize("person");
|
|
|
49
49
|
|
|
50
50
|
#### Consistency with Ensure/Strip utilities
|
|
51
51
|
|
|
52
|
-
- it's often
|
|
52
|
+
- it's often desirable to _ensure_ that a string _starts with_ or _ends with_ a given string
|
|
53
53
|
- the inverse can also be useful (aka, to _ensure_ a string _does not_ start or end with a given string literal)
|
|
54
54
|
- this library provides `EnsureLeading`, `EnsureTrailing`, `StripLeading`, and `StripTrailing` utilities to meet these type needs
|
|
55
55
|
|
|
@@ -92,6 +92,7 @@ const fooBar = matcher("infer is a fancy utility, that thinks it's better than y
|
|
|
92
92
|
- ensure an _integer_ value with `Integer<T>`; ensure a _float_ value with `Float<T>`
|
|
93
93
|
- compare numeric literals with `LessThan<A,B>`, `LessThanOrEqual<A,B>`, and `GreaterThan<A,B>`
|
|
94
94
|
- ensure a _positive_ number with `Abs<T>`
|
|
95
|
+
- [details on numeric types](./docs/numeric-types.md)
|
|
95
96
|
|
|
96
97
|
### Lists
|
|
97
98
|
|