/
home
/
techb158
/
balavpn.abdallabala.com
/
node_modules
/
zod
/
v4
/
core
/
/home/techb158/balavpn.abdallabala.com/node_modules/zod/v4/core
mkdir
upload
Name
Size
Mode
Actions
api.cjs
26465
0666
edit
dl
rm
api.d.cts
29445
0666
edit
dl
rm
api.d.ts
29440
0666
edit
dl
rm
api.js
22983
0666
edit
dl
rm
checks.cjs
21098
0666
edit
dl
rm
checks.d.cts
12782
0666
edit
dl
rm
checks.d.ts
12778
0666
edit
dl
rm
checks.js
19544
0666
edit
dl
rm
core.cjs
2309
0666
edit
dl
rm
core.d.cts
1811
0666
edit
dl
rm
core.d.ts
1808
0666
edit
dl
rm
core.js
2085
0666
edit
dl
rm
doc.cjs
1199
0666
edit
dl
rm
doc.d.cts
353
0666
edit
dl
rm
doc.d.ts
353
0666
edit
dl
rm
doc.js
1088
0666
edit
dl
rm
errors.cjs
7650
0666
edit
dl
rm
errors.d.cts
7893
0666
edit
dl
rm
errors.d.ts
7889
0666
edit
dl
rm
errors.js
6316
0666
edit
dl
rm
function.cjs
4012
0666
edit
dl
rm
function.d.cts
3597
0666
edit
dl
rm
function.d.ts
3593
0666
edit
dl
rm
function.js
2717
0666
edit
dl
rm
index.cjs
2163
0666
edit
dl
rm
index.d.cts
514
0666
edit
dl
rm
index.d.ts
499
0666
edit
dl
rm
index.js
499
0666
edit
dl
rm
json-schema.cjs
77
0666
edit
dl
rm
json-schema.d.cts
2676
0666
edit
dl
rm
json-schema.d.ts
2676
0666
edit
dl
rm
json-schema.js
11
0666
edit
dl
rm
parse.cjs
3957
0666
edit
dl
rm
parse.d.cts
1505
0666
edit
dl
rm
parse.d.ts
1501
0666
edit
dl
rm
parse.js
2552
0666
edit
dl
rm
regexes.cjs
7062
0666
edit
dl
rm
regexes.d.cts
2762
0666
edit
dl
rm
regexes.d.ts
2762
0666
edit
dl
rm
regexes.js
6411
0666
edit
dl
rm
registries.cjs
1676
0666
edit
dl
rm
registries.d.cts
1646
0666
edit
dl
rm
registries.d.ts
1644
0666
edit
dl
rm
registries.js
1485
0666
edit
dl
rm
schemas.cjs
64843
0666
edit
dl
rm
schemas.d.cts
44698
0666
edit
dl
rm
schemas.d.ts
44691
0666
edit
dl
rm
schemas.js
62652
0666
edit
dl
rm
standard-schema.cjs
77
0666
edit
dl
rm
standard-schema.d.cts
2403
0666
edit
dl
rm
standard-schema.d.ts
2403
0666
edit
dl
rm
standard-schema.js
11
0666
edit
dl
rm
to-json-schema.cjs
35910
0666
edit
dl
rm
to-json-schema.d.cts
3729
0666
edit
dl
rm
to-json-schema.d.ts
3726
0666
edit
dl
rm
to-json-schema.js
35687
0666
edit
dl
rm
util.cjs
16438
0666
edit
dl
rm
util.d.cts
10750
0666
edit
dl
rm
util.d.ts
10746
0666
edit
dl
rm
util.js
15004
0666
edit
dl
rm
versions.cjs
168
0666
edit
dl
rm
versions.d.cts
109
0666
edit
dl
rm
versions.d.ts
109
0666
edit
dl
rm
versions.js
70
0666
edit
dl
rm
Edit:
/home/techb158/balavpn.abdallabala.com/node_modules/zod/v4/core/util.js
(15004B)
// functions export function assertEqual(val) { return val; } export function assertNotEqual(val) { return val; } export function assertIs(_arg) { } export function assertNever(_x) { throw new Error(); } export function assert(_) { } export function getEnumValues(entries) { const numericValues = Object.values(entries).filter((v) => typeof v === "number"); const values = Object.entries(entries) .filter(([k, _]) => numericValues.indexOf(+k) === -1) .map(([_, v]) => v); return values; } export function joinValues(array, separator = "|") { return array.map((val) => stringifyPrimitive(val)).join(separator); } export function jsonStringifyReplacer(_, value) { if (typeof value === "bigint") return value.toString(); return value; } export function cached(getter) { const set = false; return { get value() { if (!set) { const value = getter(); Object.defineProperty(this, "value", { value }); return value; } throw new Error("cached value already set"); }, }; } export function nullish(input) { return input === null || input === undefined; } export function cleanRegex(source) { const start = source.startsWith("^") ? 1 : 0; const end = source.endsWith("$") ? source.length - 1 : source.length; return source.slice(start, end); } export function floatSafeRemainder(val, step) { const valDecCount = (val.toString().split(".")[1] || "").length; const stepDecCount = (step.toString().split(".")[1] || "").length; const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount; const valInt = Number.parseInt(val.toFixed(decCount).replace(".", "")); const stepInt = Number.parseInt(step.toFixed(decCount).replace(".", "")); return (valInt % stepInt) / 10 ** decCount; } export function defineLazy(object, key, getter) { const set = false; Object.defineProperty(object, key, { get() { if (!set) { const value = getter(); object[key] = value; return value; } throw new Error("cached value already set"); }, set(v) { Object.defineProperty(object, key, { value: v, // configurable: true, }); // object[key] = v; }, configurable: true, }); } export function assignProp(target, prop, value) { Object.defineProperty(target, prop, { value, writable: true, enumerable: true, configurable: true, }); } export function getElementAtPath(obj, path) { if (!path) return obj; return path.reduce((acc, key) => acc?.[key], obj); } export function promiseAllObject(promisesObj) { const keys = Object.keys(promisesObj); const promises = keys.map((key) => promisesObj[key]); return Promise.all(promises).then((results) => { const resolvedObj = {}; for (let i = 0; i < keys.length; i++) { resolvedObj[keys[i]] = results[i]; } return resolvedObj; }); } export function randomString(length = 10) { const chars = "abcdefghijklmnopqrstuvwxyz"; let str = ""; for (let i = 0; i < length; i++) { str += chars[Math.floor(Math.random() * chars.length)]; } return str; } export function esc(str) { return JSON.stringify(str); } export const captureStackTrace = Error.captureStackTrace ? Error.captureStackTrace : (..._args) => { }; export function isObject(data) { return typeof data === "object" && data !== null && !Array.isArray(data); } export const allowsEval = cached(() => { if (typeof navigator !== "undefined" && navigator?.userAgent?.includes("Cloudflare")) { return false; } try { const F = Function; new F(""); return true; } catch (_) { return false; } }); export function isPlainObject(o) { if (isObject(o) === false) return false; // modified constructor const ctor = o.constructor; if (ctor === undefined) return true; // modified prototype const prot = ctor.prototype; if (isObject(prot) === false) return false; // ctor doesn't have static `isPrototypeOf` if (Object.prototype.hasOwnProperty.call(prot, "isPrototypeOf") === false) { return false; } return true; } export function numKeys(data) { let keyCount = 0; for (const key in data) { if (Object.prototype.hasOwnProperty.call(data, key)) { keyCount++; } } return keyCount; } export const getParsedType = (data) => { const t = typeof data; switch (t) { case "undefined": return "undefined"; case "string": return "string"; case "number": return Number.isNaN(data) ? "nan" : "number"; case "boolean": return "boolean"; case "function": return "function"; case "bigint": return "bigint"; case "symbol": return "symbol"; case "object": if (Array.isArray(data)) { return "array"; } if (data === null) { return "null"; } if (data.then && typeof data.then === "function" && data.catch && typeof data.catch === "function") { return "promise"; } if (typeof Map !== "undefined" && data instanceof Map) { return "map"; } if (typeof Set !== "undefined" && data instanceof Set) { return "set"; } if (typeof Date !== "undefined" && data instanceof Date) { return "date"; } if (typeof File !== "undefined" && data instanceof File) { return "file"; } return "object"; default: throw new Error(`Unknown data type: ${t}`); } }; export const propertyKeyTypes = new Set(["string", "number", "symbol"]); export const primitiveTypes = new Set(["string", "number", "bigint", "boolean", "symbol", "undefined"]); export function escapeRegex(str) { return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); } // zod-specific utils export function clone(inst, def, params) { const cl = new inst._zod.constr(def ?? inst._zod.def); if (!def || params?.parent) cl._zod.parent = inst; return cl; } export function normalizeParams(_params) { const params = _params; if (!params) return {}; if (typeof params === "string") return { error: () => params }; if (params?.message !== undefined) { if (params?.error !== undefined) throw new Error("Cannot specify both `message` and `error` params"); params.error = params.message; } delete params.message; if (typeof params.error === "string") return { ...params, error: () => params.error }; return params; } export function createTransparentProxy(getter) { let target; return new Proxy({}, { get(_, prop, receiver) { target ?? (target = getter()); return Reflect.get(target, prop, receiver); }, set(_, prop, value, receiver) { target ?? (target = getter()); return Reflect.set(target, prop, value, receiver); }, has(_, prop) { target ?? (target = getter()); return Reflect.has(target, prop); }, deleteProperty(_, prop) { target ?? (target = getter()); return Reflect.deleteProperty(target, prop); }, ownKeys(_) { target ?? (target = getter()); return Reflect.ownKeys(target); }, getOwnPropertyDescriptor(_, prop) { target ?? (target = getter()); return Reflect.getOwnPropertyDescriptor(target, prop); }, defineProperty(_, prop, descriptor) { target ?? (target = getter()); return Reflect.defineProperty(target, prop, descriptor); }, }); } export function stringifyPrimitive(value) { if (typeof value === "bigint") return value.toString() + "n"; if (typeof value === "string") return `"${value}"`; return `${value}`; } export function optionalKeys(shape) { return Object.keys(shape).filter((k) => { return shape[k]._zod.optin === "optional" && shape[k]._zod.optout === "optional"; }); } export const NUMBER_FORMAT_RANGES = { safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER], int32: [-2147483648, 2147483647], uint32: [0, 4294967295], float32: [-3.4028234663852886e38, 3.4028234663852886e38], float64: [-Number.MAX_VALUE, Number.MAX_VALUE], }; export const BIGINT_FORMAT_RANGES = { int64: [/* @__PURE__*/ BigInt("-9223372036854775808"), /* @__PURE__*/ BigInt("9223372036854775807")], uint64: [/* @__PURE__*/ BigInt(0), /* @__PURE__*/ BigInt("18446744073709551615")], }; export function pick(schema, mask) { const newShape = {}; const currDef = schema._zod.def; //.shape; for (const key in mask) { if (!(key in currDef.shape)) { throw new Error(`Unrecognized key: "${key}"`); } if (!mask[key]) continue; // pick key newShape[key] = currDef.shape[key]; } return clone(schema, { ...schema._zod.def, shape: newShape, checks: [], }); } export function omit(schema, mask) { const newShape = { ...schema._zod.def.shape }; const currDef = schema._zod.def; //.shape; for (const key in mask) { if (!(key in currDef.shape)) { throw new Error(`Unrecognized key: "${key}"`); } if (!mask[key]) continue; delete newShape[key]; } return clone(schema, { ...schema._zod.def, shape: newShape, checks: [], }); } export function extend(schema, shape) { if (!isPlainObject(shape)) { throw new Error("Invalid input to extend: expected a plain object"); } const def = { ...schema._zod.def, get shape() { const _shape = { ...schema._zod.def.shape, ...shape }; assignProp(this, "shape", _shape); // self-caching return _shape; }, checks: [], // delete existing checks }; return clone(schema, def); } export function merge(a, b) { return clone(a, { ...a._zod.def, get shape() { const _shape = { ...a._zod.def.shape, ...b._zod.def.shape }; assignProp(this, "shape", _shape); // self-caching return _shape; }, catchall: b._zod.def.catchall, checks: [], // delete existing checks }); } export function partial(Class, schema, mask) { const oldShape = schema._zod.def.shape; const shape = { ...oldShape }; if (mask) { for (const key in mask) { if (!(key in oldShape)) { throw new Error(`Unrecognized key: "${key}"`); } if (!mask[key]) continue; // if (oldShape[key]!._zod.optin === "optional") continue; shape[key] = Class ? new Class({ type: "optional", innerType: oldShape[key], }) : oldShape[key]; } } else { for (const key in oldShape) { // if (oldShape[key]!._zod.optin === "optional") continue; shape[key] = Class ? new Class({ type: "optional", innerType: oldShape[key], }) : oldShape[key]; } } return clone(schema, { ...schema._zod.def, shape, checks: [], }); } export function required(Class, schema, mask) { const oldShape = schema._zod.def.shape; const shape = { ...oldShape }; if (mask) { for (const key in mask) { if (!(key in shape)) { throw new Error(`Unrecognized key: "${key}"`); } if (!mask[key]) continue; // overwrite with non-optional shape[key] = new Class({ type: "nonoptional", innerType: oldShape[key], }); } } else { for (const key in oldShape) { // overwrite with non-optional shape[key] = new Class({ type: "nonoptional", innerType: oldShape[key], }); } } return clone(schema, { ...schema._zod.def, shape, // optional: [], checks: [], }); } export function aborted(x, startIndex = 0) { for (let i = startIndex; i < x.issues.length; i++) { if (x.issues[i]?.continue !== true) return true; } return false; } export function prefixIssues(path, issues) { return issues.map((iss) => { var _a; (_a = iss).path ?? (_a.path = []); iss.path.unshift(path); return iss; }); } export function unwrapMessage(message) { return typeof message === "string" ? message : message?.message; } export function finalizeIssue(iss, ctx, config) { const full = { ...iss, path: iss.path ?? [] }; // for backwards compatibility if (!iss.message) { const message = unwrapMessage(iss.inst?._zod.def?.error?.(iss)) ?? unwrapMessage(ctx?.error?.(iss)) ?? unwrapMessage(config.customError?.(iss)) ?? unwrapMessage(config.localeError?.(iss)) ?? "Invalid input"; full.message = message; } // delete (full as any).def; delete full.inst; delete full.continue; if (!ctx?.reportInput) { delete full.input; } return full; } export function getSizableOrigin(input) { if (input instanceof Set) return "set"; if (input instanceof Map) return "map"; if (input instanceof File) return "file"; return "unknown"; } export function getLengthableOrigin(input) { if (Array.isArray(input)) return "array"; if (typeof input === "string") return "string"; return "unknown"; } export function issue(...args) { const [iss, input, inst] = args; if (typeof iss === "string") { return { message: iss, code: "custom", input, inst, }; } return { ...iss }; } export function cleanEnum(obj) { return Object.entries(obj) .filter(([k, _]) => { // return true if NaN, meaning it's not a number, thus a string key return Number.isNaN(Number.parseInt(k, 10)); }) .map((el) => el[1]); } // instanceof export class Class { constructor(..._args) { } }
Save
cmd:
run