@flare-ts/lib 0.3.0-next.6 → 0.3.0-next.7
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/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/schema/index.d.ts +1 -0
- package/dist/schema/index.d.ts.map +1 -1
- package/dist/schema/primitives/array.d.ts +1 -1
- package/dist/schema/primitives/index.d.ts +5 -5
- package/dist/schema/schema.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,cAAc,mBAAmB,CAAC"}
|
package/dist/schema/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/** `@flare-ts/lib/schema`: the schema surface - primitives, `schema`/`model`, and JSON Schema serialization. */
|
|
1
2
|
export { array, bool, date, defaultTo, email, enums, float, int, optional, str, text, url, uuid, } from "./primitives/index.js";
|
|
2
3
|
export type { ArrayTypedPrimitive, Primitive, PrimitiveJsonSchema, TypedPrimitive } from "./primitives/index.js";
|
|
3
4
|
export { model } from "./model.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schema/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schema/index.ts"],"names":[],"mappings":"AAAA,gHAAgH;AAGhH,OAAO,EACL,KAAK,EACL,IAAI,EACJ,IAAI,EACJ,SAAS,EACT,KAAK,EACL,KAAK,EACL,KAAK,EACL,GAAG,EACH,QAAQ,EACR,GAAG,EACH,IAAI,EACJ,GAAG,EACH,IAAI,GACL,MAAM,uBAAuB,CAAC;AAE/B,YAAY,EAAE,mBAAmB,EAAE,SAAS,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAGjH,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,YAAY,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AACpD,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AACpH,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAGnG,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACvE,YAAY,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { TypedPrimitive } from "./index.js";
|
|
2
2
|
/**
|
|
3
|
-
* Creates a primitive that splits a comma-separated string and
|
|
3
|
+
* Creates a primitive that splits a comma-separated string and parses each item
|
|
4
4
|
* using the provided `primitive`. An empty or missing input produces an empty array.
|
|
5
5
|
*
|
|
6
6
|
* @example
|
|
@@ -38,7 +38,7 @@ export type PrimitiveJsonSchema = Record<string, never> | {
|
|
|
38
38
|
items: PrimitiveJsonSchema;
|
|
39
39
|
};
|
|
40
40
|
/**
|
|
41
|
-
* Opaque reference to a primitive
|
|
41
|
+
* Opaque reference to a primitive parser.
|
|
42
42
|
*
|
|
43
43
|
* Carries the runtime metadata (`_type`, `_required`, `jsonSchema`) but no
|
|
44
44
|
* value-type information. Used wherever a collection of primitives is held
|
|
@@ -51,21 +51,21 @@ export type Primitive = {
|
|
|
51
51
|
readonly jsonSchema: PrimitiveJsonSchema;
|
|
52
52
|
};
|
|
53
53
|
/**
|
|
54
|
-
* Carries the output type alongside the primitive
|
|
54
|
+
* Carries the output type alongside the primitive parser.
|
|
55
55
|
*
|
|
56
56
|
* Callable as `(v: string) => T`. Used as a leaf value inside schema
|
|
57
57
|
* descriptors and wherever the output type is needed.
|
|
58
58
|
*
|
|
59
|
-
* @template T The output type produced after
|
|
59
|
+
* @template T The output type produced after parsing and validation.
|
|
60
60
|
*/
|
|
61
61
|
export type TypedPrimitive<T> = Primitive & {
|
|
62
62
|
(v: string): T;
|
|
63
63
|
};
|
|
64
64
|
/**
|
|
65
|
-
* Array-accepting primitive
|
|
65
|
+
* Array-accepting primitive parser that splits a comma-separated string or
|
|
66
66
|
* maps over an existing string array.
|
|
67
67
|
*
|
|
68
|
-
* @template T The element type produced after
|
|
68
|
+
* @template T The element type produced after parsing each item.
|
|
69
69
|
*/
|
|
70
70
|
export type ArrayTypedPrimitive<T> = Primitive & {
|
|
71
71
|
(v: string | string[]): T[];
|
package/dist/schema/schema.d.ts
CHANGED
|
@@ -86,7 +86,7 @@ export type BranchShape<T, K extends keyof T, V extends DiscriminantValues<T, K>
|
|
|
86
86
|
/**
|
|
87
87
|
* Accepted value types for a single field within a schema descriptor.
|
|
88
88
|
*
|
|
89
|
-
* A field can be backed by either a {@link TypedPrimitive}
|
|
89
|
+
* A field can be backed by either a {@link TypedPrimitive} parser (e.g.
|
|
90
90
|
* `int`, `str`, `uuid`) or a nested {@link SchemaToken} produced by
|
|
91
91
|
* {@link schema}, enabling structural composition.
|
|
92
92
|
*
|
package/package.json
CHANGED