@stryke/json 0.13.0 → 0.13.1
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 +11 -0
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/schema-CuBX00tF.d.cts.map +1 -1
- package/dist/{schema-CwyRhvHe.cjs → schema-CuRmnpck.cjs} +1 -2
- package/dist/schema-D5wPTiM4.d.mts.map +1 -1
- package/dist/{schema-CMt54x11.mjs → schema-DpcwD3dE.mjs} +2 -3
- package/dist/schema-DpcwD3dE.mjs.map +1 -0
- package/dist/schema.cjs +1 -1
- package/dist/schema.mjs +1 -1
- package/package.json +2 -2
- package/dist/schema-CMt54x11.mjs.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
# Changelog for Stryke - JSON
|
|
4
4
|
|
|
5
|
+
## [0.13.0](https://github.com/storm-software/stryke/releases/tag/json%400.13.0) (03/03/2026)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
- **json:** Added `isJsonSchema7TupleType` type-check helper function ([85270ac5](https://github.com/storm-software/stryke/commit/85270ac5))
|
|
10
|
+
|
|
11
|
+
### Updated Dependencies
|
|
12
|
+
|
|
13
|
+
- Updated **type-checks** to **v0.5.30**
|
|
14
|
+
- Updated **types** to **v0.10.44**
|
|
15
|
+
|
|
5
16
|
## [0.12.0](https://github.com/storm-software/stryke/releases/tag/json%400.12.0) (03/03/2026)
|
|
6
17
|
|
|
7
18
|
### Features
|
package/dist/index.cjs
CHANGED
|
@@ -3,7 +3,7 @@ const require_canonical = require('./canonical-hMXtzPIV.cjs');
|
|
|
3
3
|
const require_find_reference = require('./find-reference-Ct8UDBo2.cjs');
|
|
4
4
|
const require_parse = require('./parse-BSmqrTy_.cjs');
|
|
5
5
|
require('./pointer-Cvmor4sN.cjs');
|
|
6
|
-
const require_schema = require('./schema-
|
|
6
|
+
const require_schema = require('./schema-CuRmnpck.cjs');
|
|
7
7
|
const require_strip_comments = require('./strip-comments-CPoO4Wj2.cjs');
|
|
8
8
|
const require_parse$1 = require('./parse-CX9jPskm.cjs');
|
|
9
9
|
const require_code_frames = require('./code-frames-ChE4PPdh.cjs');
|
package/dist/index.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import { t as canonicalJson } from "./canonical-CVbmCnGM.mjs";
|
|
|
2
2
|
import { i as isObjectReference, n as isArrayEnd, r as isArrayReference, t as find } from "./find-reference-kPgdulJ1.mjs";
|
|
3
3
|
import { a as isValidIndex, c as unescapePointerSegment, i as isRoot, n as formatJsonPointer, o as parent, r as isInteger, s as parseJsonPointer, t as escapePointerSegment } from "./parse-B3NfTO06.mjs";
|
|
4
4
|
import "./pointer-DScQSL_a.mjs";
|
|
5
|
-
import { a as isJsonSchema7NumberType, c as isJsonSchema7StringType, i as isJsonSchema7LiteralType, l as isJsonSchema7TupleType, n as isJsonSchema7ArrayType, o as isJsonSchema7ObjectType, r as isJsonSchema7BooleanType, s as isJsonSchema7PrimitiveLiteralType, t as isJsonSchema7AllOfType, u as isStandardJsonSchema } from "./schema-
|
|
5
|
+
import { a as isJsonSchema7NumberType, c as isJsonSchema7StringType, i as isJsonSchema7LiteralType, l as isJsonSchema7TupleType, n as isJsonSchema7ArrayType, o as isJsonSchema7ObjectType, r as isJsonSchema7BooleanType, s as isJsonSchema7PrimitiveLiteralType, t as isJsonSchema7AllOfType, u as isStandardJsonSchema } from "./schema-DpcwD3dE.mjs";
|
|
6
6
|
import { t as stripComments } from "./strip-comments-DNTu6CWM.mjs";
|
|
7
7
|
import { n as safeParse, t as parse } from "./parse-BrChHTWb.mjs";
|
|
8
8
|
import { t as codeFrameColumns } from "./code-frames-C8DEdLmV.mjs";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-CuBX00tF.d.cts","names":[],"sources":["../src/schema.ts"],"sourcesContent":[],"mappings":";;;;;;;AAwCA;AAgBA;
|
|
1
|
+
{"version":3,"file":"schema-CuBX00tF.d.cts","names":[],"sources":["../src/schema.ts"],"sourcesContent":[],"mappings":";;;;;;;AAwCA;AAgBA;AAYA;AAYA;AAcgB,iBAtDA,sBAAA,CAuDN,MAAA,EAtDA,eAuDG,CAAA,EAAA,MAAA,IAtDA,oBAsDsB;AAUnC;AAYA;AAiBA;AAwBA;AAyBA;;AAEiC,iBAlIjB,uBAAA,CAkIiB,MAAA,EAjIvB,eAiIuB,CAAA,EAAA,MAAA,IAhIpB,qBAgIoB;;;;;;;iBAtHjB,uBAAA,SACN,4BACG;;;;;;;iBAUG,uBAAA,SACN,4BACG;;;;;;;iBAYG,wBAAA,SACN,4BACG;;;;;;;iBAUG,sBAAA,SACN,4BACG;;;;;;;iBAUG,sBAAA,SACN,4BACG;;;;;;;iBAeG,iCAAA,SACN,4BACG;;;;;;;iBAsBG,wBAAA,SACN,4BACG;;;;;;;;;;;;iBAuBG,+CAA+C,6BAEnD,qBAAqB,OAAO"}
|
|
@@ -18,8 +18,7 @@ function isJsonSchema7AllOfType(schema) {
|
|
|
18
18
|
* @returns True if the schema is a {@link JsonSchema7ObjectType}, false otherwise
|
|
19
19
|
*/
|
|
20
20
|
function isJsonSchema7ObjectType(schema) {
|
|
21
|
-
|
|
22
|
-
return "properties" in schema;
|
|
21
|
+
return "type" in schema && schema.type === "object";
|
|
23
22
|
}
|
|
24
23
|
/**
|
|
25
24
|
* Type guard for {@link JsonSchema7StringType}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-D5wPTiM4.d.mts","names":[],"sources":["../src/schema.ts"],"sourcesContent":[],"mappings":";;;;;;;AAwCA;AAgBA;
|
|
1
|
+
{"version":3,"file":"schema-D5wPTiM4.d.mts","names":[],"sources":["../src/schema.ts"],"sourcesContent":[],"mappings":";;;;;;;AAwCA;AAgBA;AAYA;AAYA;AAcgB,iBAtDA,sBAAA,CAuDN,MAAA,EAtDA,eAuDG,CAAA,EAAA,MAAA,IAtDA,oBAsDsB;AAUnC;AAYA;AAiBA;AAwBA;AAyBA;;AAEiC,iBAlIjB,uBAAA,CAkIiB,MAAA,EAjIvB,eAiIuB,CAAA,EAAA,MAAA,IAhIpB,qBAgIoB;;;;;;;iBAtHjB,uBAAA,SACN,4BACG;;;;;;;iBAUG,uBAAA,SACN,4BACG;;;;;;;iBAYG,wBAAA,SACN,4BACG;;;;;;;iBAUG,sBAAA,SACN,4BACG;;;;;;;iBAUG,sBAAA,SACN,4BACG;;;;;;;iBAeG,iCAAA,SACN,4BACG;;;;;;;iBAsBG,wBAAA,SACN,4BACG;;;;;;;;;;;;iBAuBG,+CAA+C,6BAEnD,qBAAqB,OAAO"}
|
|
@@ -18,8 +18,7 @@ function isJsonSchema7AllOfType(schema) {
|
|
|
18
18
|
* @returns True if the schema is a {@link JsonSchema7ObjectType}, false otherwise
|
|
19
19
|
*/
|
|
20
20
|
function isJsonSchema7ObjectType(schema) {
|
|
21
|
-
|
|
22
|
-
return "properties" in schema;
|
|
21
|
+
return "type" in schema && schema.type === "object";
|
|
23
22
|
}
|
|
24
23
|
/**
|
|
25
24
|
* Type guard for {@link JsonSchema7StringType}
|
|
@@ -105,4 +104,4 @@ function isStandardJsonSchema(value) {
|
|
|
105
104
|
|
|
106
105
|
//#endregion
|
|
107
106
|
export { isJsonSchema7NumberType as a, isJsonSchema7StringType as c, isJsonSchema7LiteralType as i, isJsonSchema7TupleType as l, isJsonSchema7ArrayType as n, isJsonSchema7ObjectType as o, isJsonSchema7BooleanType as r, isJsonSchema7PrimitiveLiteralType as s, isJsonSchema7AllOfType as t, isStandardJsonSchema as u };
|
|
108
|
-
//# sourceMappingURL=schema-
|
|
107
|
+
//# sourceMappingURL=schema-DpcwD3dE.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-DpcwD3dE.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 { StandardJSONSchemaV1 } from \"@standard-schema/spec\";\nimport { isFunction } from \"@stryke/type-checks/is-function\";\nimport { isSetObject } from \"@stryke/type-checks/is-set-object\";\nimport type {\n JsonSchema7AllOfType,\n JsonSchema7ArrayType,\n JsonSchema7BooleanType,\n JsonSchema7LiteralType,\n JsonSchema7NumberType,\n JsonSchema7ObjectType,\n JsonSchema7PrimitiveLiteralType,\n JsonSchema7StringType,\n JsonSchema7TupleType,\n JsonSchema7Type\n} from \"./types\";\n\n/**\n * Type guard for {@link JsonSchema7AllOfType}\n *\n * @param schema - The schema to check\n * @returns True if the schema is a {@link JsonSchema7AllOfType}, false otherwise\n */\nexport function isJsonSchema7AllOfType(\n schema: JsonSchema7Type\n): schema is JsonSchema7AllOfType {\n if (\"type\" in schema && schema.type === \"string\") {\n return false;\n }\n\n return \"allOf\" in schema;\n}\n\n/**\n * Type guard for {@link JsonSchema7ObjectType}\n *\n * @param schema - The schema to check\n * @returns True if the schema is a {@link JsonSchema7ObjectType}, false otherwise\n */\nexport function isJsonSchema7ObjectType(\n schema: JsonSchema7Type\n): schema is JsonSchema7ObjectType {\n return \"type\" in schema && schema.type === \"object\";\n}\n\n/**\n * Type guard for {@link JsonSchema7StringType}\n *\n * @param schema - The schema to check\n * @returns True if the schema is a {@link JsonSchema7StringType}, false otherwise\n */\nexport function isJsonSchema7StringType(\n schema: JsonSchema7Type\n): schema is JsonSchema7StringType {\n return \"type\" in schema && schema.type === \"string\";\n}\n\n/**\n * Type guard for {@link JsonSchema7NumberType}\n *\n * @param schema - The schema to check\n * @returns True if the schema is a {@link JsonSchema7NumberType}, false otherwise\n */\nexport function isJsonSchema7NumberType(\n schema: JsonSchema7Type\n): schema is JsonSchema7NumberType {\n return (\n \"type\" in schema && (schema.type === \"number\" || schema.type === \"integer\")\n );\n}\n\n/**\n * Type guard for {@link JsonSchema7BooleanType}\n *\n * @param schema - The schema to check\n * @returns True if the schema is a {@link JsonSchema7BooleanType}, false otherwise\n */\nexport function isJsonSchema7BooleanType(\n schema: JsonSchema7Type\n): schema is JsonSchema7BooleanType {\n return \"type\" in schema && schema.type === \"boolean\";\n}\n\n/**\n * Type guard for {@link JsonSchema7ArrayType}\n *\n * @param schema - The schema to check\n * @returns True if the schema is a {@link JsonSchema7ArrayType}, false otherwise\n */\nexport function isJsonSchema7ArrayType(\n schema: JsonSchema7Type\n): schema is JsonSchema7ArrayType {\n return \"type\" in schema && schema.type === \"array\" && \"items\" in schema;\n}\n\n/**\n * Type guard for {@link JsonSchema7TupleType}\n *\n * @param schema - The schema to check\n * @returns True if the schema is a {@link JsonSchema7TupleType}, false otherwise\n */\nexport function isJsonSchema7TupleType(\n schema: JsonSchema7Type\n): schema is JsonSchema7TupleType {\n return (\n \"type\" in schema &&\n schema.type === \"array\" &&\n \"items\" in schema &&\n Array.isArray(schema.items)\n );\n}\n\n/**\n * Type guard for {@link JsonSchema7PrimitiveLiteralType}\n *\n * @param schema - The schema to check\n * @returns True if the schema is a {@link JsonSchema7PrimitiveLiteralType}, false otherwise\n */\nexport function isJsonSchema7PrimitiveLiteralType(\n schema: JsonSchema7Type\n): schema is JsonSchema7PrimitiveLiteralType {\n if (!(\"type\" in schema)) {\n return false;\n }\n\n const { type } = schema;\n\n return (\n (type === \"string\" ||\n type === \"number\" ||\n type === \"integer\" ||\n type === \"boolean\") &&\n \"const\" in schema\n );\n}\n\n/**\n * Type guard for {@link JsonSchema7LiteralType}\n *\n * @param schema - The schema to check\n * @returns True if the schema is a {@link JsonSchema7LiteralType}, false otherwise\n */\nexport function isJsonSchema7LiteralType(\n schema: JsonSchema7Type\n): schema is JsonSchema7LiteralType {\n if (isJsonSchema7PrimitiveLiteralType(schema)) {\n return true;\n }\n\n if (!(\"type\" in schema)) {\n return false;\n }\n\n return schema.type === \"object\" || schema.type === \"array\";\n}\n\n/**\n * Type guard to check if a value is a {@link StandardJSONSchemaV1 | Standard JSON Schema}.\n *\n * @remarks\n * This function checks if the value has the structure of a Standard JSON Schema, which includes a `~standard` property with a `jsonSchema` object that has `input` and `output` functions.\n *\n * @see https://standardschema.dev/json-schema\n *\n * @param value - The value to check.\n * @returns True if the value is a {@link StandardJSONSchemaV1 | Standard JSON Schema}, false otherwise.\n */\nexport function isStandardJsonSchema<Input = unknown, Output = Input>(\n value: any\n): value is StandardJSONSchemaV1<Input, Output> {\n return (\n isSetObject(value) &&\n \"~standard\" in value &&\n isSetObject(value[\"~standard\"]) &&\n \"jsonSchema\" in value[\"~standard\"] &&\n isSetObject(value[\"~standard\"].jsonSchema) &&\n \"input\" in value[\"~standard\"].jsonSchema &&\n isFunction(value[\"~standard\"].jsonSchema.input) &&\n \"output\" in value[\"~standard\"].jsonSchema &&\n isFunction(value[\"~standard\"].jsonSchema.output)\n );\n}\n"],"mappings":";;;;;;;;;AAwCA,SAAgB,uBACd,QACgC;AAChC,KAAI,UAAU,UAAU,OAAO,SAAS,SACtC,QAAO;AAGT,QAAO,WAAW;;;;;;;;AASpB,SAAgB,wBACd,QACiC;AACjC,QAAO,UAAU,UAAU,OAAO,SAAS;;;;;;;;AAS7C,SAAgB,wBACd,QACiC;AACjC,QAAO,UAAU,UAAU,OAAO,SAAS;;;;;;;;AAS7C,SAAgB,wBACd,QACiC;AACjC,QACE,UAAU,WAAW,OAAO,SAAS,YAAY,OAAO,SAAS;;;;;;;;AAUrE,SAAgB,yBACd,QACkC;AAClC,QAAO,UAAU,UAAU,OAAO,SAAS;;;;;;;;AAS7C,SAAgB,uBACd,QACgC;AAChC,QAAO,UAAU,UAAU,OAAO,SAAS,WAAW,WAAW;;;;;;;;AASnE,SAAgB,uBACd,QACgC;AAChC,QACE,UAAU,UACV,OAAO,SAAS,WAChB,WAAW,UACX,MAAM,QAAQ,OAAO,MAAM;;;;;;;;AAU/B,SAAgB,kCACd,QAC2C;AAC3C,KAAI,EAAE,UAAU,QACd,QAAO;CAGT,MAAM,EAAE,SAAS;AAEjB,SACG,SAAS,YACR,SAAS,YACT,SAAS,aACT,SAAS,cACX,WAAW;;;;;;;;AAUf,SAAgB,yBACd,QACkC;AAClC,KAAI,kCAAkC,OAAO,CAC3C,QAAO;AAGT,KAAI,EAAE,UAAU,QACd,QAAO;AAGT,QAAO,OAAO,SAAS,YAAY,OAAO,SAAS;;;;;;;;;;;;;AAcrD,SAAgB,qBACd,OAC8C;AAC9C,QACE,YAAY,MAAM,IAClB,eAAe,SACf,YAAY,MAAM,aAAa,IAC/B,gBAAgB,MAAM,gBACtB,YAAY,MAAM,aAAa,WAAW,IAC1C,WAAW,MAAM,aAAa,cAC9B,WAAW,MAAM,aAAa,WAAW,MAAM,IAC/C,YAAY,MAAM,aAAa,cAC/B,WAAW,MAAM,aAAa,WAAW,OAAO"}
|
package/dist/schema.cjs
CHANGED
package/dist/schema.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as isJsonSchema7NumberType, c as isJsonSchema7StringType, i as isJsonSchema7LiteralType, l as isJsonSchema7TupleType, n as isJsonSchema7ArrayType, o as isJsonSchema7ObjectType, r as isJsonSchema7BooleanType, s as isJsonSchema7PrimitiveLiteralType, t as isJsonSchema7AllOfType, u as isStandardJsonSchema } from "./schema-
|
|
1
|
+
import { a as isJsonSchema7NumberType, c as isJsonSchema7StringType, i as isJsonSchema7LiteralType, l as isJsonSchema7TupleType, n as isJsonSchema7ArrayType, o as isJsonSchema7ObjectType, r as isJsonSchema7BooleanType, s as isJsonSchema7PrimitiveLiteralType, t as isJsonSchema7AllOfType, u as isStandardJsonSchema } from "./schema-DpcwD3dE.mjs";
|
|
2
2
|
|
|
3
3
|
export { isJsonSchema7AllOfType, isJsonSchema7ArrayType, isJsonSchema7BooleanType, isJsonSchema7LiteralType, isJsonSchema7NumberType, isJsonSchema7ObjectType, isJsonSchema7PrimitiveLiteralType, isJsonSchema7StringType, isJsonSchema7TupleType, isStandardJsonSchema };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stryke/json",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A package containing JSON parsing/stringify utilities used by Storm Software.",
|
|
6
6
|
"repository": {
|
|
@@ -77,5 +77,5 @@
|
|
|
77
77
|
"tsdown": "^0.17.2"
|
|
78
78
|
},
|
|
79
79
|
"publishConfig": { "access": "public" },
|
|
80
|
-
"gitHead": "
|
|
80
|
+
"gitHead": "7d12d78184a0812114d762186fe34f82d9e9083d"
|
|
81
81
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"schema-CMt54x11.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 { StandardJSONSchemaV1 } from \"@standard-schema/spec\";\nimport { isFunction } from \"@stryke/type-checks/is-function\";\nimport { isSetObject } from \"@stryke/type-checks/is-set-object\";\nimport type {\n JsonSchema7AllOfType,\n JsonSchema7ArrayType,\n JsonSchema7BooleanType,\n JsonSchema7LiteralType,\n JsonSchema7NumberType,\n JsonSchema7ObjectType,\n JsonSchema7PrimitiveLiteralType,\n JsonSchema7StringType,\n JsonSchema7TupleType,\n JsonSchema7Type\n} from \"./types\";\n\n/**\n * Type guard for {@link JsonSchema7AllOfType}\n *\n * @param schema - The schema to check\n * @returns True if the schema is a {@link JsonSchema7AllOfType}, false otherwise\n */\nexport function isJsonSchema7AllOfType(\n schema: JsonSchema7Type\n): schema is JsonSchema7AllOfType {\n if (\"type\" in schema && schema.type === \"string\") {\n return false;\n }\n\n return \"allOf\" in schema;\n}\n\n/**\n * Type guard for {@link JsonSchema7ObjectType}\n *\n * @param schema - The schema to check\n * @returns True if the schema is a {@link JsonSchema7ObjectType}, false otherwise\n */\nexport function isJsonSchema7ObjectType(\n schema: JsonSchema7Type\n): schema is JsonSchema7ObjectType {\n if (\"type\" in schema && schema.type === \"object\") {\n return false;\n }\n\n return \"properties\" in schema;\n}\n\n/**\n * Type guard for {@link JsonSchema7StringType}\n *\n * @param schema - The schema to check\n * @returns True if the schema is a {@link JsonSchema7StringType}, false otherwise\n */\nexport function isJsonSchema7StringType(\n schema: JsonSchema7Type\n): schema is JsonSchema7StringType {\n return \"type\" in schema && schema.type === \"string\";\n}\n\n/**\n * Type guard for {@link JsonSchema7NumberType}\n *\n * @param schema - The schema to check\n * @returns True if the schema is a {@link JsonSchema7NumberType}, false otherwise\n */\nexport function isJsonSchema7NumberType(\n schema: JsonSchema7Type\n): schema is JsonSchema7NumberType {\n return (\n \"type\" in schema && (schema.type === \"number\" || schema.type === \"integer\")\n );\n}\n\n/**\n * Type guard for {@link JsonSchema7BooleanType}\n *\n * @param schema - The schema to check\n * @returns True if the schema is a {@link JsonSchema7BooleanType}, false otherwise\n */\nexport function isJsonSchema7BooleanType(\n schema: JsonSchema7Type\n): schema is JsonSchema7BooleanType {\n return \"type\" in schema && schema.type === \"boolean\";\n}\n\n/**\n * Type guard for {@link JsonSchema7ArrayType}\n *\n * @param schema - The schema to check\n * @returns True if the schema is a {@link JsonSchema7ArrayType}, false otherwise\n */\nexport function isJsonSchema7ArrayType(\n schema: JsonSchema7Type\n): schema is JsonSchema7ArrayType {\n return \"type\" in schema && schema.type === \"array\" && \"items\" in schema;\n}\n\n/**\n * Type guard for {@link JsonSchema7TupleType}\n *\n * @param schema - The schema to check\n * @returns True if the schema is a {@link JsonSchema7TupleType}, false otherwise\n */\nexport function isJsonSchema7TupleType(\n schema: JsonSchema7Type\n): schema is JsonSchema7TupleType {\n return (\n \"type\" in schema &&\n schema.type === \"array\" &&\n \"items\" in schema &&\n Array.isArray(schema.items)\n );\n}\n\n/**\n * Type guard for {@link JsonSchema7PrimitiveLiteralType}\n *\n * @param schema - The schema to check\n * @returns True if the schema is a {@link JsonSchema7PrimitiveLiteralType}, false otherwise\n */\nexport function isJsonSchema7PrimitiveLiteralType(\n schema: JsonSchema7Type\n): schema is JsonSchema7PrimitiveLiteralType {\n if (!(\"type\" in schema)) {\n return false;\n }\n\n const { type } = schema;\n\n return (\n (type === \"string\" ||\n type === \"number\" ||\n type === \"integer\" ||\n type === \"boolean\") &&\n \"const\" in schema\n );\n}\n\n/**\n * Type guard for {@link JsonSchema7LiteralType}\n *\n * @param schema - The schema to check\n * @returns True if the schema is a {@link JsonSchema7LiteralType}, false otherwise\n */\nexport function isJsonSchema7LiteralType(\n schema: JsonSchema7Type\n): schema is JsonSchema7LiteralType {\n if (isJsonSchema7PrimitiveLiteralType(schema)) {\n return true;\n }\n\n if (!(\"type\" in schema)) {\n return false;\n }\n\n return schema.type === \"object\" || schema.type === \"array\";\n}\n\n/**\n * Type guard to check if a value is a {@link StandardJSONSchemaV1 | Standard JSON Schema}.\n *\n * @remarks\n * This function checks if the value has the structure of a Standard JSON Schema, which includes a `~standard` property with a `jsonSchema` object that has `input` and `output` functions.\n *\n * @see https://standardschema.dev/json-schema\n *\n * @param value - The value to check.\n * @returns True if the value is a {@link StandardJSONSchemaV1 | Standard JSON Schema}, false otherwise.\n */\nexport function isStandardJsonSchema<Input = unknown, Output = Input>(\n value: any\n): value is StandardJSONSchemaV1<Input, Output> {\n return (\n isSetObject(value) &&\n \"~standard\" in value &&\n isSetObject(value[\"~standard\"]) &&\n \"jsonSchema\" in value[\"~standard\"] &&\n isSetObject(value[\"~standard\"].jsonSchema) &&\n \"input\" in value[\"~standard\"].jsonSchema &&\n isFunction(value[\"~standard\"].jsonSchema.input) &&\n \"output\" in value[\"~standard\"].jsonSchema &&\n isFunction(value[\"~standard\"].jsonSchema.output)\n );\n}\n"],"mappings":";;;;;;;;;AAwCA,SAAgB,uBACd,QACgC;AAChC,KAAI,UAAU,UAAU,OAAO,SAAS,SACtC,QAAO;AAGT,QAAO,WAAW;;;;;;;;AASpB,SAAgB,wBACd,QACiC;AACjC,KAAI,UAAU,UAAU,OAAO,SAAS,SACtC,QAAO;AAGT,QAAO,gBAAgB;;;;;;;;AASzB,SAAgB,wBACd,QACiC;AACjC,QAAO,UAAU,UAAU,OAAO,SAAS;;;;;;;;AAS7C,SAAgB,wBACd,QACiC;AACjC,QACE,UAAU,WAAW,OAAO,SAAS,YAAY,OAAO,SAAS;;;;;;;;AAUrE,SAAgB,yBACd,QACkC;AAClC,QAAO,UAAU,UAAU,OAAO,SAAS;;;;;;;;AAS7C,SAAgB,uBACd,QACgC;AAChC,QAAO,UAAU,UAAU,OAAO,SAAS,WAAW,WAAW;;;;;;;;AASnE,SAAgB,uBACd,QACgC;AAChC,QACE,UAAU,UACV,OAAO,SAAS,WAChB,WAAW,UACX,MAAM,QAAQ,OAAO,MAAM;;;;;;;;AAU/B,SAAgB,kCACd,QAC2C;AAC3C,KAAI,EAAE,UAAU,QACd,QAAO;CAGT,MAAM,EAAE,SAAS;AAEjB,SACG,SAAS,YACR,SAAS,YACT,SAAS,aACT,SAAS,cACX,WAAW;;;;;;;;AAUf,SAAgB,yBACd,QACkC;AAClC,KAAI,kCAAkC,OAAO,CAC3C,QAAO;AAGT,KAAI,EAAE,UAAU,QACd,QAAO;AAGT,QAAO,OAAO,SAAS,YAAY,OAAO,SAAS;;;;;;;;;;;;;AAcrD,SAAgB,qBACd,OAC8C;AAC9C,QACE,YAAY,MAAM,IAClB,eAAe,SACf,YAAY,MAAM,aAAa,IAC/B,gBAAgB,MAAM,gBACtB,YAAY,MAAM,aAAa,WAAW,IAC1C,WAAW,MAAM,aAAa,cAC9B,WAAW,MAAM,aAAa,WAAW,MAAM,IAC/C,YAAY,MAAM,aAAa,cAC/B,WAAW,MAAM,aAAa,WAAW,OAAO"}
|