@stryke/zod 0.3.11 → 0.3.12

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/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  # Changelog for Stryke - Zod
4
4
 
5
+ ## [0.3.12](https://github.com/storm-software/stryke/releases/tag/zod%400.3.12) (03/23/2026)
6
+
7
+ ### Updated Dependencies
8
+
9
+ - Updated **type-checks** to **v0.6.0**
10
+ - Updated **json** to **v0.14.11**
11
+
5
12
  ## [0.3.11](https://github.com/storm-software/stryke/releases/tag/zod%400.3.11) (03/16/2026)
6
13
 
7
14
  ### Miscellaneous
package/dist/index.cjs CHANGED
@@ -1,5 +1,5 @@
1
- const require_schema = require('./schema-DYckL2kJ.cjs');
2
- const require_is_zod_type = require('./is-zod-type-RGE-O0aK.cjs');
1
+ const require_schema = require('./schema-DY_GWapj.cjs');
2
+ const require_is_zod_type = require('./is-zod-type-DCTClNUA.cjs');
3
3
  require('./types.cjs');
4
4
 
5
5
  exports.extractJsonSchema = require_schema.extractJsonSchema;
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import { n as isZod4Type, r as isZodType, t as isZod3Type } from "./is-zod-type-B-jL80F-.mjs";
2
- import { n as extractJsonSchema7, t as extractJsonSchema } from "./schema-BscDIlVR.mjs";
1
+ import { n as isZod4Type, r as isZodType, t as isZod3Type } from "./is-zod-type-Bev-cZfm.mjs";
2
+ import { n as extractJsonSchema7, t as extractJsonSchema } from "./schema-Du13eVyW.mjs";
3
3
  import "./types.mjs";
4
4
 
5
5
  export { extractJsonSchema, extractJsonSchema7, isZod3Type, isZod4Type, isZodType };
