@douglasneuroinformatics/libjs 1.3.1 → 1.4.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/zod.d.ts +4 -2
- package/dist/zod.d.ts.map +1 -1
- package/dist/zod.js +17 -0
- package/package.json +1 -1
package/dist/zod.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
/** Used to determine if object is of type `ZodType` independent of specific instances or library versions */
|
|
3
3
|
export declare function isZodType(arg: unknown): arg is z.ZodTypeAny;
|
|
4
|
-
export declare const $BooleanLike: z.
|
|
5
|
-
export declare const $NumberLike: z.
|
|
4
|
+
export declare const $BooleanLike: z.ZodType<boolean, z.ZodTypeDef, any>;
|
|
5
|
+
export declare const $NumberLike: z.ZodType<number, z.ZodTypeDef, any>;
|
|
6
|
+
export declare const $UrlLike: z.ZodType<URL, z.ZodTypeDef, any>;
|
|
7
|
+
export declare const $Uint8ArrayLike: z.ZodType<Uint8Array, z.ZodTypeDef, any>;
|
|
6
8
|
//# sourceMappingURL=zod.d.ts.map
|
package/dist/zod.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zod.d.ts","sourceRoot":"","sources":["../src/zod.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,6GAA6G;AAC7G,wBAAgB,SAAS,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,CAAC,CAAC,UAAU,CAM3D;AAED,eAAO,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"zod.d.ts","sourceRoot":"","sources":["../src/zod.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,6GAA6G;AAC7G,wBAAgB,SAAS,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,CAAC,CAAC,UAAU,CAM3D;AAED,eAAO,MAAM,YAAY,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC,UAAU,EAAE,GAAG,CAShD,CAAC;AAEhB,eAAO,MAAM,WAAW,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,UAAU,EAAE,GAAG,CAK/C,CAAC;AAEf,eAAO,MAAM,QAAQ,EAAE,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,UAAU,EAAE,GAAG,CAWtD,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,CAAC,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC,CAAC,UAAU,EAAE,GAAG,CAOjE,CAAC"}
|
package/dist/zod.js
CHANGED
|
@@ -26,3 +26,20 @@ export const $NumberLike = z.preprocess((arg) => {
|
|
|
26
26
|
}
|
|
27
27
|
return arg;
|
|
28
28
|
}, z.number());
|
|
29
|
+
export const $UrlLike = z.preprocess((arg) => {
|
|
30
|
+
if (arg instanceof URL) {
|
|
31
|
+
return arg.href;
|
|
32
|
+
}
|
|
33
|
+
return arg;
|
|
34
|
+
}, z
|
|
35
|
+
.string()
|
|
36
|
+
.url()
|
|
37
|
+
.transform((arg) => new URL(arg)));
|
|
38
|
+
export const $Uint8ArrayLike = z
|
|
39
|
+
.union([z.array(z.number().int().min(0).max(255)), z.instanceof(Uint8Array), z.instanceof(ArrayBuffer)])
|
|
40
|
+
.transform((arg) => {
|
|
41
|
+
if (!(arg instanceof Uint8Array)) {
|
|
42
|
+
return new Uint8Array(arg);
|
|
43
|
+
}
|
|
44
|
+
return arg;
|
|
45
|
+
});
|
package/package.json
CHANGED