@es-joy/jsoe 0.19.1 → 0.20.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.
package/CHANGES.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # CHANGES TO `@es-joy/jsoe`
2
2
 
3
+ ## 0.20.0
4
+
5
+ - feat: make `getTypesForSchema` public
6
+
3
7
  ## 0.19.1
4
8
 
5
9
  - fix: ensure `originalShape` passed to `dezerialize()` (`$ref`'s require)
@@ -1,3 +1,9 @@
1
+ /**
2
+ * @param {ZodexSchema} schemaObject
3
+ * @param {ZodexSchema} originalJSON
4
+ * @returns {Set<ZodexSchema>}
5
+ */
6
+ export function getTypesForSchema(schemaObject: ZodexSchema, originalJSON: ZodexSchema): Set<ZodexSchema>;
1
7
  export default schema;
2
8
  export type ZodexSchema = import("zodex").SzType;
3
9
  export type NestedObject = import("../utils/objects.js").NestedObject;
@@ -1 +1 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/formats/schema.js"],"names":[],"mappings":";0BA2Da,OAAO,OAAO,EAAE,MAAM;2BAGtB,OAAO,qBAAqB,EAAE,YAAY;;;;oBAnD1C,CAAC,IADD,CAAC,CAAC,MAAM,CAAC,CAAC;iCAMV,OAAO,CAChB,IAAI,CAAC,OAAO,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,CACrC;AAsiBH,6CAA6C;AAC7C,sBADW,OAAO,eAAe,EAAE,MAAM,CA2MvC"}
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/formats/schema.js"],"names":[],"mappings":"AAmMA;;;;GAIG;AACH,gDAJW,WAAW,gBACX,WAAW,GACT,GAAG,CAAC,WAAW,CAAC,CAgX5B;;0BA3fY,OAAO,OAAO,EAAE,MAAM;2BAGtB,OAAO,qBAAqB,EAAE,YAAY;;;;oBAnD1C,CAAC,IADD,CAAC,CAAC,MAAM,CAAC,CAAC;iCAMV,OAAO,CAChB,IAAI,CAAC,OAAO,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,CACrC;AAsiBH,6CAA6C;AAC7C,sBADW,OAAO,eAAe,EAAE,MAAM,CA2MvC"}
package/dist/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  export { default as Types } from "./types.js";
2
2
  export { default as Formats } from "./formats.js";
3
3
  export { buildTypeChoices as typeChoices } from "./typeChoices.js";
4
+ export { getTypesForSchema } from "./formats/schema.js";
4
5
  export type TypeRootGetter = import("./formatAndTypeChoices.js").TypeRootGetter;
5
6
  export type SetType = (cfg: {
6
7
  type: string;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.js"],"names":[],"mappings":";;;6BACa,OAAO,2BAA2B,EAAE,cAAc;sBAGlD,CAAC,GAAG,EAAE;IACnB,IAAQ,EAAE,MAAM,CAAC;IACjB,SAAa,CAAC,EAAE,OAAO,cAAc,EAAE,oBAAoB,CAAC;IAC5D,cAAkB,CAAC,EAAE,OAAO,CAAA;CACzB,KAAK,IAAI"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.js"],"names":[],"mappings":";;;;6BACa,OAAO,2BAA2B,EAAE,cAAc;sBAGlD,CAAC,GAAG,EAAE;IACnB,IAAQ,EAAE,MAAM,CAAC;IACjB,SAAa,CAAC,EAAE,OAAO,cAAc,EAAE,oBAAoB,CAAC;IAC5D,cAAkB,CAAC,EAAE,OAAO,CAAA;CACzB,KAAK,IAAI"}
package/dist/index.js CHANGED
@@ -22038,4 +22038,4 @@ async function formatAndTypeChoices ({
22038
22038
  };
22039
22039
  }
22040
22040
 
22041
- export { Formats, Types, formatAndTypeChoices, getFormatAndSchemaChoices, buildTypeChoices as typeChoices };
22041
+ export { Formats, Types, formatAndTypeChoices, getFormatAndSchemaChoices, getTypesForSchema, buildTypeChoices as typeChoices };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@es-joy/jsoe",
3
- "version": "0.19.1",
3
+ "version": "0.20.0",
4
4
  "type": "module",
5
5
  "types": "./dist/index.d.ts",
6
6
  "main": "./src/index.js",
@@ -198,7 +198,7 @@ function addModifiers (schemaObject, set) {
198
198
  * @param {ZodexSchema} originalJSON
199
199
  * @returns {Set<ZodexSchema>}
200
200
  */
201
- function getTypesForSchema (schemaObject, originalJSON) {
201
+ export function getTypesForSchema (schemaObject, originalJSON) {
202
202
  switch (schemaObject.type) {
203
203
  case 'never':
204
204
  return new Set();
package/src/index.js CHANGED
@@ -21,3 +21,7 @@ export {
21
21
  formatAndTypeChoices,
22
22
  getFormatAndSchemaChoices
23
23
  } from './formatAndTypeChoices.js';
24
+
25
+ export {
26
+ getTypesForSchema
27
+ } from './formats/schema.js';