@powerlines/schema 0.8.67 → 0.9.0

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 (55) 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/extract.cjs +200 -51
  8. package/dist/extract.d.cts +82 -16
  9. package/dist/extract.d.cts.map +1 -1
  10. package/dist/extract.d.mts +82 -16
  11. package/dist/extract.d.mts.map +1 -1
  12. package/dist/extract.mjs +198 -54
  13. package/dist/extract.mjs.map +1 -1
  14. package/dist/index.cjs +13 -2
  15. package/dist/index.d.cts +5 -4
  16. package/dist/index.d.mts +5 -4
  17. package/dist/index.mjs +4 -3
  18. package/dist/jtd.cjs +362 -0
  19. package/dist/jtd.d.cts +16 -0
  20. package/dist/jtd.d.cts.map +1 -0
  21. package/dist/jtd.d.mts +16 -0
  22. package/dist/jtd.d.mts.map +1 -0
  23. package/dist/jtd.mjs +361 -0
  24. package/dist/jtd.mjs.map +1 -0
  25. package/dist/reflection.cjs +229 -108
  26. package/dist/reflection.d.cts +17 -7
  27. package/dist/reflection.d.cts.map +1 -1
  28. package/dist/reflection.d.mts +17 -7
  29. package/dist/reflection.d.mts.map +1 -1
  30. package/dist/reflection.mjs +229 -108
  31. package/dist/reflection.mjs.map +1 -1
  32. package/dist/resolve.d.cts +5 -5
  33. package/dist/resolve.d.cts.map +1 -1
  34. package/dist/resolve.d.mts +5 -5
  35. package/dist/resolve.d.mts.map +1 -1
  36. package/dist/resolve.mjs.map +1 -1
  37. package/dist/type-checks.cjs +76 -0
  38. package/dist/type-checks.d.cts +43 -0
  39. package/dist/type-checks.d.cts.map +1 -0
  40. package/dist/type-checks.d.mts +43 -0
  41. package/dist/type-checks.d.mts.map +1 -0
  42. package/dist/type-checks.mjs +71 -0
  43. package/dist/type-checks.mjs.map +1 -0
  44. package/dist/types.d.cts +80 -24
  45. package/dist/types.d.cts.map +1 -1
  46. package/dist/types.d.mts +80 -24
  47. package/dist/types.d.mts.map +1 -1
  48. package/package.json +21 -19
  49. package/dist/is-schema-definition.cjs +0 -18
  50. package/dist/is-schema-definition.d.cts +0 -13
  51. package/dist/is-schema-definition.d.cts.map +0 -1
  52. package/dist/is-schema-definition.d.mts +0 -13
  53. package/dist/is-schema-definition.d.mts.map +0 -1
  54. package/dist/is-schema-definition.mjs +0 -17
  55. package/dist/is-schema-definition.mjs.map +0 -1
@@ -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"}