@powerlines/schema 0.11.1 → 0.11.2

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.
Files changed (62) hide show
  1. package/README.md +36 -22
  2. package/dist/bundle.d.cts +2 -2
  3. package/dist/bundle.d.cts.map +1 -1
  4. package/dist/bundle.d.mts +2 -2
  5. package/dist/bundle.d.mts.map +1 -1
  6. package/dist/bundle.mjs.map +1 -1
  7. package/dist/codegen.cjs +27 -0
  8. package/dist/codegen.d.cts +15 -0
  9. package/dist/codegen.d.cts.map +1 -0
  10. package/dist/codegen.d.mts +15 -0
  11. package/dist/codegen.d.mts.map +1 -0
  12. package/dist/codegen.mjs +24 -0
  13. package/dist/codegen.mjs.map +1 -0
  14. package/dist/extract.cjs +201 -52
  15. package/dist/extract.d.cts +81 -16
  16. package/dist/extract.d.cts.map +1 -1
  17. package/dist/extract.d.mts +81 -16
  18. package/dist/extract.d.mts.map +1 -1
  19. package/dist/extract.mjs +199 -55
  20. package/dist/extract.mjs.map +1 -1
  21. package/dist/index.cjs +15 -3
  22. package/dist/index.d.cts +7 -5
  23. package/dist/index.d.mts +7 -5
  24. package/dist/index.mjs +6 -4
  25. package/dist/jtd.cjs +385 -0
  26. package/dist/jtd.d.cts +15 -0
  27. package/dist/jtd.d.cts.map +1 -0
  28. package/dist/jtd.d.mts +15 -0
  29. package/dist/jtd.d.mts.map +1 -0
  30. package/dist/jtd.mjs +384 -0
  31. package/dist/jtd.mjs.map +1 -0
  32. package/dist/reflection.cjs +321 -100
  33. package/dist/reflection.d.cts +16 -13
  34. package/dist/reflection.d.cts.map +1 -1
  35. package/dist/reflection.d.mts +16 -13
  36. package/dist/reflection.d.mts.map +1 -1
  37. package/dist/reflection.mjs +323 -101
  38. package/dist/reflection.mjs.map +1 -1
  39. package/dist/resolve.d.cts +5 -5
  40. package/dist/resolve.d.cts.map +1 -1
  41. package/dist/resolve.d.mts +5 -5
  42. package/dist/resolve.d.mts.map +1 -1
  43. package/dist/resolve.mjs.map +1 -1
  44. package/dist/type-checks.cjs +76 -0
  45. package/dist/type-checks.d.cts +43 -0
  46. package/dist/type-checks.d.cts.map +1 -0
  47. package/dist/type-checks.d.mts +43 -0
  48. package/dist/type-checks.d.mts.map +1 -0
  49. package/dist/type-checks.mjs +71 -0
  50. package/dist/type-checks.mjs.map +1 -0
  51. package/dist/types.d.cts +166 -24
  52. package/dist/types.d.cts.map +1 -1
  53. package/dist/types.d.mts +166 -24
  54. package/dist/types.d.mts.map +1 -1
  55. package/package.json +25 -19
  56. package/dist/is-schema-definition.cjs +0 -18
  57. package/dist/is-schema-definition.d.cts +0 -13
  58. package/dist/is-schema-definition.d.cts.map +0 -1
  59. package/dist/is-schema-definition.d.mts +0 -13
  60. package/dist/is-schema-definition.d.mts.map +0 -1
  61. package/dist/is-schema-definition.mjs +0 -17
  62. package/dist/is-schema-definition.mjs.map +0 -1
package/dist/types.d.mts CHANGED
@@ -1,39 +1,181 @@
1
1
  import { Type } from "@powerlines/deepkit/vendor/type";
2
- import { JsonSchema7Type } from "@stryke/json";
3
2
  import { StandardJSONSchemaV1 } from "@standard-schema/spec";
4
- import { TypeDefinitionParameter } from "@stryke/types/configuration";
3
+ import { JsonSchemaType } from "@stryke/json/types";
4
+ import { TypeDefinition } from "@stryke/types/configuration";
5
+ import { InputObject, Schema as Schema$1 } from "untyped";
5
6
  import * as z3 from "zod/v3";
6
7
 
7
8
  //#region src/types.d.ts
