@drzl/validation-core 3.17.0 → 3.18.0
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.cts +20 -14
- package/dist/index.d.ts +20 -14
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -285,7 +285,7 @@ declare function parseCheck(expression: string | undefined, name?: string): Pars
|
|
|
285
285
|
declare function describeSet(set: ColumnSet): string;
|
|
286
286
|
|
|
287
287
|
/**
|
|
288
|
-
* What a relations-aware nested schema describes, decided once for all
|
|
288
|
+
* What a relations-aware nested schema describes, decided once for all five generators.
|
|
289
289
|
*
|
|
290
290
|
* A caller who inserts a parent and its children in one payload, `{ ...user, posts: [...] }`, has
|
|
291
291
|
* nothing to validate it against. Every first-party Drizzle validator emits columns only: measured
|
|
@@ -391,7 +391,7 @@ declare function buildNestedPlan(root: Table$1, tables: readonly Table$1[], rela
|
|
|
391
391
|
/**
|
|
392
392
|
* The comment lines that go above an arm, without their `//`.
|
|
393
393
|
*
|
|
394
|
-
* Shared so the
|
|
394
|
+
* Shared so the five generators say the same thing about the same relation, and returned unmarked
|
|
395
395
|
* because each of them indents its object literal differently.
|
|
396
396
|
*/
|
|
397
397
|
declare function nestedArmNotes(arm: NestedArm): string[];
|
|
@@ -418,7 +418,7 @@ declare function nestedNodeColumns<T extends {
|
|
|
418
418
|
* is worth checking, because it is the half a user can fix before sending anything.
|
|
419
419
|
*
|
|
420
420
|
* The emitted function is plain TypeScript with no reference to any validation library, so all
|
|
421
|
-
*
|
|
421
|
+
* five generators emit the same thing. It is rendered from one place for that reason.
|
|
422
422
|
*/
|
|
423
423
|
|
|
424
424
|
/**
|
|
@@ -437,7 +437,7 @@ interface Table {
|
|
|
437
437
|
columns: string[];
|
|
438
438
|
};
|
|
439
439
|
}
|
|
440
|
-
type ValidationLibrary = 'zod' | 'valibot' | 'arktype' | 'typebox';
|
|
440
|
+
type ValidationLibrary = 'zod' | 'valibot' | 'arktype' | 'typebox' | 'effect';
|
|
441
441
|
interface FormatOptions {
|
|
442
442
|
enabled?: boolean;
|
|
443
443
|
engine?: 'auto' | 'prettier' | 'biome';
|
|
@@ -701,11 +701,11 @@ declare function parsesToADate(expr: string): string;
|
|
|
701
701
|
* Refusing a user's emoji is the failure mode this avoids, and it is the same rule applied
|
|
702
702
|
* everywhere else here: never reject what the database accepts.
|
|
703
703
|
*
|
|
704
|
-
* All
|
|
705
|
-
* declarative forms, so
|
|
706
|
-
* kind onto the field
|
|
707
|
-
*
|
|
708
|
-
* different measurement is not a better trade.
|
|
704
|
+
* All five generators count code points. `@sinclair/typebox`, ArkType and Effect cannot say it in
|
|
705
|
+
* their declarative forms, so none of them uses `maxLength` or `string <= n`: TypeBox intersects a
|
|
706
|
+
* registered kind onto the field, ArkType puts a Type carrying a narrow there, and Effect pipes a
|
|
707
|
+
* `Schema.filter`. Each costs the same thing, the cap no longer serialising into a JSON Schema, and
|
|
708
|
+
* emitting a number that means a different measurement is not a better trade.
|
|
709
709
|
*
|
|
710
710
|
* MySQL's TEXT family is a byte budget rather than a character count, carried separately as
|
|
711
711
|
* `maxBytes`. Two measurements on string columns in the same database, verified against a real
|
|
@@ -717,18 +717,24 @@ declare function isIntegerColumn(c: Column): boolean;
|
|
|
717
717
|
* The non-finite doubles the emitted schema must admit beside the column's range, as the analyzer
|
|
718
718
|
* stated them.
|
|
719
719
|
*
|
|
720
|
-
* One reading of two flags, shared so that
|
|
721
|
-
* a shared *rendering*: the
|
|
720
|
+
* One reading of two flags, shared so that five generators cannot drift on what they mean, and not
|
|
721
|
+
* a shared *rendering*: the five libraries do not need the same repair. `z.number()` and
|
|
722
722
|
* `Type.Number()` refuse `NaN` and both infinities outright, `v.number()` and ArkType's `number`
|
|
723
|
-
* refuse only `NaN`, and any bound at all makes all
|
|
724
|
-
* add depends on the library and on whether the column carries a range.
|
|
723
|
+
* refuse only `NaN`, and any bound at all makes all of those refuse the infinities, so what each
|
|
724
|
+
* has to add depends on the library and on whether the column carries a range.
|
|
725
|
+
*
|
|
726
|
+
* Effect is the one that runs the other way, measured on 3.22.1: `Schema.Number` *accepts* `NaN`
|
|
727
|
+
* and both infinities, so the flags being false is what makes that generator emit something. It
|
|
728
|
+
* builds on `Schema.Finite` rather than `Schema.Number` for exactly that reason, and does so
|
|
729
|
+
* unconditionally rather than leaning on the range, since `Infinity >= 0` is true and a lower bound
|
|
730
|
+
* alone therefore excludes nothing.
|
|
725
731
|
*
|
|
726
732
|
* Guarded on `tsType` so an enum, a shape or a string can never pick these up from a stale
|
|
727
733
|
* analysis. `@drzl/generator-json-schema` deliberately does not call this at all: JSON has no `NaN`
|
|
728
734
|
* and no `Infinity`, so there is nothing for a JSON Schema to admit.
|
|
729
735
|
*
|
|
730
736
|
* A numeric CHECK folded into one end of the column's range does not take a branch away, in any of
|
|
731
|
-
* the
|
|
737
|
+
* the five. That is a decision rather than an oversight, and it is deliberately the loose one: what
|
|
732
738
|
* Postgres does with `CHECK (c >= 0)` and a `NaN` was not measured for this change, and dropping
|
|
733
739
|
* the branch on a column that carries a CHECK would put back, for that column, exactly the
|
|
734
740
|
* read-path failure this exists to remove.
|
package/dist/index.d.ts
CHANGED
|
@@ -285,7 +285,7 @@ declare function parseCheck(expression: string | undefined, name?: string): Pars
|
|
|
285
285
|
declare function describeSet(set: ColumnSet): string;
|
|
286
286
|
|
|
287
287
|
/**
|
|
288
|
-
* What a relations-aware nested schema describes, decided once for all
|
|
288
|
+
* What a relations-aware nested schema describes, decided once for all five generators.
|
|
289
289
|
*
|
|
290
290
|
* A caller who inserts a parent and its children in one payload, `{ ...user, posts: [...] }`, has
|
|
291
291
|
* nothing to validate it against. Every first-party Drizzle validator emits columns only: measured
|
|
@@ -391,7 +391,7 @@ declare function buildNestedPlan(root: Table$1, tables: readonly Table$1[], rela
|
|
|
391
391
|
/**
|
|
392
392
|
* The comment lines that go above an arm, without their `//`.
|
|
393
393
|
*
|
|
394
|
-
* Shared so the
|
|
394
|
+
* Shared so the five generators say the same thing about the same relation, and returned unmarked
|
|
395
395
|
* because each of them indents its object literal differently.
|
|
396
396
|
*/
|
|
397
397
|
declare function nestedArmNotes(arm: NestedArm): string[];
|
|
@@ -418,7 +418,7 @@ declare function nestedNodeColumns<T extends {
|
|
|
418
418
|
* is worth checking, because it is the half a user can fix before sending anything.
|
|
419
419
|
*
|
|
420
420
|
* The emitted function is plain TypeScript with no reference to any validation library, so all
|
|
421
|
-
*
|
|
421
|
+
* five generators emit the same thing. It is rendered from one place for that reason.
|
|
422
422
|
*/
|
|
423
423
|
|
|
424
424
|
/**
|
|
@@ -437,7 +437,7 @@ interface Table {
|
|
|
437
437
|
columns: string[];
|
|
438
438
|
};
|
|
439
439
|
}
|
|
440
|
-
type ValidationLibrary = 'zod' | 'valibot' | 'arktype' | 'typebox';
|
|
440
|
+
type ValidationLibrary = 'zod' | 'valibot' | 'arktype' | 'typebox' | 'effect';
|
|
441
441
|
interface FormatOptions {
|
|
442
442
|
enabled?: boolean;
|
|
443
443
|
engine?: 'auto' | 'prettier' | 'biome';
|
|
@@ -701,11 +701,11 @@ declare function parsesToADate(expr: string): string;
|
|
|
701
701
|
* Refusing a user's emoji is the failure mode this avoids, and it is the same rule applied
|
|
702
702
|
* everywhere else here: never reject what the database accepts.
|
|
703
703
|
*
|
|
704
|
-
* All
|
|
705
|
-
* declarative forms, so
|
|
706
|
-
* kind onto the field
|
|
707
|
-
*
|
|
708
|
-
* different measurement is not a better trade.
|
|
704
|
+
* All five generators count code points. `@sinclair/typebox`, ArkType and Effect cannot say it in
|
|
705
|
+
* their declarative forms, so none of them uses `maxLength` or `string <= n`: TypeBox intersects a
|
|
706
|
+
* registered kind onto the field, ArkType puts a Type carrying a narrow there, and Effect pipes a
|
|
707
|
+
* `Schema.filter`. Each costs the same thing, the cap no longer serialising into a JSON Schema, and
|
|
708
|
+
* emitting a number that means a different measurement is not a better trade.
|
|
709
709
|
*
|
|
710
710
|
* MySQL's TEXT family is a byte budget rather than a character count, carried separately as
|
|
711
711
|
* `maxBytes`. Two measurements on string columns in the same database, verified against a real
|
|
@@ -717,18 +717,24 @@ declare function isIntegerColumn(c: Column): boolean;
|
|
|
717
717
|
* The non-finite doubles the emitted schema must admit beside the column's range, as the analyzer
|
|
718
718
|
* stated them.
|
|
719
719
|
*
|
|
720
|
-
* One reading of two flags, shared so that
|
|
721
|
-
* a shared *rendering*: the
|
|
720
|
+
* One reading of two flags, shared so that five generators cannot drift on what they mean, and not
|
|
721
|
+
* a shared *rendering*: the five libraries do not need the same repair. `z.number()` and
|
|
722
722
|
* `Type.Number()` refuse `NaN` and both infinities outright, `v.number()` and ArkType's `number`
|
|
723
|
-
* refuse only `NaN`, and any bound at all makes all
|
|
724
|
-
* add depends on the library and on whether the column carries a range.
|
|
723
|
+
* refuse only `NaN`, and any bound at all makes all of those refuse the infinities, so what each
|
|
724
|
+
* has to add depends on the library and on whether the column carries a range.
|
|
725
|
+
*
|
|
726
|
+
* Effect is the one that runs the other way, measured on 3.22.1: `Schema.Number` *accepts* `NaN`
|
|
727
|
+
* and both infinities, so the flags being false is what makes that generator emit something. It
|
|
728
|
+
* builds on `Schema.Finite` rather than `Schema.Number` for exactly that reason, and does so
|
|
729
|
+
* unconditionally rather than leaning on the range, since `Infinity >= 0` is true and a lower bound
|
|
730
|
+
* alone therefore excludes nothing.
|
|
725
731
|
*
|
|
726
732
|
* Guarded on `tsType` so an enum, a shape or a string can never pick these up from a stale
|
|
727
733
|
* analysis. `@drzl/generator-json-schema` deliberately does not call this at all: JSON has no `NaN`
|
|
728
734
|
* and no `Infinity`, so there is nothing for a JSON Schema to admit.
|
|
729
735
|
*
|
|
730
736
|
* A numeric CHECK folded into one end of the column's range does not take a branch away, in any of
|
|
731
|
-
* the
|
|
737
|
+
* the five. That is a decision rather than an oversight, and it is deliberately the loose one: what
|
|
732
738
|
* Postgres does with `CHECK (c >= 0)` and a `NaN` was not measured for this change, and dropping
|
|
733
739
|
* the branch on a column that carries a CHECK would put back, for that column, exactly the
|
|
734
740
|
* read-path failure this exists to remove.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@drzl/validation-core",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.18.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
],
|
|
25
25
|
"sideEffects": false,
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@drzl/analyzer": "^1.
|
|
27
|
+
"@drzl/analyzer": "^1.18.0"
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
30
30
|
"prettier": ">=3"
|