@gabrielbryk/json-schema-to-zod 2.9.0 → 2.10.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.
@@ -1,6 +1,7 @@
1
1
  export const omit = (obj, ...keys) => Object.keys(obj).reduce((acc, key) => {
2
- if (!keys.includes(key)) {
3
- acc[key] = obj[key];
2
+ const typedKey = key;
3
+ if (!keys.includes(typedKey)) {
4
+ acc[typedKey] = obj[typedKey];
4
5
  }
5
6
  return acc;
6
7
  }, {});
@@ -6,6 +6,11 @@ export type JsonSchemaObject = {
6
6
  type?: string | string[];
7
7
  $id?: string;
8
8
  $ref?: string;
9
+ $anchor?: string;
10
+ $dynamicRef?: string;
11
+ $dynamicAnchor?: string;
12
+ $recursiveRef?: string;
13
+ $recursiveAnchor?: boolean;
9
14
  $defs?: Record<string, JsonSchema>;
10
15
  definitions?: Record<string, JsonSchema>;
11
16
  title?: string;
@@ -53,9 +58,7 @@ export type JsonSchemaObject = {
53
58
  errorMessage?: {
54
59
  [key: string]: string | undefined;
55
60
  };
56
- } & {
57
- [key: string]: any;
58
- };
61
+ } & Record<string, unknown>;
59
62
  export type ParserSelector = (schema: JsonSchemaObject, refs: Refs) => string;
60
63
  export type ParserOverride = (schema: JsonSchemaObject, refs: Refs) => string | void;
61
64
  export type Options = {
@@ -1,4 +1 @@
1
- import { JsonSchemaObject } from "../Types.js";
2
- export declare const parseBoolean: (_schema: JsonSchemaObject & {
3
- type: "boolean";
4
- }) => string;
1
+ export declare const parseBoolean: () => string;
@@ -1,4 +1 @@
1
- import { JsonSchemaObject } from "../Types.js";
2
- export declare const parseNull: (_schema: JsonSchemaObject & {
3
- type: "null";
4
- }) => string;
1
+ export declare const parseNull: () => string;
@@ -1,4 +1,4 @@
1
- import { JsonSchema, Options } from "../Types.js";
1
+ import { JsonSchema } from "../Types.js";
2
2
  export type RefRegistryEntry = {
3
3
  schema: JsonSchema;
4
4
  path: (string | number)[];
@@ -6,7 +6,7 @@ export type RefRegistryEntry = {
6
6
  dynamic?: boolean;
7
7
  anchor?: string;
8
8
  };
9
- export declare const buildRefRegistry: (schema: JsonSchema, rootBaseUri?: string, opts?: Options) => {
9
+ export declare const buildRefRegistry: (schema: JsonSchema, rootBaseUri?: string) => {
10
10
  registry: Map<string, RefRegistryEntry>;
11
11
  rootBaseUri: string;
12
12
  };
package/eslint.config.js CHANGED
@@ -3,7 +3,7 @@ import pluginTs from "@typescript-eslint/eslint-plugin";
3
3
 
4
4
  export default [
5
5
  {
6
- ignores: ["dist", "node_modules"],
6
+ ignores: ["dist", "node_modules", "test/output/**"],
7
7
  },
8
8
  {
9
9
  files: ["**/*.ts", "**/*.tsx"],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gabrielbryk/json-schema-to-zod",
3
- "version": "2.9.0",
3
+ "version": "2.10.1",
4
4
  "description": "Converts JSON schema objects or files into Zod schemas",
5
5
  "type": "module",
6
6
  "types": "./dist/types/index.d.ts",