@orpc/json-schema 2.0.0-beta.49 → 2.0.0-beta.50
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/coercer.d.ts +26 -26
- package/dist/coercer.js +316 -460
- package/dist/composition-utils.d.ts +4 -8
- package/dist/composition-utils.js +281 -351
- package/dist/constants.js +63 -62
- package/dist/convert.d.ts +16 -16
- package/dist/convert.js +12 -14
- package/dist/index.d.ts +11 -10
- package/dist/index.js +9 -9
- package/dist/ref-utils.d.ts +3 -7
- package/dist/ref-utils.js +178 -228
- package/dist/smart-coercion-handler-plugin.d.ts +13 -13
- package/dist/smart-coercion-handler-plugin.js +46 -49
- package/dist/smart-coercion-link-plugin.d.ts +19 -19
- package/dist/smart-coercion-link-plugin.js +62 -74
- package/dist/standard-json-schema-converter.d.ts +8 -8
- package/dist/standard-json-schema-converter.js +34 -43
- package/dist/types.d.ts +34 -36
- package/dist/types.js +42 -40
- package/dist/utils.d.ts +6 -10
- package/dist/utils.js +59 -91
- package/package.json +6 -6
- package/dist/constants.d.ts +0 -8
package/dist/coercer.d.ts
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { JsonSchema } from "./types.js";
|
|
2
2
|
export interface JsonSchemaCoercerOptions {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Maximum digits, excluding a leading `-`, of a string coerced to `bigint`. Longer strings are left unchanged.
|
|
5
|
+
* `Number.POSITIVE_INFINITY` disables it.
|
|
6
|
+
*
|
|
7
|
+
* @default 4300
|
|
8
|
+
*/
|
|
9
|
+
maxBigIntDigits?: number | undefined;
|
|
10
|
+
/**
|
|
11
|
+
* Maximum coercion steps per input value, where a step applies one schema to one value.
|
|
12
|
+
* Inputs with fewer than 100 values are budgeted as 100. Past the budget the whole input is left uncoerced,
|
|
13
|
+
* so validation still runs and reports any mismatch.
|
|
14
|
+
*
|
|
15
|
+
* @default 1000
|
|
16
|
+
*/
|
|
17
|
+
maxStepsPerValue?: number | undefined;
|
|
18
18
|
}
|
|
19
19
|
export declare class JsonSchemaCoercer {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
20
|
+
private readonly nativeCoerceOptions;
|
|
21
|
+
private readonly maxStepsPerValue;
|
|
22
|
+
/** Reused between calls, since building a context is slow until V8 warms up. */
|
|
23
|
+
private idleContext;
|
|
24
|
+
constructor(options?: JsonSchemaCoercerOptions);
|
|
25
|
+
coerce([schema, optional]: [schema: JsonSchema, optional: boolean], value: unknown): unknown;
|
|
26
|
+
private coerceInternal;
|
|
27
|
+
private coerceRef;
|
|
28
|
+
private extendBudget;
|
|
29
|
+
}
|