@orkestrel/contract 0.0.15 → 0.0.17
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 +11 -5
- package/dist/src/core/index.cjs +2135 -2034
- package/dist/src/core/index.cjs.map +1 -1
- package/dist/src/core/index.d.cts +1550 -1226
- package/dist/src/core/index.d.ts +1550 -1226
- package/dist/src/core/index.js +2129 -2021
- package/dist/src/core/index.js.map +1 -1
- package/package.json +11 -12
package/README.md
CHANGED
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
# @orkestrel/contract
|
|
2
2
|
|
|
3
|
-
The zero-dependency contract toolkit — runtime type guards, guard combinators,
|
|
4
|
-
parsers, and a shape DSL that compiles
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
> The zero-dependency contract toolkit — runtime type guards, guard combinators,
|
|
4
|
+
> coerce-and-extract parsers, and a shape DSL that compiles one declaration into a JSON
|
|
5
|
+
> Schema, a guard, a parser, a strict audit, a parse report, and a generator, every one of
|
|
6
|
+
> them derived from a single owned snapshot of that declaration.
|
|
7
|
+
|
|
8
|
+
Declare a value's shape once with the shape builders, compile it with the `createContract`
|
|
9
|
+
function, and take the member each call site needs: `is` to narrow, `parse` to coerce, `audit` and
|
|
10
|
+
`explain` to diagnose, `schema` to publish, and `generate` to seed a fixture. Where a whole
|
|
11
|
+
declaration is more than the job needs, take a bare guard, combinator, or parser instead. The
|
|
12
|
+
foundation package of the `@orkestrel` line.
|
|
7
13
|
|
|
8
14
|
## Install
|
|
9
15
|
|
|
@@ -45,7 +51,7 @@ user.generate(seededRandom(42)) // reproducible seed data; omit the arg for a wa
|
|
|
45
51
|
## Guide
|
|
46
52
|
|
|
47
53
|
For the full surface — guards, combinators, parsers, the JSON boundary, and the shape DSL — see
|
|
48
|
-
[`guides/
|
|
54
|
+
[`guides/contract.md`](https://github.com/orkestrel/contract/blob/main/guides/contract.md).
|
|
49
55
|
The guide is not published in the npm tarball (`files` ships `dist/src` and this README), so the
|
|
50
56
|
link is absolute on purpose: a relative one resolves in the repository and is dead in the package.
|
|
51
57
|
|