@@ -34,8 +34,8 @@ const getObjectTag = (value) => {
34
34
  * @param value - The value to check.
35
35
  * @returns Returns `true` if `value` is object-like, else `false`.
36
36
  */
37
- const isObjectLike = (obj) => {
38
- return typeof obj === "object" && obj !== null;
37
+ const isObjectLike = (value) => {
38
+ return typeof value === "object" && value !== null;
39
39
  };
40
40
  /**
41
41
  * Checks if `obj` is a plain object, that is, an object created by the `Object` constructor or one with a `[[Prototype]]` of `null`.
@@ -194,4 +194,4 @@ function isZodType(type) {
194
194
 
195
195
  //#endregion
196
196
  export { isZod4Type as n, isZodType as r, isZod3Type as t };
197
- //# sourceMappingURL=is-zod-type-B-jL80F-.mjs.map
197
+ //# sourceMappingURL=is-zod-type-Bev-cZfm.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is-zod-type-Bev-cZfm.mjs","names":[],"sources":["../../type-checks/src/get-object-tag.ts","../../type-checks/src/is-plain-object.ts","../../type-checks/src/is-object.ts","../../type-checks/src/is-null.ts","../../type-checks/src/is-undefined.ts","../../type-checks/src/is-empty.ts","../../type-checks/src/is-set.ts","../../type-checks/src/is-non-null-object.ts","../../type-checks/src/is-set-object.ts","../src/is-zod-type.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\n/**\n * Gets the `toStringTag` of `obj`.\n *\n * @param value - The obj to query.\n * @returns Returns the `toStringTag`.\n */\nexport const getObjectTag = (value: unknown): string => {\n if (value == null) {\n return value === undefined ? \"[object Undefined]\" : \"[object Null]\";\n }\n return Object.prototype.toString.call(value);\n};\n","/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { PlainObject } from \"@stryke/types/base\";\nimport { getObjectTag } from \"./get-object-tag\";\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @example\n * ```typescript\n * isObjectLike({})\n * // => true\n *\n * isObjectLike([1, 2, 3])\n * // => true\n *\n * isObjectLike(Function)\n * // => false\n *\n * isObjectLike(null)\n * // => false\n * ```\n *\n * @param value - The value to check.\n * @returns Returns `true` if `value` is object-like, else `false`.\n */\nexport const isObjectLike = (value: unknown) => {\n return typeof value === \"object\" && value !== null;\n};\n\n/**\n * Checks if `obj` is a plain object, that is, an object created by the `Object` constructor or one with a `[[Prototype]]` of `null`.\n *\n * @example\n * ```typescript\n * function Foo() {\n * this.a = 1\n * }\n *\n * isPlainObject(new Foo)\n * // => false\n *\n * isPlainObject([1, 2, 3])\n * // => false\n *\n * isPlainObject({ 'x': 0, 'y': 0 })\n * // => true\n *\n * isPlainObject(Object.create(null))\n * // => true\n * ```\n *\n * @param obj - The value to check.\n * @returns Returns `true` if `obj` is a plain object, else `false`.\n */\nexport const isPlainObject = (obj: unknown): obj is PlainObject => {\n if (!isObjectLike(obj) || getObjectTag(obj) !== \"[object Object]\") {\n return false;\n }\n if (Object.getPrototypeOf(obj) === null) {\n return true;\n }\n let proto = obj;\n while (Object.getPrototypeOf(proto) !== null) {\n proto = Object.getPrototypeOf(proto);\n }\n return Object.getPrototypeOf(obj) === proto;\n};\n","/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\n/* eslint-disable ts/no-unsafe-function-type */\n/* eslint-disable ts/no-unsafe-call */\n\nimport type { NativeClass } from \"@stryke/types/base\";\nimport { isPlainObject } from \"./is-plain-object\";\n\n// Prepare\nconst isClassRegex = /^class\\s|^function\\s+[A-Z]/;\nconst isConventionalClassRegex = /^function\\s+[A-Z]/;\nconst isNativeClassRegex = /^class\\s/;\n\n/** Is ES6+ class */\nexport function isNativeClass(value?: any): value is NativeClass {\n // NOTE TO DEVELOPER: If any of this changes, isClass must also be updated\n return (\n typeof value === \"function\" && isNativeClassRegex.test(value.toString())\n );\n}\n\n/**\n * Check if the provided value's type is a conventional class\n *\n * @remarks\n * Is Conventional Class\n * Looks for function with capital first letter MyClass\n * First letter is the 9th character\n * If changed, isClass must also be updated\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is a conventional class\n */\nexport function isConventionalClass(value?: any): value is Function {\n return (\n typeof value === \"function\" &&\n isConventionalClassRegex.test(value.toString())\n );\n}\n\n/**\n * Check if the provided value's type is `Object`\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is of type `Object`\n */\nexport function isClass(value?: any): value is Function | NativeClass; // only guarantee of truth type, not of validity\nexport function isClass(value?: any): boolean {\n return typeof value === \"function\" && isClassRegex.test(value.toString());\n}\n\n/**\n * Check if the provided value's type is `Object`\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is of type `Object`\n */\nexport const isObject = (value: unknown): value is object => {\n try {\n return (\n typeof value === \"object\" ||\n (Boolean(value) && value?.constructor === Object) ||\n isPlainObject(value)\n );\n } catch {\n return false;\n }\n};\n","/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nexport const isNull = (value: unknown): value is null => {\n try {\n return value === null;\n } catch {\n return false;\n }\n};\n","/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nexport const isUndefined = (value: unknown): value is undefined => {\n return value === undefined;\n};\n","/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { isDate } from \"./is-date\";\nimport { isFunction } from \"./is-function\";\nimport { isNull } from \"./is-null\";\nimport { isNumber } from \"./is-number\";\nimport { isSymbol } from \"./is-symbol\";\nimport { isUndefined } from \"./is-undefined\";\n\n/**\n * Check if the provided value's type is `null` or `undefined`\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is of type `null` or `undefined`\n */\nexport const isEmpty = (value: unknown) => {\n try {\n return isUndefined(value) || isNull(value);\n } catch {\n return false;\n }\n};\n\nexport const isEmptyAnything = (value: any) => {\n if (value === true || value === false) return true;\n if (value === null || value === undefined) return true;\n if (isNumber(value)) return value === 0;\n if (isDate(value)) return Number.isNaN(value.getTime());\n if (isFunction(value)) return false;\n if (isSymbol(value)) return false;\n const { length } = value;\n if (isNumber(length)) return length === 0;\n const { size } = value;\n if (isNumber(size)) return size === 0;\n const keys = Object.keys(value).length;\n\n return keys === 0;\n};\n","/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { isEmpty } from \"./is-empty\";\n\n/**\n * The inverse of the `isEmpty` function\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is **NOT** of type `null` or `undefined`\n */\nexport const isSet = (value: unknown): value is NonNullable<unknown> => {\n try {\n return !isEmpty(value);\n } catch {\n return false;\n }\n};\n","/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { isObject } from \"./is-object\";\nimport { isSet } from \"./is-set\";\n\n/**\n * Check if the provided value's type is `Object` and is not `null` or `undefined`\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is of type `Object` and is not `null` or `undefined`\n */\nexport const isNonNullObject = (value: any): value is NonNullable<object> => {\n return isSet(value) && isObject(value);\n};\n","/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { isNonNullObject } from \"./is-non-null-object\";\n\n/**\n * Check if the provided value's type is an object with some fields set\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is an object with some fields se\n */\nexport const isSetObject = (value: unknown): value is NonNullable<object> => {\n try {\n return isNonNullObject(value) && Object.keys(value).length > 0;\n } catch {\n return false;\n }\n};\n","/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type * as z3 from \"zod/v3\";\nimport type * as z4 from \"zod/v4/core\";\n\nimport { isSetObject } from \"@stryke/type-checks/is-set-object\";\nimport type { ZodType } from \"./types\";\n\n/**\n * Type guard to check if a given value is a Zod schema of version 3.\n *\n * @param type - The value to check.\n * @returns True if the value is a Zod schema, false otherwise.\n */\nexport function isZod3Type(type: unknown): type is z3.ZodTypeAny {\n return (\n isSetObject(type) &&\n \"_def\" in type &&\n \"typeName\" in (type as z3.ZodTypeAny)._def\n );\n}\n\n/**\n * Type guard to check if a given value is a Zod schema of version 4.\n *\n * @param type - The value to check.\n * @returns True if the value is a Zod v4 schema, false otherwise.\n */\nexport function isZod4Type(type: unknown): type is z4.$ZodType {\n return (\n isSetObject(type) && \"_zod\" in type && \"def\" in (type as z4.$ZodType)._zod\n );\n}\n\n/**\n * Type guard to check if a given value is a Zod schema of either version 3 or 4.\n *\n * @param type - The value to check.\n * @returns True if the value is a Zod schema, false otherwise.\n */\nexport function isZodType(type: unknown): type is ZodType {\n return isZod3Type(type) || isZod4Type(type);\n}\n"],"mappings":";;;;;;;AAwBA,MAAa,gBAAgB,UAA2B;AACtD,KAAI,SAAS,KACX,QAAO,UAAU,SAAY,uBAAuB;AAEtD,QAAO,OAAO,UAAU,SAAS,KAAK,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;ACe9C,MAAa,gBAAgB,UAAmB;AAC9C,QAAO,OAAO,UAAU,YAAY,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BhD,MAAa,iBAAiB,QAAqC;AACjE,KAAI,CAAC,aAAa,IAAI,IAAI,aAAa,IAAI,KAAK,kBAC9C,QAAO;AAET,KAAI,OAAO,eAAe,IAAI,KAAK,KACjC,QAAO;CAET,IAAI,QAAQ;AACZ,QAAO,OAAO,eAAe,MAAM,KAAK,KACtC,SAAQ,OAAO,eAAe,MAAM;AAEtC,QAAO,OAAO,eAAe,IAAI,KAAK;;;;;;;;;;;ACVxC,MAAa,YAAY,UAAoC;AAC3D,KAAI;AACF,SACE,OAAO,UAAU,YAChB,QAAQ,MAAM,IAAI,OAAO,gBAAgB,UAC1C,cAAc,MAAM;SAEhB;AACN,SAAO;;;;;;AC/DX,MAAa,UAAU,UAAkC;AACvD,KAAI;AACF,SAAO,UAAU;SACX;AACN,SAAO;;;;;;ACJX,MAAa,eAAe,UAAuC;AACjE,QAAO,UAAU;;;;;;;;;;;ACYnB,MAAa,WAAW,UAAmB;AACzC,KAAI;AACF,SAAO,YAAY,MAAM,IAAI,OAAO,MAAM;SACpC;AACN,SAAO;;;;;;;;;;;;ACTX,MAAa,SAAS,UAAkD;AACtE,KAAI;AACF,SAAO,CAAC,QAAQ,MAAM;SAChB;AACN,SAAO;;;;;;;;;;;;ACHX,MAAa,mBAAmB,UAA6C;AAC3E,QAAO,MAAM,MAAM,IAAI,SAAS,MAAM;;;;;;;;;;;ACFxC,MAAa,eAAe,UAAiD;AAC3E,KAAI;AACF,SAAO,gBAAgB,MAAM,IAAI,OAAO,KAAK,MAAM,CAAC,SAAS;SACvD;AACN,SAAO;;;;;;;;;;;;ACAX,SAAgB,WAAW,MAAsC;AAC/D,QACE,YAAY,KAAK,IACjB,UAAU,QACV,cAAe,KAAuB;;;;;;;;AAU1C,SAAgB,WAAW,MAAoC;AAC7D,QACE,YAAY,KAAK,IAAI,UAAU,QAAQ,SAAU,KAAqB;;;;;;;;AAU1E,SAAgB,UAAU,MAAgC;AACxD,QAAO,WAAW,KAAK,IAAI,WAAW,KAAK"}
@@ -35,8 +35,8 @@ const getObjectTag = (value) => {
35
35
  * @param value - The value to check.
36
36
  * @returns Returns `true` if `value` is object-like, else `false`.
37
37
  */
38
- const isObjectLike = (obj) => {
39
- return typeof obj === "object" && obj !== null;
38
+ const isObjectLike = (value) => {
39
+ return typeof value === "object" && value !== null;
40
40
  };
41
41
  /**
42
42
  * Checks if `obj` is a plain object, that is, an object created by the `Object` constructor or one with a `[[Prototype]]` of `null`.
@@ -1,4 +1,4 @@
1
- const require_is_zod_type = require('./is-zod-type-RGE-O0aK.cjs');
1
+ const require_is_zod_type = require('./is-zod-type-DCTClNUA.cjs');
2
2
 
3
3
  exports.isZod3Type = require_is_zod_type.isZod3Type;
4
4
  exports.isZod4Type = require_is_zod_type.isZod4Type;
@@ -1,3 +1,2 @@
1
- import "./types-DWWjtQA0.mjs";
2
1
  import { n as isZod4Type, r as isZodType, t as isZod3Type } from "./is-zod-type-QkJykM8H.mjs";
3
2
  export { isZod3Type, isZod4Type, isZodType };
@@ -1,3 +1,3 @@
1
- import { n as isZod4Type, r as isZodType, t as isZod3Type } from "./is-zod-type-B-jL80F-.mjs";
1
+ import { n as isZod4Type, r as isZodType, t as isZod3Type } from "./is-zod-type-Bev-cZfm.mjs";
2
2
 
3
3
  export { isZod3Type, isZod4Type, isZodType };
@@ -25,7 +25,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
25
25
  }) : target, mod));
26
26
 
27
27
  //#endregion
28
- const require_is_zod_type = require('./is-zod-type-RGE-O0aK.cjs');
28
+ const require_is_zod_type = require('./is-zod-type-DCTClNUA.cjs');
29
29
  let zod_to_json_schema = require("zod-to-json-schema");
30
30
  let zod_v4_core = require("zod/v4/core");
31
31
  zod_v4_core = __toESM(zod_v4_core);
@@ -1,4 +1,4 @@
1
- import { n as isZod4Type, t as isZod3Type } from "./is-zod-type-B-jL80F-.mjs";
1
+ import { n as isZod4Type, t as isZod3Type } from "./is-zod-type-Bev-cZfm.mjs";
2
2
  import { zodToJsonSchema } from "zod-to-json-schema";
3
3
  import * as z4 from "zod/v4/core";
4
4
 
@@ -46,4 +46,4 @@ function extractJsonSchema7(type) {
46
46
 
47
47
  //#endregion
48
48
  export { extractJsonSchema7 as n, extractJsonSchema as t };
49
- //# sourceMappingURL=schema-BscDIlVR.mjs.map
49
+ //# sourceMappingURL=schema-Du13eVyW.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"schema-BscDIlVR.mjs","names":[],"sources":["../src/schema.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { JsonSchema7Type } from \"@stryke/json\";\nimport { zodToJsonSchema } from \"zod-to-json-schema\";\nimport * as z4 from \"zod/v4/core\";\nimport { isZod3Type, isZod4Type } from \"./is-zod-type\";\nimport type { ZodType } from \"./types\";\n\nexport interface ExtractJsonSchemaOptions {\n /**\n * The JSON Schema draft version to target. Defaults to \"draft-07\".\n */\n target?: \"draft-07\" | \"draft-2020-12\";\n\n /**\n * Whether to include the input or output schema for Zod schemas.\n *\n * @remarks\n */\n io?: \"input\" | \"output\";\n}\n\n/**\n * Extracts a JSON Schema from a given Zod schema, supporting both version 3 and version 4 of Zod.\n *\n * @param type - The Zod schema to extract the JSON Schema from. Can be either a Zod v3 or v4 schema.\n * @param options - Options for extracting the JSON Schema, including the target draft version and input/output selection.\n * @returns The extracted JSON Schema.\n */\nexport function extractJsonSchema(\n type: ZodType,\n options: ExtractJsonSchemaOptions = {}\n) {\n const { target = \"draft-07\", io = \"input\" } = options;\n\n if (isZod3Type(type)) {\n const result = zodToJsonSchema(type, {\n $refStrategy: \"root\",\n definitionPath: \"$defs\",\n target: target === \"draft-07\" ? \"jsonSchema7\" : \"jsonSchema2019-09\",\n mapStrategy: \"entries\",\n errorMessages: false,\n markdownDescription: false,\n pipeStrategy: io\n });\n if (!result) {\n throw new Error(\"Failed to extract JSON Schema from Zod v3 schema\");\n }\n\n return result;\n } else if (isZod4Type(type)) {\n return z4.toJSONSchema(type, {\n target: target === \"draft-07\" ? \"draft-07\" : \"draft-2020-12\",\n unrepresentable: \"any\",\n reused: \"ref\"\n });\n } else {\n throw new Error(\"Unsupported Zod schema version\");\n }\n}\n\n/**\n * Extracts a JSON Schema (draft-07) from a given Zod schema, supporting both version 3 and version 4 of Zod.\n *\n * @remarks\n * This function is a convenience wrapper around `extractJsonSchema` that defaults to targeting the JSON Schema draft-07 specification.\n *\n * @param type - The Zod schema to extract the JSON Schema from. Can be either a Zod v3 or v4 schema.\n * @returns The extracted JSON Schema.\n */\nexport function extractJsonSchema7(type: ZodType) {\n return extractJsonSchema(type, { target: \"draft-07\" }) as JsonSchema7Type;\n}\n"],"mappings":";;;;;;;;;;;;AA6CA,SAAgB,kBACd,MACA,UAAoC,EAAE,EACtC;CACA,MAAM,EAAE,SAAS,YAAY,KAAK,YAAY;AAE9C,KAAI,WAAW,KAAK,EAAE;EACpB,MAAM,SAAS,gBAAgB,MAAM;GACnC,cAAc;GACd,gBAAgB;GAChB,QAAQ,WAAW,aAAa,gBAAgB;GAChD,aAAa;GACb,eAAe;GACf,qBAAqB;GACrB,cAAc;GACf,CAAC;AACF,MAAI,CAAC,OACH,OAAM,IAAI,MAAM,mDAAmD;AAGrE,SAAO;YACE,WAAW,KAAK,CACzB,QAAO,GAAG,aAAa,MAAM;EAC3B,QAAQ,WAAW,aAAa,aAAa;EAC7C,iBAAiB;EACjB,QAAQ;EACT,CAAC;KAEF,OAAM,IAAI,MAAM,iCAAiC;;;;;;;;;;;AAarD,SAAgB,mBAAmB,MAAe;AAChD,QAAO,kBAAkB,MAAM,EAAE,QAAQ,YAAY,CAAC"}
1
+ {"version":3,"file":"schema-Du13eVyW.mjs","names":[],"sources":["../src/schema.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { JsonSchema7Type } from \"@stryke/json\";\nimport { zodToJsonSchema } from \"zod-to-json-schema\";\nimport * as z4 from \"zod/v4/core\";\nimport { isZod3Type, isZod4Type } from \"./is-zod-type\";\nimport type { ZodType } from \"./types\";\n\nexport interface ExtractJsonSchemaOptions {\n /**\n * The JSON Schema draft version to target. Defaults to \"draft-07\".\n */\n target?: \"draft-07\" | \"draft-2020-12\";\n\n /**\n * Whether to include the input or output schema for Zod schemas.\n *\n * @remarks\n */\n io?: \"input\" | \"output\";\n}\n\n/**\n * Extracts a JSON Schema from a given Zod schema, supporting both version 3 and version 4 of Zod.\n *\n * @param type - The Zod schema to extract the JSON Schema from. Can be either a Zod v3 or v4 schema.\n * @param options - Options for extracting the JSON Schema, including the target draft version and input/output selection.\n * @returns The extracted JSON Schema.\n */\nexport function extractJsonSchema(\n type: ZodType,\n options: ExtractJsonSchemaOptions = {}\n) {\n const { target = \"draft-07\", io = \"input\" } = options;\n\n if (isZod3Type(type)) {\n const result = zodToJsonSchema(type, {\n $refStrategy: \"root\",\n definitionPath: \"$defs\",\n target: target === \"draft-07\" ? \"jsonSchema7\" : \"jsonSchema2019-09\",\n mapStrategy: \"entries\",\n errorMessages: false,\n markdownDescription: false,\n pipeStrategy: io\n });\n if (!result) {\n throw new Error(\"Failed to extract JSON Schema from Zod v3 schema\");\n }\n\n return result;\n } else if (isZod4Type(type)) {\n return z4.toJSONSchema(type, {\n target: target === \"draft-07\" ? \"draft-07\" : \"draft-2020-12\",\n unrepresentable: \"any\",\n reused: \"ref\"\n });\n } else {\n throw new Error(\"Unsupported Zod schema version\");\n }\n}\n\n/**\n * Extracts a JSON Schema (draft-07) from a given Zod schema, supporting both version 3 and version 4 of Zod.\n *\n * @remarks\n * This function is a convenience wrapper around `extractJsonSchema` that defaults to targeting the JSON Schema draft-07 specification.\n *\n * @param type - The Zod schema to extract the JSON Schema from. Can be either a Zod v3 or v4 schema.\n * @returns The extracted JSON Schema.\n */\nexport function extractJsonSchema7(type: ZodType) {\n return extractJsonSchema(type, { target: \"draft-07\" }) as JsonSchema7Type;\n}\n"],"mappings":";;;;;;;;;;;;AA6CA,SAAgB,kBACd,MACA,UAAoC,EAAE,EACtC;CACA,MAAM,EAAE,SAAS,YAAY,KAAK,YAAY;AAE9C,KAAI,WAAW,KAAK,EAAE;EACpB,MAAM,SAAS,gBAAgB,MAAM;GACnC,cAAc;GACd,gBAAgB;GAChB,QAAQ,WAAW,aAAa,gBAAgB;GAChD,aAAa;GACb,eAAe;GACf,qBAAqB;GACrB,cAAc;GACf,CAAC;AACF,MAAI,CAAC,OACH,OAAM,IAAI,MAAM,mDAAmD;AAGrE,SAAO;YACE,WAAW,KAAK,CACzB,QAAO,GAAG,aAAa,MAAM;EAC3B,QAAQ,WAAW,aAAa,aAAa;EAC7C,iBAAiB;EACjB,QAAQ;EACT,CAAC;KAEF,OAAM,IAAI,MAAM,iCAAiC;;;;;;;;;;;AAarD,SAAgB,mBAAmB,MAAe;AAChD,QAAO,kBAAkB,MAAM,EAAE,QAAQ,YAAY,CAAC"}
package/dist/schema.cjs CHANGED
@@ -1,4 +1,4 @@
1
- const require_schema = require('./schema-DYckL2kJ.cjs');
1
+ const require_schema = require('./schema-DY_GWapj.cjs');
2
2
 
3
3
  exports.extractJsonSchema = require_schema.extractJsonSchema;
4
4
  exports.extractJsonSchema7 = require_schema.extractJsonSchema7;
package/dist/schema.d.mts CHANGED
@@ -1,3 +1,2 @@
1
- import "./types-DWWjtQA0.mjs";
2
1
  import { n as extractJsonSchema, r as extractJsonSchema7, t as ExtractJsonSchemaOptions } from "./schema-CM-MXRuJ.mjs";
3
2
  export { ExtractJsonSchemaOptions, extractJsonSchema, extractJsonSchema7 };
package/dist/schema.mjs CHANGED
@@ -1,3 +1,3 @@
1
- import { n as extractJsonSchema7, t as extractJsonSchema } from "./schema-BscDIlVR.mjs";
1
+ import { n as extractJsonSchema7, t as extractJsonSchema } from "./schema-Du13eVyW.mjs";
2
2
 
3
3
  export { extractJsonSchema, extractJsonSchema7 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stryke/zod",
3
- "version": "0.3.11",
3
+ "version": "0.3.12",
4
4
  "private": false,
5
5
  "description": "A package containing helper utilities for working with zod schemas.",
6
6
  "repository": {
@@ -68,16 +68,16 @@
68
68
  "module": "./dist/index.mjs",
69
69
  "types": "./dist/index.d.cts",
70
70
  "dependencies": {
71
- "@stryke/type-checks": "^0.5.41",
71
+ "@stryke/type-checks": "^0.6.0",
72
72
  "zod-to-json-schema": "^3.25.1"
73
73
  },
74
74
  "devDependencies": {
75
- "@stryke/json": "^0.14.10",
75
+ "@stryke/json": "^0.14.11",
76
76
  "tsdown": "^0.17.2",
77
77
  "zod": "^4.3.6"
78
78
  },
79
79
  "peerDependencies": { "zod": "^3.25.0 || ^4.0.0" },
80
80
  "peerDependenciesMeta": { "zod": { "optional": true } },
81
81
  "publishConfig": { "access": "public" },
82
- "gitHead": "cbabce3e772514cdc47c10a3b8bae3cc0ad16191"
82
+ "gitHead": "ad0acb8f9d34c16300a0901dd4db448756480415"
83
83
  }
@@ -1 +0,0 @@
1
- {"version":3,"file":"is-zod-type-B-jL80F-.mjs","names":[],"sources":["../../type-checks/src/get-object-tag.ts","../../type-checks/src/is-plain-object.ts","../../type-checks/src/is-object.ts","../../type-checks/src/is-null.ts","../../type-checks/src/is-undefined.ts","../../type-checks/src/is-empty.ts","../../type-checks/src/is-set.ts","../../type-checks/src/is-non-null-object.ts","../../type-checks/src/is-set-object.ts","../src/is-zod-type.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\n/**\n * Gets the `toStringTag` of `obj`.\n *\n * @param value - The obj to query.\n * @returns Returns the `toStringTag`.\n */\nexport const getObjectTag = (value: unknown): string => {\n if (value == null) {\n return value === undefined ? \"[object Undefined]\" : \"[object Null]\";\n }\n return Object.prototype.toString.call(value);\n};\n","/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { PlainObject } from \"@stryke/types/base\";\nimport { getObjectTag } from \"./get-object-tag\";\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @example\n * ```typescript\n * isObjectLike({})\n * // => true\n *\n * isObjectLike([1, 2, 3])\n * // => true\n *\n * isObjectLike(Function)\n * // => false\n *\n * isObjectLike(null)\n * // => false\n * ```\n *\n * @param value - The value to check.\n * @returns Returns `true` if `value` is object-like, else `false`.\n */\nexport const isObjectLike = (obj: unknown) => {\n return typeof obj === \"object\" && obj !== null;\n};\n\n/**\n * Checks if `obj` is a plain object, that is, an object created by the `Object` constructor or one with a `[[Prototype]]` of `null`.\n *\n * @example\n * ```typescript\n * function Foo() {\n * this.a = 1\n * }\n *\n * isPlainObject(new Foo)\n * // => false\n *\n * isPlainObject([1, 2, 3])\n * // => false\n *\n * isPlainObject({ 'x': 0, 'y': 0 })\n * // => true\n *\n * isPlainObject(Object.create(null))\n * // => true\n * ```\n *\n * @param obj - The value to check.\n * @returns Returns `true` if `obj` is a plain object, else `false`.\n */\nexport const isPlainObject = (obj: unknown): obj is PlainObject => {\n if (!isObjectLike(obj) || getObjectTag(obj) !== \"[object Object]\") {\n return false;\n }\n if (Object.getPrototypeOf(obj) === null) {\n return true;\n }\n let proto = obj;\n while (Object.getPrototypeOf(proto) !== null) {\n proto = Object.getPrototypeOf(proto);\n }\n return Object.getPrototypeOf(obj) === proto;\n};\n","/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\n/* eslint-disable ts/no-unsafe-function-type */\n/* eslint-disable ts/no-unsafe-call */\n\nimport type { NativeClass } from \"@stryke/types/base\";\nimport { isPlainObject } from \"./is-plain-object\";\n\n// Prepare\nconst isClassRegex = /^class\\s|^function\\s+[A-Z]/;\nconst isConventionalClassRegex = /^function\\s+[A-Z]/;\nconst isNativeClassRegex = /^class\\s/;\n\n/** Is ES6+ class */\nexport function isNativeClass(value?: any): value is NativeClass {\n // NOTE TO DEVELOPER: If any of this changes, isClass must also be updated\n return (\n typeof value === \"function\" && isNativeClassRegex.test(value.toString())\n );\n}\n\n/**\n * Check if the provided value's type is a conventional class\n *\n * @remarks\n * Is Conventional Class\n * Looks for function with capital first letter MyClass\n * First letter is the 9th character\n * If changed, isClass must also be updated\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is a conventional class\n */\nexport function isConventionalClass(value?: any): value is Function {\n return (\n typeof value === \"function\" &&\n isConventionalClassRegex.test(value.toString())\n );\n}\n\n/**\n * Check if the provided value's type is `Object`\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is of type `Object`\n */\nexport function isClass(value?: any): value is Function | NativeClass; // only guarantee of truth type, not of validity\nexport function isClass(value?: any): boolean {\n return typeof value === \"function\" && isClassRegex.test(value.toString());\n}\n\n/**\n * Check if the provided value's type is `Object`\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is of type `Object`\n */\nexport const isObject = (value: unknown): value is object => {\n try {\n return (\n typeof value === \"object\" ||\n (Boolean(value) && value?.constructor === Object) ||\n isPlainObject(value)\n );\n } catch {\n return false;\n }\n};\n","/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nexport const isNull = (value: unknown): value is null => {\n try {\n return value === null;\n } catch {\n return false;\n }\n};\n","/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nexport const isUndefined = (value: unknown): value is undefined => {\n return value === undefined;\n};\n","/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { isDate } from \"./is-date\";\nimport { isFunction } from \"./is-function\";\nimport { isNull } from \"./is-null\";\nimport { isNumber } from \"./is-number\";\nimport { isSymbol } from \"./is-symbol\";\nimport { isUndefined } from \"./is-undefined\";\n\n/**\n * Check if the provided value's type is `null` or `undefined`\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is of type `null` or `undefined`\n */\nexport const isEmpty = (value: unknown) => {\n try {\n return isUndefined(value) || isNull(value);\n } catch {\n return false;\n }\n};\n\nexport const isEmptyAnything = (value: any) => {\n if (value === true || value === false) return true;\n if (value === null || value === undefined) return true;\n if (isNumber(value)) return value === 0;\n if (isDate(value)) return Number.isNaN(value.getTime());\n if (isFunction(value)) return false;\n if (isSymbol(value)) return false;\n const { length } = value;\n if (isNumber(length)) return length === 0;\n const { size } = value;\n if (isNumber(size)) return size === 0;\n const keys = Object.keys(value).length;\n\n return keys === 0;\n};\n","/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { isEmpty } from \"./is-empty\";\n\n/**\n * The inverse of the `isEmpty` function\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is **NOT** of type `null` or `undefined`\n */\nexport const isSet = (value: unknown): value is NonNullable<unknown> => {\n try {\n return !isEmpty(value);\n } catch {\n return false;\n }\n};\n","/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { isObject } from \"./is-object\";\nimport { isSet } from \"./is-set\";\n\n/**\n * Check if the provided value's type is `Object` and is not `null` or `undefined`\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is of type `Object` and is not `null` or `undefined`\n */\nexport const isNonNullObject = (value: any): value is NonNullable<object> => {\n return isSet(value) && isObject(value);\n};\n","/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { isNonNullObject } from \"./is-non-null-object\";\n\n/**\n * Check if the provided value's type is an object with some fields set\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is an object with some fields se\n */\nexport const isSetObject = (value: unknown): value is NonNullable<object> => {\n try {\n return isNonNullObject(value) && Object.keys(value).length > 0;\n } catch {\n return false;\n }\n};\n","/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type * as z3 from \"zod/v3\";\nimport type * as z4 from \"zod/v4/core\";\n\nimport { isSetObject } from \"@stryke/type-checks/is-set-object\";\nimport type { ZodType } from \"./types\";\n\n/**\n * Type guard to check if a given value is a Zod schema of version 3.\n *\n * @param type - The value to check.\n * @returns True if the value is a Zod schema, false otherwise.\n */\nexport function isZod3Type(type: unknown): type is z3.ZodTypeAny {\n return (\n isSetObject(type) &&\n \"_def\" in type &&\n \"typeName\" in (type as z3.ZodTypeAny)._def\n );\n}\n\n/**\n * Type guard to check if a given value is a Zod schema of version 4.\n *\n * @param type - The value to check.\n * @returns True if the value is a Zod v4 schema, false otherwise.\n */\nexport function isZod4Type(type: unknown): type is z4.$ZodType {\n return (\n isSetObject(type) && \"_zod\" in type && \"def\" in (type as z4.$ZodType)._zod\n );\n}\n\n/**\n * Type guard to check if a given value is a Zod schema of either version 3 or 4.\n *\n * @param type - The value to check.\n * @returns True if the value is a Zod schema, false otherwise.\n */\nexport function isZodType(type: unknown): type is ZodType {\n return isZod3Type(type) || isZod4Type(type);\n}\n"],"mappings":";;;;;;;AAwBA,MAAa,gBAAgB,UAA2B;AACtD,KAAI,SAAS,KACX,QAAO,UAAU,SAAY,uBAAuB;AAEtD,QAAO,OAAO,UAAU,SAAS,KAAK,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;ACe9C,MAAa,gBAAgB,QAAiB;AAC5C,QAAO,OAAO,QAAQ,YAAY,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4B5C,MAAa,iBAAiB,QAAqC;AACjE,KAAI,CAAC,aAAa,IAAI,IAAI,aAAa,IAAI,KAAK,kBAC9C,QAAO;AAET,KAAI,OAAO,eAAe,IAAI,KAAK,KACjC,QAAO;CAET,IAAI,QAAQ;AACZ,QAAO,OAAO,eAAe,MAAM,KAAK,KACtC,SAAQ,OAAO,eAAe,MAAM;AAEtC,QAAO,OAAO,eAAe,IAAI,KAAK;;;;;;;;;;;ACVxC,MAAa,YAAY,UAAoC;AAC3D,KAAI;AACF,SACE,OAAO,UAAU,YAChB,QAAQ,MAAM,IAAI,OAAO,gBAAgB,UAC1C,cAAc,MAAM;SAEhB;AACN,SAAO;;;;;;AC/DX,MAAa,UAAU,UAAkC;AACvD,KAAI;AACF,SAAO,UAAU;SACX;AACN,SAAO;;;;;;ACJX,MAAa,eAAe,UAAuC;AACjE,QAAO,UAAU;;;;;;;;;;;ACYnB,MAAa,WAAW,UAAmB;AACzC,KAAI;AACF,SAAO,YAAY,MAAM,IAAI,OAAO,MAAM;SACpC;AACN,SAAO;;;;;;;;;;;;ACTX,MAAa,SAAS,UAAkD;AACtE,KAAI;AACF,SAAO,CAAC,QAAQ,MAAM;SAChB;AACN,SAAO;;;;;;;;;;;;ACHX,MAAa,mBAAmB,UAA6C;AAC3E,QAAO,MAAM,MAAM,IAAI,SAAS,MAAM;;;;;;;;;;;ACFxC,MAAa,eAAe,UAAiD;AAC3E,KAAI;AACF,SAAO,gBAAgB,MAAM,IAAI,OAAO,KAAK,MAAM,CAAC,SAAS;SACvD;AACN,SAAO;;;;;;;;;;;;ACAX,SAAgB,WAAW,MAAsC;AAC/D,QACE,YAAY,KAAK,IACjB,UAAU,QACV,cAAe,KAAuB;;;;;;;;AAU1C,SAAgB,WAAW,MAAoC;AAC7D,QACE,YAAY,KAAK,IAAI,UAAU,QAAQ,SAAU,KAAqB;;;;;;;;AAU1E,SAAgB,UAAU,MAAgC;AACxD,QAAO,WAAW,KAAK,IAAI,WAAW,KAAK"}