use-zod-default 1.0.5 → 1.0.6

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/dist/index.d.ts CHANGED
@@ -1,6 +1,3 @@
1
1
  import { z } from 'zod';
2
- type DeepPartial<T> = T extends (infer U)[] ? DeepPartial<U>[] : T extends object ? {
3
- [P in keyof T]?: DeepPartial<T[P]>;
4
- } : T;
5
- declare const defaultInstance: <T extends z.ZodSchema>(schema: T, source?: DeepPartial<z.input<T>>) => z.output<T>;
2
+ declare const defaultInstance: <T extends z.ZodSchema>(schema: T, source?: Partial<z.input<T>>) => z.output<T>;
6
3
  export default defaultInstance;
package/dist/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import { z } from 'zod';
2
+ // type DeepPartial<T> = T extends (infer U)[] ? DeepPartial<U>[] : T extends object ? { [P in keyof T]?: DeepPartial<T[P]> } : T;
2
3
  const defaultInstance = (schema, source = {}) => {
3
4
  const getDefaultValue = (schema) => {
4
5
  if (schema instanceof z.ZodDefault) {
package/package.json CHANGED
@@ -27,5 +27,5 @@
27
27
  "test": "vitest",
28
28
  "test:coverage": "rm -rf coverage && vitest --run --coverage"
29
29
  },
30
- "version": "1.0.5"
30
+ "version": "1.0.6"
31
31
  }