golar 0.1.4 → 0.1.5
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/builtin-rules.d.ts +2 -3
- package/dist/builtin-rules.generated.d.ts +3 -3
- package/dist/internal/linter/rule-creator.d.ts +3 -2
- package/dist/internal/linter/rule-creator.js +10 -10
- package/dist/internal/linter/rules/explicit-anys/config.js +3 -3
- package/dist/node_modules/.pnpm/valibot@1.3.1_typescript@5.9.3/node_modules/valibot/dist/index.d.ts +1430 -0
- package/dist/node_modules/.pnpm/valibot@1.3.1_typescript@5.9.3/node_modules/valibot/dist/index.js +658 -0
- package/dist/packages/golar/package.js +1 -1
- package/dist/workspace.js +2 -2
- package/package.json +9 -9
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/errors.d.ts +0 -22
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/errors.js +0 -29
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/iso.js +0 -37
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/parse.d.ts +0 -16
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/parse.js +0 -19
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/schemas.d.ts +0 -208
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/schemas.js +0 -578
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/api.d.ts +0 -32
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/api.js +0 -470
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/checks.d.ts +0 -64
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/checks.js +0 -225
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/core.d.ts +0 -47
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/core.js +0 -61
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/doc.js +0 -33
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/errors.d.ts +0 -127
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/errors.js +0 -62
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/json-schema-processors.js +0 -214
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/json-schema.d.ts +0 -69
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/parse.js +0 -109
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/regexes.js +0 -58
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/registries.d.ts +0 -31
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/registries.js +0 -49
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/schemas.d.ts +0 -805
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/schemas.js +0 -1096
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/standard-schema.d.ts +0 -120
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/to-json-schema.d.ts +0 -96
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/to-json-schema.js +0 -289
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/util.d.ts +0 -41
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/util.js +0 -304
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/versions.d.ts +0 -8
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/versions.js +0 -9
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "golar",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=22.12.0"
|
|
@@ -30,15 +30,15 @@
|
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"detect-libc": "^2.1.2",
|
|
33
|
-
"@golar/util": "0.1.
|
|
33
|
+
"@golar/util": "0.1.5"
|
|
34
34
|
},
|
|
35
35
|
"optionalDependencies": {
|
|
36
|
-
"@golar/darwin-
|
|
37
|
-
"@golar/linux-arm64": "0.1.
|
|
38
|
-
"@golar/darwin-
|
|
39
|
-
"@golar/linux-
|
|
40
|
-
"@golar/linux-
|
|
41
|
-
"@golar/
|
|
42
|
-
"@golar/
|
|
36
|
+
"@golar/darwin-x64": "0.1.5",
|
|
37
|
+
"@golar/linux-arm64": "0.1.5",
|
|
38
|
+
"@golar/darwin-arm64": "0.1.5",
|
|
39
|
+
"@golar/linux-x64": "0.1.5",
|
|
40
|
+
"@golar/linux-arm64-musl": "0.1.5",
|
|
41
|
+
"@golar/linux-x64-musl": "0.1.5",
|
|
42
|
+
"@golar/win32-x64": "0.1.5"
|
|
43
43
|
}
|
|
44
44
|
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { $ZodError, $ZodErrorMap, $ZodFlattenedError, $ZodFormattedError, $ZodIssue } from "../core/errors.js";
|
|
2
|
-
import { $constructor } from "../core/core.js";
|
|
3
|
-
|
|
4
|
-
//#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/errors.d.cts
|
|
5
|
-
/** An Error-like class used to store Zod validation issues. */
|
|
6
|
-
interface ZodError<T = unknown> extends $ZodError<T> {
|
|
7
|
-
/** @deprecated Use the `z.treeifyError(err)` function instead. */
|
|
8
|
-
format(): $ZodFormattedError<T>;
|
|
9
|
-
format<U>(mapper: (issue: $ZodIssue) => U): $ZodFormattedError<T, U>;
|
|
10
|
-
/** @deprecated Use the `z.treeifyError(err)` function instead. */
|
|
11
|
-
flatten(): $ZodFlattenedError<T>;
|
|
12
|
-
flatten<U>(mapper: (issue: $ZodIssue) => U): $ZodFlattenedError<T, U>;
|
|
13
|
-
/** @deprecated Push directly to `.issues` instead. */
|
|
14
|
-
addIssue(issue: $ZodIssue): void;
|
|
15
|
-
/** @deprecated Push directly to `.issues` instead. */
|
|
16
|
-
addIssues(issues: $ZodIssue[]): void;
|
|
17
|
-
/** @deprecated Check `err.issues.length === 0` instead. */
|
|
18
|
-
isEmpty: boolean;
|
|
19
|
-
}
|
|
20
|
-
declare const ZodError: $constructor<ZodError>;
|
|
21
|
-
//#endregion
|
|
22
|
-
export { ZodError };
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { $constructor } from "../core/core.js";
|
|
2
|
-
import { jsonStringifyReplacer } from "../core/util.js";
|
|
3
|
-
import { $ZodError, flattenError, formatError } from "../core/errors.js";
|
|
4
|
-
|
|
5
|
-
//#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/errors.js
|
|
6
|
-
const initializer = (inst, issues) => {
|
|
7
|
-
$ZodError.init(inst, issues);
|
|
8
|
-
inst.name = "ZodError";
|
|
9
|
-
Object.defineProperties(inst, {
|
|
10
|
-
format: { value: (mapper) => formatError(inst, mapper) },
|
|
11
|
-
flatten: { value: (mapper) => flattenError(inst, mapper) },
|
|
12
|
-
addIssue: { value: (issue) => {
|
|
13
|
-
inst.issues.push(issue);
|
|
14
|
-
inst.message = JSON.stringify(inst.issues, jsonStringifyReplacer, 2);
|
|
15
|
-
} },
|
|
16
|
-
addIssues: { value: (issues) => {
|
|
17
|
-
inst.issues.push(...issues);
|
|
18
|
-
inst.message = JSON.stringify(inst.issues, jsonStringifyReplacer, 2);
|
|
19
|
-
} },
|
|
20
|
-
isEmpty: { get() {
|
|
21
|
-
return inst.issues.length === 0;
|
|
22
|
-
} }
|
|
23
|
-
});
|
|
24
|
-
};
|
|
25
|
-
const ZodError = $constructor("ZodError", initializer);
|
|
26
|
-
const ZodRealError = $constructor("ZodError", initializer, { Parent: Error });
|
|
27
|
-
|
|
28
|
-
//#endregion
|
|
29
|
-
export { ZodRealError };
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { $constructor } from "../core/core.js";
|
|
2
|
-
import { $ZodISODate, $ZodISODateTime, $ZodISODuration, $ZodISOTime } from "../core/schemas.js";
|
|
3
|
-
import { _isoDate, _isoDateTime, _isoDuration, _isoTime } from "../core/api.js";
|
|
4
|
-
import { ZodStringFormat } from "./schemas.js";
|
|
5
|
-
|
|
6
|
-
//#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/iso.js
|
|
7
|
-
const ZodISODateTime = /* @__PURE__ */ $constructor("ZodISODateTime", (inst, def) => {
|
|
8
|
-
$ZodISODateTime.init(inst, def);
|
|
9
|
-
ZodStringFormat.init(inst, def);
|
|
10
|
-
});
|
|
11
|
-
function datetime(params) {
|
|
12
|
-
return _isoDateTime(ZodISODateTime, params);
|
|
13
|
-
}
|
|
14
|
-
const ZodISODate = /* @__PURE__ */ $constructor("ZodISODate", (inst, def) => {
|
|
15
|
-
$ZodISODate.init(inst, def);
|
|
16
|
-
ZodStringFormat.init(inst, def);
|
|
17
|
-
});
|
|
18
|
-
function date(params) {
|
|
19
|
-
return _isoDate(ZodISODate, params);
|
|
20
|
-
}
|
|
21
|
-
const ZodISOTime = /* @__PURE__ */ $constructor("ZodISOTime", (inst, def) => {
|
|
22
|
-
$ZodISOTime.init(inst, def);
|
|
23
|
-
ZodStringFormat.init(inst, def);
|
|
24
|
-
});
|
|
25
|
-
function time(params) {
|
|
26
|
-
return _isoTime(ZodISOTime, params);
|
|
27
|
-
}
|
|
28
|
-
const ZodISODuration = /* @__PURE__ */ $constructor("ZodISODuration", (inst, def) => {
|
|
29
|
-
$ZodISODuration.init(inst, def);
|
|
30
|
-
ZodStringFormat.init(inst, def);
|
|
31
|
-
});
|
|
32
|
-
function duration(params) {
|
|
33
|
-
return _isoDuration(ZodISODuration, params);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
//#endregion
|
|
37
|
-
export { date, datetime, duration, time };
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { ZodError } from "./errors.js";
|
|
2
|
-
|
|
3
|
-
//#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/parse.d.cts
|
|
4
|
-
type ZodSafeParseResult<T> = ZodSafeParseSuccess<T> | ZodSafeParseError<T>;
|
|
5
|
-
type ZodSafeParseSuccess<T> = {
|
|
6
|
-
success: true;
|
|
7
|
-
data: T;
|
|
8
|
-
error?: never;
|
|
9
|
-
};
|
|
10
|
-
type ZodSafeParseError<T> = {
|
|
11
|
-
success: false;
|
|
12
|
-
data?: never;
|
|
13
|
-
error: ZodError<T>;
|
|
14
|
-
};
|
|
15
|
-
//#endregion
|
|
16
|
-
export { ZodSafeParseResult };
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { _decode, _decodeAsync, _encode, _encodeAsync, _parse, _parseAsync, _safeDecode, _safeDecodeAsync, _safeEncode, _safeEncodeAsync, _safeParse, _safeParseAsync } from "../core/parse.js";
|
|
2
|
-
import { ZodRealError } from "./errors.js";
|
|
3
|
-
|
|
4
|
-
//#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/parse.js
|
|
5
|
-
const parse = /* @__PURE__ */ _parse(ZodRealError);
|
|
6
|
-
const parseAsync = /* @__PURE__ */ _parseAsync(ZodRealError);
|
|
7
|
-
const safeParse = /* @__PURE__ */ _safeParse(ZodRealError);
|
|
8
|
-
const safeParseAsync = /* @__PURE__ */ _safeParseAsync(ZodRealError);
|
|
9
|
-
const encode = /* @__PURE__ */ _encode(ZodRealError);
|
|
10
|
-
const decode = /* @__PURE__ */ _decode(ZodRealError);
|
|
11
|
-
const encodeAsync = /* @__PURE__ */ _encodeAsync(ZodRealError);
|
|
12
|
-
const decodeAsync = /* @__PURE__ */ _decodeAsync(ZodRealError);
|
|
13
|
-
const safeEncode = /* @__PURE__ */ _safeEncode(ZodRealError);
|
|
14
|
-
const safeDecode = /* @__PURE__ */ _safeDecode(ZodRealError);
|
|
15
|
-
const safeEncodeAsync = /* @__PURE__ */ _safeEncodeAsync(ZodRealError);
|
|
16
|
-
const safeDecodeAsync = /* @__PURE__ */ _safeDecodeAsync(ZodRealError);
|
|
17
|
-
|
|
18
|
-
//#endregion
|
|
19
|
-
export { decode, decodeAsync, encode, encodeAsync, parse, parseAsync, safeDecode, safeDecodeAsync, safeEncode, safeEncodeAsync, safeParse, safeParseAsync };
|
|
@@ -1,208 +0,0 @@
|
|
|
1
|
-
import { StandardSchemaWithJSONProps } from "../core/standard-schema.js";
|
|
2
|
-
import { $ZodRegistry, $replace, GlobalMeta } from "../core/registries.js";
|
|
3
|
-
import { ToJSONSchemaParams, ZodStandardJSONSchemaPayload } from "../core/to-json-schema.js";
|
|
4
|
-
import { EnumLike, Extend, Flatten, Mask, NoUndefined, ToEnum } from "../core/util.js";
|
|
5
|
-
import { $ZodArray, $ZodArrayInternals, $ZodBooleanInternals, $ZodCatch, $ZodCatchCtx, $ZodCatchInternals, $ZodDefault, $ZodDefaultInternals, $ZodEnum, $ZodEnumInternals, $ZodExactOptional, $ZodExactOptionalInternals, $ZodIntersection, $ZodIntersectionInternals, $ZodLooseShape, $ZodNonOptional, $ZodNonOptionalInternals, $ZodNullable, $ZodNullableInternals, $ZodObject, $ZodObjectConfig, $ZodObjectInternals, $ZodOptional, $ZodOptionalInternals, $ZodPipe, $ZodPipeInternals, $ZodPrefault, $ZodPrefaultInternals, $ZodReadonly, $ZodReadonlyInternals, $ZodShape, $ZodTransform, $ZodTransformInternals, $ZodType, $ZodTypeInternals, $ZodUnion, $ZodUnionInternals, $catchall, $loose, $strict, $strip, CheckFn, ParseContext, SomeType } from "../core/schemas.js";
|
|
6
|
-
import { $ZodCheck } from "../core/checks.js";
|
|
7
|
-
import { $ZodIssue } from "../core/errors.js";
|
|
8
|
-
import { $ZodBranded, $constructor, input, output } from "../core/core.js";
|
|
9
|
-
import { $RefinementCtx, $ZodCheckLengthEqualsParams, $ZodCheckMaxLengthParams, $ZodCheckMinLengthParams, $ZodCustomParams, $ZodEnumParams, $ZodNonOptionalParams } from "../core/api.js";
|
|
10
|
-
import { ZodSafeParseResult } from "./parse.js";
|
|
11
|
-
|
|
12
|
-
//#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/schemas.d.cts
|
|
13
|
-
type ZodStandardSchemaWithJSON<T> = StandardSchemaWithJSONProps<input<T>, output<T>>;
|
|
14
|
-
interface ZodType<out Output = unknown, out Input = unknown, out Internals extends $ZodTypeInternals<Output, Input> = $ZodTypeInternals<Output, Input>> extends $ZodType<Output, Input, Internals> {
|
|
15
|
-
def: Internals["def"];
|
|
16
|
-
type: Internals["def"]["type"];
|
|
17
|
-
/** @deprecated Use `.def` instead. */
|
|
18
|
-
_def: Internals["def"];
|
|
19
|
-
/** @deprecated Use `z.output<typeof schema>` instead. */
|
|
20
|
-
_output: Internals["output"];
|
|
21
|
-
/** @deprecated Use `z.input<typeof schema>` instead. */
|
|
22
|
-
_input: Internals["input"];
|
|
23
|
-
"~standard": ZodStandardSchemaWithJSON<this>;
|
|
24
|
-
/** Converts this schema to a JSON Schema representation. */
|
|
25
|
-
toJSONSchema(params?: ToJSONSchemaParams): ZodStandardJSONSchemaPayload<this>;
|
|
26
|
-
check(...checks: (CheckFn<output<this>> | $ZodCheck<output<this>>)[]): this;
|
|
27
|
-
with(...checks: (CheckFn<output<this>> | $ZodCheck<output<this>>)[]): this;
|
|
28
|
-
clone(def?: Internals["def"], params?: {
|
|
29
|
-
parent: boolean;
|
|
30
|
-
}): this;
|
|
31
|
-
register<R extends $ZodRegistry>(registry: R, ...meta: this extends R["_schema"] ? undefined extends R["_meta"] ? [$replace<R["_meta"], this>?] : [$replace<R["_meta"], this>] : ["Incompatible schema"]): this;
|
|
32
|
-
brand<T extends PropertyKey = PropertyKey, Dir extends "in" | "out" | "inout" = "out">(value?: T): PropertyKey extends T ? this : $ZodBranded<this, T, Dir>;
|
|
33
|
-
parse(data: unknown, params?: ParseContext<$ZodIssue>): output<this>;
|
|
34
|
-
safeParse(data: unknown, params?: ParseContext<$ZodIssue>): ZodSafeParseResult<output<this>>;
|
|
35
|
-
parseAsync(data: unknown, params?: ParseContext<$ZodIssue>): Promise<output<this>>;
|
|
36
|
-
safeParseAsync(data: unknown, params?: ParseContext<$ZodIssue>): Promise<ZodSafeParseResult<output<this>>>;
|
|
37
|
-
spa: (data: unknown, params?: ParseContext<$ZodIssue>) => Promise<ZodSafeParseResult<output<this>>>;
|
|
38
|
-
encode(data: output<this>, params?: ParseContext<$ZodIssue>): input<this>;
|
|
39
|
-
decode(data: input<this>, params?: ParseContext<$ZodIssue>): output<this>;
|
|
40
|
-
encodeAsync(data: output<this>, params?: ParseContext<$ZodIssue>): Promise<input<this>>;
|
|
41
|
-
decodeAsync(data: input<this>, params?: ParseContext<$ZodIssue>): Promise<output<this>>;
|
|
42
|
-
safeEncode(data: output<this>, params?: ParseContext<$ZodIssue>): ZodSafeParseResult<input<this>>;
|
|
43
|
-
safeDecode(data: input<this>, params?: ParseContext<$ZodIssue>): ZodSafeParseResult<output<this>>;
|
|
44
|
-
safeEncodeAsync(data: output<this>, params?: ParseContext<$ZodIssue>): Promise<ZodSafeParseResult<input<this>>>;
|
|
45
|
-
safeDecodeAsync(data: input<this>, params?: ParseContext<$ZodIssue>): Promise<ZodSafeParseResult<output<this>>>;
|
|
46
|
-
refine<Ch extends (arg: output<this>) => unknown | Promise<unknown>>(check: Ch, params?: string | $ZodCustomParams): Ch extends ((arg: any) => arg is infer R) ? this & ZodType<R, input<this>> : this;
|
|
47
|
-
superRefine(refinement: (arg: output<this>, ctx: $RefinementCtx<output<this>>) => void | Promise<void>): this;
|
|
48
|
-
overwrite(fn: (x: output<this>) => output<this>): this;
|
|
49
|
-
optional(): ZodOptional<this>;
|
|
50
|
-
exactOptional(): ZodExactOptional<this>;
|
|
51
|
-
nonoptional(params?: string | $ZodNonOptionalParams): ZodNonOptional<this>;
|
|
52
|
-
nullable(): ZodNullable<this>;
|
|
53
|
-
nullish(): ZodOptional<ZodNullable<this>>;
|
|
54
|
-
default(def: NoUndefined<output<this>>): ZodDefault<this>;
|
|
55
|
-
default(def: () => NoUndefined<output<this>>): ZodDefault<this>;
|
|
56
|
-
prefault(def: () => input<this>): ZodPrefault<this>;
|
|
57
|
-
prefault(def: input<this>): ZodPrefault<this>;
|
|
58
|
-
array(): ZodArray<this>;
|
|
59
|
-
or<T extends SomeType>(option: T): ZodUnion<[this, T]>;
|
|
60
|
-
and<T extends SomeType>(incoming: T): ZodIntersection<this, T>;
|
|
61
|
-
transform<NewOut>(transform: (arg: output<this>, ctx: $RefinementCtx<output<this>>) => NewOut | Promise<NewOut>): ZodPipe<this, ZodTransform<Awaited<NewOut>, output<this>>>;
|
|
62
|
-
catch(def: output<this>): ZodCatch<this>;
|
|
63
|
-
catch(def: (ctx: $ZodCatchCtx) => output<this>): ZodCatch<this>;
|
|
64
|
-
pipe<T extends $ZodType<any, output<this>>>(target: T | $ZodType<any, output<this>>): ZodPipe<this, T>;
|
|
65
|
-
readonly(): ZodReadonly<this>;
|
|
66
|
-
/** Returns a new instance that has been registered in `z.globalRegistry` with the specified description */
|
|
67
|
-
describe(description: string): this;
|
|
68
|
-
description?: string;
|
|
69
|
-
/** Returns the metadata associated with this instance in `z.globalRegistry` */
|
|
70
|
-
meta(): $replace<GlobalMeta, this> | undefined;
|
|
71
|
-
/** Returns a new instance that has been registered in `z.globalRegistry` with the specified metadata */
|
|
72
|
-
meta(data: $replace<GlobalMeta, this>): this;
|
|
73
|
-
/** @deprecated Try safe-parsing `undefined` (this is what `isOptional` does internally):
|
|
74
|
-
*
|
|
75
|
-
* ```ts
|
|
76
|
-
* const schema = z.string().optional();
|
|
77
|
-
* const isOptional = schema.safeParse(undefined).success; // true
|
|
78
|
-
* ```
|
|
79
|
-
*/
|
|
80
|
-
isOptional(): boolean;
|
|
81
|
-
/**
|
|
82
|
-
* @deprecated Try safe-parsing `null` (this is what `isNullable` does internally):
|
|
83
|
-
*
|
|
84
|
-
* ```ts
|
|
85
|
-
* const schema = z.string().nullable();
|
|
86
|
-
* const isNullable = schema.safeParse(null).success; // true
|
|
87
|
-
* ```
|
|
88
|
-
*/
|
|
89
|
-
isNullable(): boolean;
|
|
90
|
-
apply<T>(fn: (schema: this) => T): T;
|
|
91
|
-
}
|
|
92
|
-
interface _ZodType<out Internals extends $ZodTypeInternals = $ZodTypeInternals> extends ZodType<any, any, Internals> {}
|
|
93
|
-
declare const ZodType: $constructor<ZodType>;
|
|
94
|
-
interface _ZodBoolean<T extends $ZodBooleanInternals = $ZodBooleanInternals> extends _ZodType<T> {}
|
|
95
|
-
interface ZodBoolean extends _ZodBoolean<$ZodBooleanInternals<boolean>> {}
|
|
96
|
-
declare const ZodBoolean: $constructor<ZodBoolean>;
|
|
97
|
-
interface ZodArray<T extends SomeType = $ZodType> extends _ZodType<$ZodArrayInternals<T>>, $ZodArray<T> {
|
|
98
|
-
element: T;
|
|
99
|
-
min(minLength: number, params?: string | $ZodCheckMinLengthParams): this;
|
|
100
|
-
nonempty(params?: string | $ZodCheckMinLengthParams): this;
|
|
101
|
-
max(maxLength: number, params?: string | $ZodCheckMaxLengthParams): this;
|
|
102
|
-
length(len: number, params?: string | $ZodCheckLengthEqualsParams): this;
|
|
103
|
-
unwrap(): T;
|
|
104
|
-
"~standard": ZodStandardSchemaWithJSON<this>;
|
|
105
|
-
}
|
|
106
|
-
declare const ZodArray: $constructor<ZodArray>;
|
|
107
|
-
type SafeExtendShape<Base extends $ZodShape, Ext extends $ZodLooseShape> = { [K in keyof Ext]: K extends keyof Base ? output<Ext[K]> extends output<Base[K]> ? input<Ext[K]> extends input<Base[K]> ? Ext[K] : never : never : Ext[K] };
|
|
108
|
-
interface ZodObject< /** @ts-ignore Cast variance */out Shape extends $ZodShape = $ZodLooseShape, out Config extends $ZodObjectConfig = $strip> extends _ZodType<$ZodObjectInternals<Shape, Config>>, $ZodObject<Shape, Config> {
|
|
109
|
-
"~standard": ZodStandardSchemaWithJSON<this>;
|
|
110
|
-
shape: Shape;
|
|
111
|
-
keyof(): ZodEnum<ToEnum<keyof Shape & string>>;
|
|
112
|
-
/** Define a schema to validate all unrecognized keys. This overrides the existing strict/loose behavior. */
|
|
113
|
-
catchall<T extends SomeType>(schema: T): ZodObject<Shape, $catchall<T>>;
|
|
114
|
-
/** @deprecated Use `z.looseObject()` or `.loose()` instead. */
|
|
115
|
-
passthrough(): ZodObject<Shape, $loose>;
|
|
116
|
-
/** Consider `z.looseObject(A.shape)` instead */
|
|
117
|
-
loose(): ZodObject<Shape, $loose>;
|
|
118
|
-
/** Consider `z.strictObject(A.shape)` instead */
|
|
119
|
-
strict(): ZodObject<Shape, $strict>;
|
|
120
|
-
/** This is the default behavior. This method call is likely unnecessary. */
|
|
121
|
-
strip(): ZodObject<Shape, $strip>;
|
|
122
|
-
extend<U extends $ZodLooseShape>(shape: U): ZodObject<Extend<Shape, U>, Config>;
|
|
123
|
-
safeExtend<U extends $ZodLooseShape>(shape: SafeExtendShape<Shape, U> & Partial<Record<keyof Shape, SomeType>>): ZodObject<Extend<Shape, U>, Config>;
|
|
124
|
-
/**
|
|
125
|
-
* @deprecated Use [`A.extend(B.shape)`](https://zod.dev/api?id=extend) instead.
|
|
126
|
-
*/
|
|
127
|
-
merge<U extends ZodObject>(other: U): ZodObject<Extend<Shape, U["shape"]>, U["_zod"]["config"]>;
|
|
128
|
-
pick<M extends Mask<keyof Shape>>(mask: M & Record<Exclude<keyof M, keyof Shape>, never>): ZodObject<Flatten<Pick<Shape, Extract<keyof Shape, keyof M>>>, Config>;
|
|
129
|
-
omit<M extends Mask<keyof Shape>>(mask: M & Record<Exclude<keyof M, keyof Shape>, never>): ZodObject<Flatten<Omit<Shape, Extract<keyof Shape, keyof M>>>, Config>;
|
|
130
|
-
partial(): ZodObject<{ [k in keyof Shape]: ZodOptional<Shape[k]> }, Config>;
|
|
131
|
-
partial<M extends Mask<keyof Shape>>(mask: M & Record<Exclude<keyof M, keyof Shape>, never>): ZodObject<{ [k in keyof Shape]: k extends keyof M ? ZodOptional<Shape[k]> : Shape[k] }, Config>;
|
|
132
|
-
required(): ZodObject<{ [k in keyof Shape]: ZodNonOptional<Shape[k]> }, Config>;
|
|
133
|
-
required<M extends Mask<keyof Shape>>(mask: M & Record<Exclude<keyof M, keyof Shape>, never>): ZodObject<{ [k in keyof Shape]: k extends keyof M ? ZodNonOptional<Shape[k]> : Shape[k] }, Config>;
|
|
134
|
-
}
|
|
135
|
-
declare const ZodObject: $constructor<ZodObject>;
|
|
136
|
-
interface ZodUnion<T extends readonly SomeType[] = readonly $ZodType[]> extends _ZodType<$ZodUnionInternals<T>>, $ZodUnion<T> {
|
|
137
|
-
"~standard": ZodStandardSchemaWithJSON<this>;
|
|
138
|
-
options: T;
|
|
139
|
-
}
|
|
140
|
-
declare const ZodUnion: $constructor<ZodUnion>;
|
|
141
|
-
interface ZodIntersection<A extends SomeType = $ZodType, B extends SomeType = $ZodType> extends _ZodType<$ZodIntersectionInternals<A, B>>, $ZodIntersection<A, B> {
|
|
142
|
-
"~standard": ZodStandardSchemaWithJSON<this>;
|
|
143
|
-
}
|
|
144
|
-
declare const ZodIntersection: $constructor<ZodIntersection>;
|
|
145
|
-
interface ZodEnum< /** @ts-ignore Cast variance */out T extends EnumLike = EnumLike> extends _ZodType<$ZodEnumInternals<T>>, $ZodEnum<T> {
|
|
146
|
-
"~standard": ZodStandardSchemaWithJSON<this>;
|
|
147
|
-
enum: T;
|
|
148
|
-
options: Array<T[keyof T]>;
|
|
149
|
-
extract<const U extends readonly (keyof T)[]>(values: U, params?: string | $ZodEnumParams): ZodEnum<Flatten<Pick<T, U[number]>>>;
|
|
150
|
-
exclude<const U extends readonly (keyof T)[]>(values: U, params?: string | $ZodEnumParams): ZodEnum<Flatten<Omit<T, U[number]>>>;
|
|
151
|
-
}
|
|
152
|
-
declare const ZodEnum: $constructor<ZodEnum>;
|
|
153
|
-
interface ZodTransform<O = unknown, I = unknown> extends _ZodType<$ZodTransformInternals<O, I>>, $ZodTransform<O, I> {
|
|
154
|
-
"~standard": ZodStandardSchemaWithJSON<this>;
|
|
155
|
-
}
|
|
156
|
-
declare const ZodTransform: $constructor<ZodTransform>;
|
|
157
|
-
interface ZodOptional<T extends SomeType = $ZodType> extends _ZodType<$ZodOptionalInternals<T>>, $ZodOptional<T> {
|
|
158
|
-
"~standard": ZodStandardSchemaWithJSON<this>;
|
|
159
|
-
unwrap(): T;
|
|
160
|
-
}
|
|
161
|
-
declare const ZodOptional: $constructor<ZodOptional>;
|
|
162
|
-
interface ZodExactOptional<T extends SomeType = $ZodType> extends _ZodType<$ZodExactOptionalInternals<T>>, $ZodExactOptional<T> {
|
|
163
|
-
"~standard": ZodStandardSchemaWithJSON<this>;
|
|
164
|
-
unwrap(): T;
|
|
165
|
-
}
|
|
166
|
-
declare const ZodExactOptional: $constructor<ZodExactOptional>;
|
|
167
|
-
interface ZodNullable<T extends SomeType = $ZodType> extends _ZodType<$ZodNullableInternals<T>>, $ZodNullable<T> {
|
|
168
|
-
"~standard": ZodStandardSchemaWithJSON<this>;
|
|
169
|
-
unwrap(): T;
|
|
170
|
-
}
|
|
171
|
-
declare const ZodNullable: $constructor<ZodNullable>;
|
|
172
|
-
interface ZodDefault<T extends SomeType = $ZodType> extends _ZodType<$ZodDefaultInternals<T>>, $ZodDefault<T> {
|
|
173
|
-
"~standard": ZodStandardSchemaWithJSON<this>;
|
|
174
|
-
unwrap(): T;
|
|
175
|
-
/** @deprecated Use `.unwrap()` instead. */
|
|
176
|
-
removeDefault(): T;
|
|
177
|
-
}
|
|
178
|
-
declare const ZodDefault: $constructor<ZodDefault>;
|
|
179
|
-
interface ZodPrefault<T extends SomeType = $ZodType> extends _ZodType<$ZodPrefaultInternals<T>>, $ZodPrefault<T> {
|
|
180
|
-
"~standard": ZodStandardSchemaWithJSON<this>;
|
|
181
|
-
unwrap(): T;
|
|
182
|
-
}
|
|
183
|
-
declare const ZodPrefault: $constructor<ZodPrefault>;
|
|
184
|
-
interface ZodNonOptional<T extends SomeType = $ZodType> extends _ZodType<$ZodNonOptionalInternals<T>>, $ZodNonOptional<T> {
|
|
185
|
-
"~standard": ZodStandardSchemaWithJSON<this>;
|
|
186
|
-
unwrap(): T;
|
|
187
|
-
}
|
|
188
|
-
declare const ZodNonOptional: $constructor<ZodNonOptional>;
|
|
189
|
-
interface ZodCatch<T extends SomeType = $ZodType> extends _ZodType<$ZodCatchInternals<T>>, $ZodCatch<T> {
|
|
190
|
-
"~standard": ZodStandardSchemaWithJSON<this>;
|
|
191
|
-
unwrap(): T;
|
|
192
|
-
/** @deprecated Use `.unwrap()` instead. */
|
|
193
|
-
removeCatch(): T;
|
|
194
|
-
}
|
|
195
|
-
declare const ZodCatch: $constructor<ZodCatch>;
|
|
196
|
-
interface ZodPipe<A extends SomeType = $ZodType, B extends SomeType = $ZodType> extends _ZodType<$ZodPipeInternals<A, B>>, $ZodPipe<A, B> {
|
|
197
|
-
"~standard": ZodStandardSchemaWithJSON<this>;
|
|
198
|
-
in: A;
|
|
199
|
-
out: B;
|
|
200
|
-
}
|
|
201
|
-
declare const ZodPipe: $constructor<ZodPipe>;
|
|
202
|
-
interface ZodReadonly<T extends SomeType = $ZodType> extends _ZodType<$ZodReadonlyInternals<T>>, $ZodReadonly<T> {
|
|
203
|
-
"~standard": ZodStandardSchemaWithJSON<this>;
|
|
204
|
-
unwrap(): T;
|
|
205
|
-
}
|
|
206
|
-
declare const ZodReadonly: $constructor<ZodReadonly>;
|
|
207
|
-
//#endregion
|
|
208
|
-
export { ZodBoolean, ZodDefault, ZodObject };
|