8
- type SchemaDefinitionVariant = "json-schema" | "standard-schema" | "zod3" | "reflection";
9
- interface SchemaDefinitionBase {
10
- schema: JsonSchema7Type;
11
- variant: SchemaDefinitionVariant;
12
- input: SchemaDefinitionInput;
13
- }
14
- interface SchemaDefinitionJsonSchema extends SchemaDefinitionBase {
15
- schema: JsonSchema7Type;
9
+ type UntypedInputObject = InputObject;
10
+ type UntypedSchema = Schema$1;
11
+ /**
12
+ * The set of numeric `type` strings supported by JSON Type Definition (RFC 8927).
13
+ */
14
+ type JTDNumberType = "float32" | "float64" | "int8" | "uint8" | "int16" | "uint16" | "int32" | "uint32";
15
+ /**
16
+ * The set of string `type` strings supported by JSON Type Definition (RFC 8927).
17
+ */
18
+ type JTDStringType = "string" | "timestamp";
19
+ /**
20
+ * The set of `type` strings supported by JSON Type Definition (RFC 8927).
21
+ */
22
+ type JTDType = JTDNumberType | JTDStringType | "boolean";
23
+ interface JsonSchemaLike {
24
+ type?: string | string[];
25
+ format?: string;
26
+ enum?: unknown[];
27
+ const?: unknown;
28
+ items?: JsonSchemaLike | JsonSchemaLike[];
29
+ properties?: Record<string, JsonSchemaLike>;
30
+ patternProperties?: Record<string, JsonSchemaLike>;
31
+ additionalProperties?: boolean | JsonSchemaLike;
32
+ required?: string[];
33
+ anyOf?: JsonSchemaLike[];
34
+ oneOf?: JsonSchemaLike[];
35
+ allOf?: JsonSchemaLike[];
36
+ $ref?: string;
37
+ description?: string;
38
+ title?: string;
39
+ default?: unknown;
40
+ examples?: unknown[];
41
+ minimum?: number;
42
+ maximum?: number;
43
+ exclusiveMinimum?: number | boolean;
44
+ exclusiveMaximum?: number | boolean;
45
+ nullable?: boolean;
46
+ definitions?: Record<string, JsonSchemaLike>;
47
+ $defs?: Record<string, JsonSchemaLike>;
48
+ discriminator?: {
49
+ propertyName?: string;
50
+ } | string;
51
+ [key: string]: unknown;
52
+ }
53
+ interface SchemaMetadata {
54
+ /**
55
+ * A title for the schema, which can be used by documentation tools or other libraries that support this feature to provide a human-readable name or description for the schema. The presence of this property does not affect the validation behavior of the schema itself, but it can provide additional context or information about the schema when used in conjunction with compatible tools.
56
+ */
57
+ title?: string;
58
+ /**
59
+ * A description for the schema, which can be used by documentation tools or other libraries that support this feature to provide a human-readable explanation or summary of the schema's purpose and usage. The presence of this property does not affect the validation behavior of the schema itself, but it can provide additional context or information about the schema when used in conjunction with compatible tools.
60
+ */
61
+ description?: string;
62
+ /**
63
+ * A default value for the schema, which can be used by validation libraries or other tools that support this feature. The presence of this property does not affect the validation behavior of the schema itself, but it can provide additional context or information about the expected data when used in conjunction with compatible tools.
64
+ */
65
+ default?: unknown;
66
+ /**
67
+ * An array of example values that conform to the schema. This property can be used to provide sample data for documentation purposes or to assist developers in understanding the expected structure and content of the data that the schema represents. The presence of this property does not affect the validation behavior of the schema itself, but it can provide additional context or information about the expected data when used in conjunction with compatible tools.
68
+ */
69
+ examples?: unknown[];
70
+ /**
71
+ * A table name for the schema, which can be used by documentation tools or other libraries that support this feature to provide a human-readable name or description for the schema. The presence of this property does not affect the validation behavior of the schema itself, but it can provide additional context or information about the schema when used in conjunction with compatible tools.
72
+ */
73
+ table?: string;
74
+ /**
75
+ * An indicator specifying if the field should be marked as hidden or not.
76
+ */
77
+ isHidden?: boolean;
78
+ /**
79
+ * An indicator specifying if the field should be ignored or not.
80
+ */
81
+ isIgnored?: boolean;
82
+ /**
83
+ * An indicator specifying if the field is internal or not.
84
+ *
85
+ * @internal
86
+ */
87
+ isInternal?: boolean;
88
+ /**
89
+ * An indicator specifying if the field should only be populated at runtime or not.
90
+ */
91
+ isRuntime?: boolean;
92
+ /**
93
+ * An indicator specifying if the field is read-only or not. This property can be used to indicate that a field should not be modified after it has been set, which can be useful for documentation purposes or to assist developers in understanding the expected behavior of the data that the schema represents. The presence of this property does not affect the validation behavior of the schema itself, but it can provide additional context or information about the expected data when used in conjunction with compatible tools.
94
+ */
95
+ isReadonly?: boolean;
96
+ /**
97
+ * An indicator specifying if the field is a primary key or not. This property can be used to indicate that a field serves as a unique identifier for records in a dataset, which can be useful for documentation purposes or to assist developers in understanding the expected structure and behavior of the data that the schema represents. The presence of this property does not affect the validation behavior of the schema itself, but it can provide additional context or information about the expected data when used in conjunction with compatible tools.
98
+ */
99
+ isPrimaryKey?: boolean;
100
+ /**
101
+ * An array of strings or an alias reference to indicate that the field is an alias for one or more other fields. This property can be used to provide alternative names or references for a field, which can be useful for documentation purposes or to assist developers in understanding the expected structure and content of the data that the schema represents. The presence of this property does not affect the validation behavior of the schema itself, but it can provide additional context or information about the expected data when used in conjunction with compatible tools.
102
+ */
103
+ alias?: string[];
104
+ /**
105
+ * Schemas that are unioned together to form a single schema. This property can be used to represent complex data structures that can conform to multiple different schemas. The presence of this property does not affect the validation behavior of the schema itself, but it can provide additional context or information about the expected data when used in conjunction with compatible tools.
106
+ */
107
+ union?: JsonSchemaLike[];
108
+ [key: string]: unknown | undefined;
109
+ }
110
+ type JTDSchemaType<TMetadata extends Partial<SchemaMetadata> = Partial<SchemaMetadata>> = ({
111
+ ref: string;
112
+ } | {
113
+ type: JTDType;
114
+ } | {
115
+ enum: string[];
116
+ } | {
117
+ elements: JTDSchemaType<TMetadata>;
118
+ } | {
119
+ values: JTDSchemaType<TMetadata>;
120
+ } | {
121
+ properties: Record<string, JTDSchemaType<TMetadata>>;
122
+ optionalProperties?: Record<string, JTDSchemaType<TMetadata>>;
123
+ additionalProperties?: boolean;
124
+ } | {
125
+ properties?: Record<string, JTDSchemaType<TMetadata>>;
126
+ optionalProperties: Record<string, JTDSchemaType<TMetadata>>;
127
+ additionalProperties?: boolean;
128
+ } | {
129
+ discriminator: string;
130
+ mapping: Record<string, JTDSchemaType<TMetadata>>;
131
+ } | {}) & {
132
+ nullable?: boolean;
133
+ metadata?: TMetadata;
134
+ definitions?: Record<string, JTDSchemaType<TMetadata>>;
135
+ };
136
+ type SchemaSourceVariant = "standard-schema" | "jtd-schema" | "json-schema" | "zod3" | "untyped" | "reflection";
137
+ type SchemaInputVariant = SchemaSourceVariant | "type-definition";
138
+ type SchemaSourceInput<TMetadata extends Partial<SchemaMetadata> = Partial<SchemaMetadata>> = StandardJSONSchemaV1 | JTDSchemaType<TMetadata> | JsonSchemaType | z3.ZodTypeAny | UntypedInputObject | UntypedSchema | Type;
139
+ type TypeDefinitionReference = TypeDefinition | string;
140
+ type SchemaInput = SchemaSourceInput | Schema | TypeDefinitionReference;
141
+ interface Schema<TMetadata extends Partial<SchemaMetadata> = Partial<SchemaMetadata>> {
142
+ hash: string;
143
+ variant: SchemaInputVariant;
144
+ schema: JTDSchemaType<TMetadata>;
145
+ }
146
+ interface BaseSchemaSource {
147
+ hash: string;
148
+ variant: SchemaSourceVariant;
149
+ schema: SchemaSourceInput;
150
+ }
151
+ interface JTDSchemaSchemaSource<TMetadata extends Partial<SchemaMetadata> = Partial<SchemaMetadata>> extends BaseSchemaSource {
152
+ variant: "jtd-schema";
153
+ schema: JTDSchemaType<TMetadata>;
154
+ }
155
+ interface JsonSchemaSchemaSource extends BaseSchemaSource {
16
156
  variant: "json-schema";
17
- input: JsonSchema7Type;
157
+ schema: JsonSchemaType;
18
158
  }
19
- interface SchemaDefinitionStandardSchema extends SchemaDefinitionBase {
20
- schema: JsonSchema7Type;
159
+ interface StandardSchemaSchemaSource extends BaseSchemaSource {
21
160
  variant: "standard-schema";
22
- input: StandardJSONSchemaV1;
161
+ schema: StandardJSONSchemaV1;
23
162
  }
24
- interface SchemaDefinitionZod3 extends SchemaDefinitionBase {
25
- schema: JsonSchema7Type;
163
+ interface Zod3SchemaSource extends BaseSchemaSource {
26
164
  variant: "zod3";
27
- input: z3.ZodTypeAny;
165
+ schema: z3.ZodTypeAny;
28
166
  }
29
- interface SchemaDefinitionReflection extends SchemaDefinitionBase {
30
- schema: JsonSchema7Type;
167
+ interface ReflectionSchemaSource extends BaseSchemaSource {
31
168
  variant: "reflection";
32
- input: Type;
169
+ schema: Type;
170
+ }
171
+ interface UntypedSchemaSource extends BaseSchemaSource {
172
+ variant: "untyped";
173
+ schema: UntypedInputObject | UntypedSchema;
174
+ }
175
+ type SchemaSource = JsonSchemaSchemaSource | JTDSchemaSchemaSource | StandardSchemaSchemaSource | Zod3SchemaSource | UntypedSchemaSource | ReflectionSchemaSource;
176
+ interface ExtractedSchema<TMetadata extends Partial<SchemaMetadata> = Partial<SchemaMetadata>> extends Schema<TMetadata> {
177
+ source: SchemaSource;
33
178
  }
34
- type SchemaDefinition = SchemaDefinitionJsonSchema | SchemaDefinitionStandardSchema | SchemaDefinitionZod3 | SchemaDefinitionReflection;
35
- type SchemaDefinitionInput = SchemaDefinition | JsonSchema7Type | StandardJSONSchemaV1 | z3.ZodTypeAny | Type;
36
- type SchemaDefinitionParameter = SchemaDefinitionInput | TypeDefinitionParameter;
37
179
  //#endregion
38
- export { SchemaDefinition, SchemaDefinitionBase, SchemaDefinitionInput, SchemaDefinitionJsonSchema, SchemaDefinitionParameter, SchemaDefinitionReflection, SchemaDefinitionStandardSchema, SchemaDefinitionVariant, SchemaDefinitionZod3 };
180
+ export { BaseSchemaSource, ExtractedSchema, JTDNumberType, JTDSchemaSchemaSource, JTDSchemaType, JTDStringType, JTDType, JsonSchemaLike, JsonSchemaSchemaSource, ReflectionSchemaSource, Schema, SchemaInput, SchemaInputVariant, SchemaMetadata, SchemaSource, SchemaSourceInput, SchemaSourceVariant, StandardSchemaSchemaSource, TypeDefinitionReference, UntypedInputObject, UntypedSchema, UntypedSchemaSource, Zod3SchemaSource };
39
181
  //# sourceMappingURL=types.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.mts","names":[],"sources":["../src/types.ts"],"mappings":";;;;;;;KAwBY,uBAAA;AAAA,UAMK,oBAAA;EACf,MAAA,EAAQ,eAAA;EACR,OAAA,EAAS,uBAAA;EACT,KAAA,EAAO,qBAAA;AAAA;AAAA,UAGQ,0BAAA,SAAmC,oBAAA;EAClD,MAAA,EAAQ,eAAA;EACR,OAAA;EACA,KAAA,EAAO,eAAA;AAAA;AAAA,UAGQ,8BAAA,SAAuC,oBAAA;EACtD,MAAA,EAAQ,eAAA;EACR,OAAA;EACA,KAAA,EAAO,oBAAA;AAAA;AAAA,UAGQ,oBAAA,SAA6B,oBAAA;EAC5C,MAAA,EAAQ,eAAA;EACR,OAAA;EACA,KAAA,EAAO,EAAA,CAAG,UAAA;AAAA;AAAA,UAGK,0BAAA,SAAmC,oBAAA;EAClD,MAAA,EAAQ,eAAA;EACR,OAAA;EACA,KAAA,EAAO,IAAA;AAAA;AAAA,KAGG,gBAAA,GACR,0BAAA,GACA,8BA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AA,CAAQ,cAAA,IAAkB,OAAA,CAAQ,cAAA,WAC5C,gBAAA;EACR,OAAA;EACA,MAAA,EAAQ,aAAA,CAAc,SAAA;AAAA;AAAA,UAGP,sBAAA,SAA+B,gBAAA;EAC9C,OAAA;EACA,MAAA,EAAQ,cAAA;AAAA;AAAA,UAGO,0BAAA,SAAmC,gBAAA;EAClD,OAAA;EACA,MAAA,EAAQ,oBAAA;AAAA;AAAA,UAGO,gBAAA,SAAyB,gBAAA;EACxC,OAAA;EACA,MAAA,EAAQ,EAAA,CAAG,UAAA;AAAA;AAAA,UAGI,sBAAA,SAA+B,gBAAA;EAC9C,OAAA;EACA,MAAA,EAAQ,IAAA;AAAA;AAAA,UAGO,mBAAA,SAA4B,gBAAA;EAC3C,OAAA;EACA,MAAA,EAAQ,kBAAA,GAAqB,aAAA;AAAA;AAAA,KAGnB,YAAA,GACR,sBAAA,GACA,qBAAA,GACA,0BAAA,GACA,gBAAA,GACA,mBAAA,GACA,sBAAA;AAAA,UAEa,eAAA,mBACG,OAAA,CAAQ,cAAA,IAAkB,OAAA,CAAQ,cAAA,WAC5C,MAAA,CAAO,SAAA;EACf,MAAA,EAAQ,YAAA;AAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/schema",
3
- "version": "0.11.1",
3
+ "version": "0.11.2",
4
4
  "private": false,
5
5
  "description": "A package containing a Powerlines plugin to assist in developing other Powerlines plugins.",
6
6
  "keywords": [
@@ -54,14 +54,15 @@
54
54
  "import": "./dist/bundle.mjs",
55
55
  "require": "./dist/bundle.cjs"
56
56
  },
57
+ "./codegen": {
58
+ "import": "./dist/codegen.mjs",
59
+ "require": "./dist/codegen.cjs"
60
+ },
57
61
  "./extract": {
58
62
  "import": "./dist/extract.mjs",
59
63
  "require": "./dist/extract.cjs"
60
64
  },
61
- "./is-schema-definition": {
62
- "import": "./dist/is-schema-definition.mjs",
63
- "require": "./dist/is-schema-definition.cjs"
64
- },
65
+ "./jtd": { "import": "./dist/jtd.mjs", "require": "./dist/jtd.cjs" },
65
66
  "./reflection": {
66
67
  "import": "./dist/reflection.mjs",
67
68
  "require": "./dist/reflection.cjs"
@@ -70,6 +71,10 @@
70
71
  "import": "./dist/resolve.mjs",
71
72
  "require": "./dist/resolve.cjs"
72
73
  },
74
+ "./type-checks": {
75
+ "import": "./dist/type-checks.mjs",
76
+ "require": "./dist/type-checks.cjs"
77
+ },
73
78
  "./types": { "import": "./dist/types.mjs", "require": "./dist/types.cjs" },
74
79
  "./package.json": "./package.json"
75
80
  },
@@ -79,25 +84,26 @@
79
84
  "typings": "dist/index.d.mts",
80
85
  "files": ["dist"],
81
86
  "dependencies": {
82
- "@powerlines/core": "^0.15.1",
83
- "@powerlines/deepkit": "^0.8.66",
84
- "@powerlines/unplugin": "^0.0.11",
87
+ "@powerlines/core": "^0.11.2",
88
+ "@powerlines/deepkit": "^0.11.2",
89
+ "@powerlines/unplugin": "^0.0.15",
85
90
  "@standard-schema/spec": "^1.1.0",
86
- "@standard-schema/utils": "^0.3.0",
87
- "@stryke/fs": "^0.33.75",
88
- "@stryke/helpers": "^0.10.15",
89
- "@stryke/json": "^0.14.20",
90
- "@stryke/path": "^0.29.2",
91
- "@stryke/type-checks": "^0.6.8",
92
- "@stryke/types": "^0.12.3",
93
- "@stryke/zod": "^0.3.21",
91
+ "@stryke/hash": "^0.13.29",
92
+ "@stryke/helpers": "^0.10.16",
93
+ "@stryke/json": "^0.15.0",
94
+ "@stryke/path": "^0.29.3",
95
+ "@stryke/type-checks": "^0.6.9",
96
+ "@stryke/types": "^0.12.4",
97
+ "@stryke/zod": "^0.3.22",
98
+ "ajv": "^8.20.0",
94
99
  "defu": "^6.1.7",
95
100
  "esbuild": "^0.27.7",
96
- "typescript": "^6.0.3"
101
+ "typescript": "^6.0.3",
102
+ "untyped": "^1.5.2"
97
103
  },
98
- "devDependencies": { "zod": "^4.4.3", "@types/node": "^25.7.0" },
104
+ "devDependencies": { "@types/node": "^25.8.0", "zod": "^4.4.3" },
99
105
  "peerDependencies": { "zod": "^3.25.0 || ^4.0.0" },
100
106
  "peerDependenciesMeta": { "zod": { "optional": true } },
101
107
  "publishConfig": { "access": "public" },
102
- "gitHead": "0baea9ad9bcd4d8a4eeeed56cac8ba739ca529c1"
108
+ "gitHead": "36f51f76091249b5d769528d78908d4aa72705de"
103
109
  }
@@ -1,18 +0,0 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
3
- let _stryke_type_checks = require("@stryke/type-checks");
4
- let _stryke_json_schema = require("@stryke/json/schema");
5
-
6
- //#region src/is-schema-definition.ts
7
- /**
8
- * Type guard to check if a given input is a `SchemaDefinition` object. This function verifies that the input is a non-null object, contains a `schema` property that is a JSON Schema (draft-07) object, contains an `input` property that is a non-null object, and has a `variant` property that is one of the allowed schema variants ("json-schema", "standard-schema", "zod3", or "reflection"). If all these conditions are met, the function returns `true`, indicating that the input is a valid `SchemaDefinition`; otherwise, it returns `false`.
9
- *
10
- * @param input - The input to check for being a `SchemaDefinition`.
11
- * @returns `true` if the input is a `SchemaDefinition`, otherwise `false`.
12
- */
13
- function isSchemaDefinition(input) {
14
- return (0, _stryke_type_checks.isSetObject)(input) && "schema" in input && (0, _stryke_json_schema.isJsonSchema7ObjectType)(input.schema) && "input" in input && (0, _stryke_type_checks.isSetObject)(input.input) && "variant" in input && (input.variant === "json-schema" || input.variant === "standard-schema" || input.variant === "zod3" || input.variant === "reflection");
15
- }
16
-
17
- //#endregion
18
- exports.isSchemaDefinition = isSchemaDefinition;
@@ -1,13 +0,0 @@
1
- import { SchemaDefinition } from "./types.cjs";
2
-
3
- //#region src/is-schema-definition.d.ts
4
- /**
5
- * Type guard to check if a given input is a `SchemaDefinition` object. This function verifies that the input is a non-null object, contains a `schema` property that is a JSON Schema (draft-07) object, contains an `input` property that is a non-null object, and has a `variant` property that is one of the allowed schema variants ("json-schema", "standard-schema", "zod3", or "reflection"). If all these conditions are met, the function returns `true`, indicating that the input is a valid `SchemaDefinition`; otherwise, it returns `false`.
6
- *
7
- * @param input - The input to check for being a `SchemaDefinition`.
8
- * @returns `true` if the input is a `SchemaDefinition`, otherwise `false`.
9
- */
10
- declare function isSchemaDefinition(input: unknown): input is SchemaDefinition;
11
- //#endregion
12
- export { isSchemaDefinition };
13
- //# sourceMappingURL=is-schema-definition.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"is-schema-definition.d.cts","names":[],"sources":["../src/is-schema-definition.ts"],"mappings":";;;;;AA4BA;;;;iBAAgB,kBAAA,CAAmB,KAAA,YAAiB,KAAA,IAAS,gBAAA"}
@@ -1,13 +0,0 @@
1
- import { SchemaDefinition } from "./types.mjs";
2
-
3
- //#region src/is-schema-definition.d.ts
4
- /**
5
- * Type guard to check if a given input is a `SchemaDefinition` object. This function verifies that the input is a non-null object, contains a `schema` property that is a JSON Schema (draft-07) object, contains an `input` property that is a non-null object, and has a `variant` property that is one of the allowed schema variants ("json-schema", "standard-schema", "zod3", or "reflection"). If all these conditions are met, the function returns `true`, indicating that the input is a valid `SchemaDefinition`; otherwise, it returns `false`.
6
- *
7
- * @param input - The input to check for being a `SchemaDefinition`.
8
- * @returns `true` if the input is a `SchemaDefinition`, otherwise `false`.
9
- */
10
- declare function isSchemaDefinition(input: unknown): input is SchemaDefinition;
11
- //#endregion
12
- export { isSchemaDefinition };
13
- //# sourceMappingURL=is-schema-definition.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"is-schema-definition.d.mts","names":[],"sources":["../src/is-schema-definition.ts"],"mappings":";;;;;AA4BA;;;;iBAAgB,kBAAA,CAAmB,KAAA,YAAiB,KAAA,IAAS,gBAAA"}
@@ -1,17 +0,0 @@
1
- import { isSetObject } from "@stryke/type-checks";
2
- import { isJsonSchema7ObjectType } from "@stryke/json/schema";
3
-
4
- //#region src/is-schema-definition.ts
5
- /**
6
- * Type guard to check if a given input is a `SchemaDefinition` object. This function verifies that the input is a non-null object, contains a `schema` property that is a JSON Schema (draft-07) object, contains an `input` property that is a non-null object, and has a `variant` property that is one of the allowed schema variants ("json-schema", "standard-schema", "zod3", or "reflection"). If all these conditions are met, the function returns `true`, indicating that the input is a valid `SchemaDefinition`; otherwise, it returns `false`.
7
- *
8
- * @param input - The input to check for being a `SchemaDefinition`.
9
- * @returns `true` if the input is a `SchemaDefinition`, otherwise `false`.
10
- */
11
- function isSchemaDefinition(input) {
12
- return isSetObject(input) && "schema" in input && isJsonSchema7ObjectType(input.schema) && "input" in input && isSetObject(input.input) && "variant" in input && (input.variant === "json-schema" || input.variant === "standard-schema" || input.variant === "zod3" || input.variant === "reflection");
13
- }
14
-
15
- //#endregion
16
- export { isSchemaDefinition };
17
- //# sourceMappingURL=is-schema-definition.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"is-schema-definition.mjs","names":[],"sources":["../src/is-schema-definition.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\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/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { isJsonSchema7ObjectType } from \"@stryke/json/schema\";\nimport { isSetObject } from \"@stryke/type-checks\";\nimport { SchemaDefinition } from \"./types\";\n\n/**\n * Type guard to check if a given input is a `SchemaDefinition` object. This function verifies that the input is a non-null object, contains a `schema` property that is a JSON Schema (draft-07) object, contains an `input` property that is a non-null object, and has a `variant` property that is one of the allowed schema variants (\"json-schema\", \"standard-schema\", \"zod3\", or \"reflection\"). If all these conditions are met, the function returns `true`, indicating that the input is a valid `SchemaDefinition`; otherwise, it returns `false`.\n *\n * @param input - The input to check for being a `SchemaDefinition`.\n * @returns `true` if the input is a `SchemaDefinition`, otherwise `false`.\n */\nexport function isSchemaDefinition(input: unknown): input is SchemaDefinition {\n return (\n isSetObject(input) &&\n \"schema\" in input &&\n isJsonSchema7ObjectType(input.schema) &&\n \"input\" in input &&\n isSetObject(input.input) &&\n \"variant\" in input &&\n (input.variant === \"json-schema\" ||\n input.variant === \"standard-schema\" ||\n input.variant === \"zod3\" ||\n input.variant === \"reflection\")\n );\n}\n"],"mappings":";;;;;;;;;;AA4BA,SAAgB,mBAAmB,OAA2C;AAC5E,QACE,YAAY,MAAM,IAClB,YAAY,SACZ,wBAAwB,MAAM,OAAO,IACrC,WAAW,SACX,YAAY,MAAM,MAAM,IACxB,aAAa,UACZ,MAAM,YAAY,iBACjB,MAAM,YAAY,qBAClB,MAAM,YAAY,UAClB,MAAM,YAAY"}