@ariestools/sdk 7.0.5 → 7.0.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/_pkg/object/neutral/JsonObject.d.ts +6 -6
- package/dist/_pkg/object/neutral/index-un-deprecated.mjs +1 -1
- package/dist/_pkg/object/neutral/index.mjs +1 -1
- package/dist/browser/index.d.ts +0 -1
- package/dist/browser/index.mjs +0 -1
- package/dist/neutral/model.d.ts +0 -1
- package/dist/neutral/model.mjs +0 -1
- package/dist/node/index.d.ts +0 -1
- package/dist/node/index.mjs +0 -1
- package/package.json +51 -57
- package/dist/_pkg/zod/neutral/Config.d.ts +0 -7
- package/dist/_pkg/zod/neutral/index.d.ts +0 -7
- package/dist/_pkg/zod/neutral/index.mjs +0 -126
- package/dist/_pkg/zod/neutral/model.d.ts +0 -1
- package/dist/_pkg/zod/neutral/model.mjs +0 -0
- package/dist/_pkg/zod/neutral/zodAllFactory.d.ts +0 -19
- package/dist/_pkg/zod/neutral/zodAsAsyncFactory.d.ts +0 -13
- package/dist/_pkg/zod/neutral/zodAsFactory.d.ts +0 -13
- package/dist/_pkg/zod/neutral/zodIsFactory.d.ts +0 -7
- package/dist/_pkg/zod/neutral/zodToAsyncFactory.d.ts +0 -13
- package/dist/_pkg/zod/neutral/zodToFactory.d.ts +0 -13
- package/dist/neutral/zod.d.ts +0 -1
- package/dist/neutral/zod.mjs +0 -1
- package/dist/neutral/zod.model.d.ts +0 -1
- package/dist/neutral/zod.model.mjs +0 -1
|
@@ -14,35 +14,35 @@ export declare const isJsonValue: <T>(value: T) => value is T;
|
|
|
14
14
|
/** Casts a value to JsonValue or returns undefined if it does not conform. */
|
|
15
15
|
export declare const asJsonValue: {
|
|
16
16
|
<T>(value: T): T | undefined;
|
|
17
|
-
<T>(value: T, assert: import("
|
|
17
|
+
<T>(value: T, assert: import("@ariestools/zod").ZodFactoryConfig): T;
|
|
18
18
|
};
|
|
19
19
|
/** Parses a value into a JsonValue, throwing if it does not conform. */
|
|
20
20
|
export declare const toJsonValue: {
|
|
21
21
|
<T>(value: T): T | undefined;
|
|
22
|
-
<T>(value: T, assert: import("
|
|
22
|
+
<T>(value: T, assert: import("@ariestools/zod").ZodFactoryConfig): T;
|
|
23
23
|
};
|
|
24
24
|
/** Type guard that checks if a value is a valid JSON array. */
|
|
25
25
|
export declare const isJsonArray: <T>(value: T) => value is T & unknown[];
|
|
26
26
|
/** Casts a value to JsonArray or returns undefined if it does not conform. */
|
|
27
27
|
export declare const asJsonArray: {
|
|
28
28
|
<T>(value: T): (T & unknown[]) | undefined;
|
|
29
|
-
<T>(value: T, assert: import("
|
|
29
|
+
<T>(value: T, assert: import("@ariestools/zod").ZodFactoryConfig): T & unknown[];
|
|
30
30
|
};
|
|
31
31
|
/** Parses a value into a JsonArray, throwing if it does not conform. */
|
|
32
32
|
export declare const toJsonArray: {
|
|
33
33
|
<T>(value: T): (T & unknown[]) | undefined;
|
|
34
|
-
<T>(value: T, assert: import("
|
|
34
|
+
<T>(value: T, assert: import("@ariestools/zod").ZodFactoryConfig): T & unknown[];
|
|
35
35
|
};
|
|
36
36
|
/** Type guard that checks if a value is a valid JSON object. */
|
|
37
37
|
export declare const isJsonObject: <T>(value: T) => value is T & Record<string, unknown>;
|
|
38
38
|
/** Casts a value to JsonObject or returns undefined if it does not conform. */
|
|
39
39
|
export declare const asJsonObject: {
|
|
40
40
|
<T>(value: T): (T & Record<string, unknown>) | undefined;
|
|
41
|
-
<T>(value: T, assert: import("
|
|
41
|
+
<T>(value: T, assert: import("@ariestools/zod").ZodFactoryConfig): T & Record<string, unknown>;
|
|
42
42
|
};
|
|
43
43
|
/** Parses a value into a JsonObject, throwing if it does not conform. */
|
|
44
44
|
export declare const toJsonObject: {
|
|
45
45
|
<T>(value: T): (T & Record<string, unknown>) | undefined;
|
|
46
|
-
<T>(value: T, assert: import("
|
|
46
|
+
<T>(value: T, assert: import("@ariestools/zod").ZodFactoryConfig): T & Record<string, unknown>;
|
|
47
47
|
};
|
|
48
48
|
export {};
|
|
@@ -129,7 +129,7 @@ import {
|
|
|
129
129
|
zodAsFactory,
|
|
130
130
|
zodIsFactory,
|
|
131
131
|
zodToFactory
|
|
132
|
-
} from "
|
|
132
|
+
} from "@ariestools/zod";
|
|
133
133
|
import * as z from "zod/mini";
|
|
134
134
|
var JsonArrayZod = z.array(z.lazy(() => JsonValueZod));
|
|
135
135
|
var JsonValueZod = z.lazy(() => z.union([
|
|
@@ -239,7 +239,7 @@ import {
|
|
|
239
239
|
zodAsFactory,
|
|
240
240
|
zodIsFactory,
|
|
241
241
|
zodToFactory
|
|
242
|
-
} from "
|
|
242
|
+
} from "@ariestools/zod";
|
|
243
243
|
import * as z from "zod/mini";
|
|
244
244
|
var JsonArrayZod = z.array(z.lazy(() => JsonValueZod));
|
|
245
245
|
var JsonValueZod = z.lazy(() => z.union([
|
package/dist/browser/index.d.ts
CHANGED
package/dist/browser/index.mjs
CHANGED
package/dist/neutral/model.d.ts
CHANGED
|
@@ -15,4 +15,3 @@ export type * from '../_pkg/retry/neutral/model.ts'
|
|
|
15
15
|
export type * from '../_pkg/storage/neutral/model.ts'
|
|
16
16
|
export type * from '../_pkg/telemetry/neutral/model.ts'
|
|
17
17
|
export type * from '../_pkg/typeof/neutral/model.ts'
|
|
18
|
-
export type * from '../_pkg/zod/neutral/model.ts'
|
package/dist/neutral/model.mjs
CHANGED
package/dist/node/index.d.ts
CHANGED
package/dist/node/index.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ariestools/sdk",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.7",
|
|
4
4
|
"description": "All-in-one umbrella for the Aries Tools TypeScript/JavaScript utility libraries",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ariestools",
|
|
@@ -257,14 +257,6 @@
|
|
|
257
257
|
"default": "./dist/neutral/url.mjs"
|
|
258
258
|
}
|
|
259
259
|
},
|
|
260
|
-
"./zod": {
|
|
261
|
-
"types": "./dist/neutral/zod.d.ts",
|
|
262
|
-
"default": "./dist/neutral/zod.mjs"
|
|
263
|
-
},
|
|
264
|
-
"./zod/model": {
|
|
265
|
-
"types": "./dist/neutral/zod.model.d.ts",
|
|
266
|
-
"default": "./dist/neutral/zod.model.mjs"
|
|
267
|
-
},
|
|
268
260
|
"./package.json": "./package.json"
|
|
269
261
|
},
|
|
270
262
|
"files": [
|
|
@@ -274,57 +266,59 @@
|
|
|
274
266
|
"!**/*.test.*",
|
|
275
267
|
"README.md"
|
|
276
268
|
],
|
|
269
|
+
"dependencies": {
|
|
270
|
+
"@ariestools/zod": "~7.0.7"
|
|
271
|
+
},
|
|
277
272
|
"devDependencies": {
|
|
278
|
-
"@opentelemetry/api": "
|
|
279
|
-
"@opentelemetry/sdk-trace-base": "
|
|
280
|
-
"@xylabs/toolchain": "
|
|
281
|
-
"@xylabs/tsconfig": "
|
|
282
|
-
"async-mutex": "
|
|
283
|
-
"browserslist": "4.28.4",
|
|
284
|
-
"eslint": "
|
|
285
|
-
"eslint-import-resolver-typescript": "
|
|
286
|
-
"typescript": "
|
|
287
|
-
"vite": "
|
|
288
|
-
"vitest": "
|
|
289
|
-
"zod": "
|
|
290
|
-
"@internal/
|
|
291
|
-
"@internal/
|
|
292
|
-
"@internal/
|
|
293
|
-
"@internal/assert": "~7.0.
|
|
294
|
-
"@internal/
|
|
295
|
-
"@internal/
|
|
296
|
-
"@internal/delay": "~7.0.
|
|
297
|
-
"@internal/
|
|
298
|
-
"@internal/
|
|
299
|
-
"@internal/
|
|
300
|
-
"@internal/error": "~7.0.
|
|
301
|
-
"@internal/
|
|
302
|
-
"@internal/exists": "~7.0.
|
|
303
|
-
"@internal/
|
|
304
|
-
"@internal/forget": "~7.0.
|
|
305
|
-
"@internal/function-name": "~7.0.
|
|
306
|
-
"@internal/
|
|
307
|
-
"@internal/
|
|
308
|
-
"@internal/
|
|
309
|
-
"@internal/
|
|
310
|
-
"@internal/promise": "~7.0.
|
|
311
|
-
"@internal/
|
|
312
|
-
"@internal/
|
|
313
|
-
"@internal/static-implements": "~7.0.
|
|
314
|
-
"@internal/
|
|
315
|
-
"@internal/storage": "~7.0.
|
|
316
|
-
"@internal/telemetry": "~7.0.
|
|
317
|
-
"@internal/
|
|
318
|
-
"@internal/
|
|
319
|
-
"@internal/
|
|
320
|
-
"@internal/
|
|
321
|
-
"@internal/zod": "~7.0.5"
|
|
273
|
+
"@opentelemetry/api": "~1.9.1",
|
|
274
|
+
"@opentelemetry/sdk-trace-base": "~2.9.0",
|
|
275
|
+
"@xylabs/toolchain": "~8.6.2",
|
|
276
|
+
"@xylabs/tsconfig": "~8.6.2",
|
|
277
|
+
"async-mutex": "~0.5.0",
|
|
278
|
+
"browserslist": "~4.28.4",
|
|
279
|
+
"eslint": "~10.6.0",
|
|
280
|
+
"eslint-import-resolver-typescript": "~4.4.5",
|
|
281
|
+
"typescript": "~6.0.3",
|
|
282
|
+
"vite": "~8.1.3",
|
|
283
|
+
"vitest": "~4.1.9",
|
|
284
|
+
"zod": "~4.4.3",
|
|
285
|
+
"@internal/array": "~7.0.7",
|
|
286
|
+
"@internal/api": "~7.0.7",
|
|
287
|
+
"@internal/arraybuffer": "~7.0.7",
|
|
288
|
+
"@internal/assert": "~7.0.7",
|
|
289
|
+
"@internal/creatable": "~7.0.7",
|
|
290
|
+
"@internal/decimal-precision": "~7.0.7",
|
|
291
|
+
"@internal/delay": "~7.0.7",
|
|
292
|
+
"@internal/base": "~7.0.7",
|
|
293
|
+
"@internal/ellipsize": "~7.0.7",
|
|
294
|
+
"@internal/enum": "~7.0.7",
|
|
295
|
+
"@internal/error": "~7.0.7",
|
|
296
|
+
"@internal/events": "~7.0.7",
|
|
297
|
+
"@internal/exists": "~7.0.7",
|
|
298
|
+
"@internal/fetch": "~7.0.7",
|
|
299
|
+
"@internal/forget": "~7.0.7",
|
|
300
|
+
"@internal/function-name": "~7.0.7",
|
|
301
|
+
"@internal/logger": "~7.0.7",
|
|
302
|
+
"@internal/hex": "~7.0.7",
|
|
303
|
+
"@internal/object": "~7.0.7",
|
|
304
|
+
"@internal/retry": "~7.0.7",
|
|
305
|
+
"@internal/promise": "~7.0.7",
|
|
306
|
+
"@internal/profile": "~7.0.7",
|
|
307
|
+
"@internal/platform": "~7.0.7",
|
|
308
|
+
"@internal/static-implements": "~7.0.7",
|
|
309
|
+
"@internal/set": "~7.0.7",
|
|
310
|
+
"@internal/storage": "~7.0.7",
|
|
311
|
+
"@internal/telemetry": "~7.0.7",
|
|
312
|
+
"@internal/timer": "~7.0.7",
|
|
313
|
+
"@internal/telemetry-exporter": "~7.0.7",
|
|
314
|
+
"@internal/url": "~7.0.7",
|
|
315
|
+
"@internal/typeof": "~7.0.7"
|
|
322
316
|
},
|
|
323
317
|
"peerDependencies": {
|
|
324
|
-
"@opentelemetry/api": "^1.9",
|
|
325
|
-
"@opentelemetry/sdk-trace-base": "^2.
|
|
326
|
-
"async-mutex": "^0.5",
|
|
327
|
-
"zod": "^4.4"
|
|
318
|
+
"@opentelemetry/api": "^1.9.1",
|
|
319
|
+
"@opentelemetry/sdk-trace-base": "^2.9.0",
|
|
320
|
+
"async-mutex": "^0.5.0",
|
|
321
|
+
"zod": "^4.4.3"
|
|
328
322
|
},
|
|
329
323
|
"engines": {
|
|
330
324
|
"node": ">=18.17.1"
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { AssertConfig } from '../../error/neutral/index.ts';
|
|
2
|
-
/** Configuration object for zod factory functions, providing a name for error messages. */
|
|
3
|
-
export interface ZodFactoryConfigObject {
|
|
4
|
-
name: string;
|
|
5
|
-
}
|
|
6
|
-
/** Configuration for zod factory assertion behavior, either an AssertConfig or a named config object. */
|
|
7
|
-
export type ZodFactoryConfig = AssertConfig | ZodFactoryConfigObject;
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
// src/zodAsFactory.ts
|
|
2
|
-
import { assertError } from "../../error/neutral/index.mjs";
|
|
3
|
-
import * as z from "zod/v4/core";
|
|
4
|
-
var formatZodValue = (value) => {
|
|
5
|
-
const json = JSON.stringify(value);
|
|
6
|
-
return json ?? String(value);
|
|
7
|
-
};
|
|
8
|
-
function zodAsFactory(zod, name) {
|
|
9
|
-
function asFunc(value, assert) {
|
|
10
|
-
const result = z.safeParse(zod, value);
|
|
11
|
-
if (result.success) {
|
|
12
|
-
return value;
|
|
13
|
-
}
|
|
14
|
-
if (assert !== void 0) {
|
|
15
|
-
let assertConfig;
|
|
16
|
-
switch (typeof assert) {
|
|
17
|
-
case "string": {
|
|
18
|
-
assertConfig = `[${name}][${formatZodValue(value)}] ${assert}`;
|
|
19
|
-
break;
|
|
20
|
-
}
|
|
21
|
-
case "object": {
|
|
22
|
-
assertConfig = `[${name}][${assert.name}][${formatZodValue(value)}] ${result.error.message}`;
|
|
23
|
-
break;
|
|
24
|
-
}
|
|
25
|
-
case "boolean": {
|
|
26
|
-
assertConfig = `[${name}][${formatZodValue(value)}] ${result.error.message}`;
|
|
27
|
-
break;
|
|
28
|
-
}
|
|
29
|
-
case "function": {
|
|
30
|
-
assertConfig = assert(value, result.error.message);
|
|
31
|
-
break;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
return assertError(value, assertConfig, result.error.message);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
return asFunc;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
// src/zodIsFactory.ts
|
|
41
|
-
import * as z2 from "zod/v4/core";
|
|
42
|
-
function zodIsFactory(zod) {
|
|
43
|
-
return (value) => z2.safeParse(zod, value).success;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
// src/zodToFactory.ts
|
|
47
|
-
import { isDefined } from "../../typeof/neutral/index.mjs";
|
|
48
|
-
function zodToFactory(zod, name) {
|
|
49
|
-
const as = zodAsFactory(zod, name);
|
|
50
|
-
function toFunc(value, assert) {
|
|
51
|
-
if (isDefined(assert)) {
|
|
52
|
-
return as(value, assert);
|
|
53
|
-
}
|
|
54
|
-
return as(value);
|
|
55
|
-
}
|
|
56
|
-
return toFunc;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
// src/zodAllFactory.ts
|
|
60
|
-
function zodAllFactory(zod, name) {
|
|
61
|
-
return {
|
|
62
|
-
[`is${name}`]: zodIsFactory(zod),
|
|
63
|
-
[`as${name}`]: zodAsFactory(zod, `as${name}`),
|
|
64
|
-
[`to${name}`]: zodToFactory(zod, `to${name}`)
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
// src/zodAsAsyncFactory.ts
|
|
69
|
-
import { assertError as assertError2 } from "../../error/neutral/index.mjs";
|
|
70
|
-
import * as z3 from "zod/v4/core";
|
|
71
|
-
var formatZodValue2 = (value) => {
|
|
72
|
-
const json = JSON.stringify(value);
|
|
73
|
-
return json ?? String(value);
|
|
74
|
-
};
|
|
75
|
-
function zodAsAsyncFactory(zod, name) {
|
|
76
|
-
async function asFunc(value, assert) {
|
|
77
|
-
const result = await z3.safeParseAsync(zod, value);
|
|
78
|
-
if (result.success) {
|
|
79
|
-
return value;
|
|
80
|
-
}
|
|
81
|
-
if (assert !== void 0) {
|
|
82
|
-
let assertConfig;
|
|
83
|
-
switch (typeof assert) {
|
|
84
|
-
case "string": {
|
|
85
|
-
assertConfig = `[${name}][${formatZodValue2(value)}] ${assert}`;
|
|
86
|
-
break;
|
|
87
|
-
}
|
|
88
|
-
case "object": {
|
|
89
|
-
assertConfig = `[${name}][${assert.name}][${formatZodValue2(value)}] ${result.error.message}`;
|
|
90
|
-
break;
|
|
91
|
-
}
|
|
92
|
-
case "boolean": {
|
|
93
|
-
assertConfig = `[${name}][${formatZodValue2(value)}] ${result.error.message}`;
|
|
94
|
-
break;
|
|
95
|
-
}
|
|
96
|
-
case "function": {
|
|
97
|
-
assertConfig = assert(value, result.error.message);
|
|
98
|
-
break;
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
return assertError2(value, assertConfig, result.error.message);
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
return asFunc;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
// src/zodToAsyncFactory.ts
|
|
108
|
-
import { isDefined as isDefined2 } from "../../typeof/neutral/index.mjs";
|
|
109
|
-
function zodToAsyncFactory(zod, name) {
|
|
110
|
-
const as = zodAsAsyncFactory(zod, name);
|
|
111
|
-
async function toFunc(value, assert) {
|
|
112
|
-
if (isDefined2(assert)) {
|
|
113
|
-
return await as(value, assert);
|
|
114
|
-
}
|
|
115
|
-
return await as(value);
|
|
116
|
-
}
|
|
117
|
-
return toFunc;
|
|
118
|
-
}
|
|
119
|
-
export {
|
|
120
|
-
zodAllFactory,
|
|
121
|
-
zodAsAsyncFactory,
|
|
122
|
-
zodAsFactory,
|
|
123
|
-
zodIsFactory,
|
|
124
|
-
zodToAsyncFactory,
|
|
125
|
-
zodToFactory
|
|
126
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type * from './Config.ts';
|
|
File without changes
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type * as z from 'zod/v4/core';
|
|
2
|
-
import { zodAsFactory } from './zodAsFactory.ts';
|
|
3
|
-
import { zodIsFactory } from './zodIsFactory.ts';
|
|
4
|
-
import { zodToFactory } from './zodToFactory.ts';
|
|
5
|
-
/** @alpha */
|
|
6
|
-
export type AllZodFactories<TType, TName extends string> = Record<`is${TName}`, ReturnType<typeof zodIsFactory<TType>>> & Record<`as${TName}`, ReturnType<typeof zodAsFactory<TType>>> & Record<`to${TName}`, ReturnType<typeof zodToFactory<TType>>>;
|
|
7
|
-
/**
|
|
8
|
-
* Creates a bundle of `is`, `as`, and `to` factory functions for a given zod schema.
|
|
9
|
-
* @alpha
|
|
10
|
-
* @param zod - The zod schema to validate against
|
|
11
|
-
* @param name - The name used to suffix the generated function names (e.g. 'Address' produces `isAddress`, `asAddress`, `toAddress`)
|
|
12
|
-
* @returns An object containing `is<Name>`, `as<Name>`, and `to<Name>` functions
|
|
13
|
-
*/
|
|
14
|
-
export declare function zodAllFactory<T, TName extends string>(zod: z.$ZodType<T>, name: TName): {
|
|
15
|
-
[x: string]: {
|
|
16
|
-
<T_1>(value: T_1): (T_1 & T) | undefined;
|
|
17
|
-
<T_1>(value: T_1, assert: import("./Config.ts").ZodFactoryConfig): T_1 & T;
|
|
18
|
-
};
|
|
19
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import * as z from 'zod/v4/core';
|
|
2
|
-
import type { ZodFactoryConfig } from './Config.ts';
|
|
3
|
-
/**
|
|
4
|
-
* Creates an async function that validates a value against a zod schema and returns it with a narrowed type.
|
|
5
|
-
* Uses `safeParseAsync` for schemas with async refinements. When called without an assert config, returns undefined on failure.
|
|
6
|
-
* @param zod - The zod schema to validate against
|
|
7
|
-
* @param name - A name used in error messages for identification
|
|
8
|
-
* @returns An async function that validates and narrows the type of a value
|
|
9
|
-
*/
|
|
10
|
-
export declare function zodAsAsyncFactory<TZod>(zod: z.$ZodType<TZod>, name: string): {
|
|
11
|
-
<T>(value: T): Promise<(T & TZod) | undefined>;
|
|
12
|
-
<T>(value: T, assert: ZodFactoryConfig): Promise<(T & TZod)>;
|
|
13
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import * as z from 'zod/v4/core';
|
|
2
|
-
import type { ZodFactoryConfig } from './Config.ts';
|
|
3
|
-
/**
|
|
4
|
-
* Creates a function that validates a value against a zod schema and returns it with a narrowed type.
|
|
5
|
-
* When called without an assert config, returns undefined on failure. When called with an assert config, throws on failure.
|
|
6
|
-
* @param zod - The zod schema to validate against
|
|
7
|
-
* @param name - A name used in error messages for identification
|
|
8
|
-
* @returns A function that validates and narrows the type of a value
|
|
9
|
-
*/
|
|
10
|
-
export declare function zodAsFactory<TZod>(zod: z.$ZodType<TZod>, name: string): {
|
|
11
|
-
<T>(value: T): (T & TZod) | undefined;
|
|
12
|
-
<T>(value: T, assert: ZodFactoryConfig): (T & TZod);
|
|
13
|
-
};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import * as z from 'zod/v4/core';
|
|
2
|
-
/**
|
|
3
|
-
* Creates a type guard function that checks if a value matches a zod schema.
|
|
4
|
-
* @param zod - The zod schema to validate against
|
|
5
|
-
* @returns A type guard function that returns true if the value passes validation
|
|
6
|
-
*/
|
|
7
|
-
export declare function zodIsFactory<TZod>(zod: z.$ZodType<TZod>): <T>(value: T) => value is T & TZod;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type * as z from 'zod/v4/core';
|
|
2
|
-
import type { ZodFactoryConfig } from './Config.ts';
|
|
3
|
-
/**
|
|
4
|
-
* Creates an async function that converts a value to the zod schema type, delegating to `zodAsAsyncFactory` internally.
|
|
5
|
-
* Provides overloads for optional assertion: without assert config resolves to undefined on failure, with assert config throws on failure.
|
|
6
|
-
* @param zod - The zod schema to validate against
|
|
7
|
-
* @param name - A name used in error messages for identification
|
|
8
|
-
* @returns An async function that validates and converts a value to the schema type
|
|
9
|
-
*/
|
|
10
|
-
export declare function zodToAsyncFactory<TZod>(zod: z.$ZodType<TZod>, name: string): {
|
|
11
|
-
<T>(value: T): Promise<(T & TZod) | undefined>;
|
|
12
|
-
<T>(value: T, assert: ZodFactoryConfig): Promise<(T & TZod)>;
|
|
13
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type * as z from 'zod/v4/core';
|
|
2
|
-
import type { ZodFactoryConfig } from './Config.ts';
|
|
3
|
-
/**
|
|
4
|
-
* Creates a function that converts a value to the zod schema type, delegating to `zodAsFactory` internally.
|
|
5
|
-
* Provides overloads for optional assertion: without assert config returns undefined on failure, with assert config throws on failure.
|
|
6
|
-
* @param zod - The zod schema to validate against
|
|
7
|
-
* @param name - A name used in error messages for identification
|
|
8
|
-
* @returns A function that validates and converts a value to the schema type
|
|
9
|
-
*/
|
|
10
|
-
export declare function zodToFactory<TZod>(zod: z.$ZodType<TZod>, name: string): {
|
|
11
|
-
<T>(value: T): (T & TZod) | undefined;
|
|
12
|
-
<T>(value: T, assert: ZodFactoryConfig): (T & TZod);
|
|
13
|
-
};
|
package/dist/neutral/zod.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '../_pkg/zod/neutral/index.ts'
|
package/dist/neutral/zod.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '../_pkg/zod/neutral/index.mjs'
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type * from '../_pkg/zod/neutral/model.ts'
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '../_pkg/zod/neutral/model.mjs'
|