@anatine/zod-mock
Advanced tools
Comparing version 3.1.1 to 3.2.0
{ | ||
"name": "@anatine/zod-mock", | ||
"version": "3.1.1", | ||
"version": "3.2.0", | ||
"description": "Zod auto-mock object generator using Faker at @faker-js/faker", | ||
@@ -25,4 +25,3 @@ "main": "src/index.js", | ||
"@faker-js/faker": "^6.0.0-beta.0", | ||
"randexp": "^0.5.3", | ||
"zod": "^3.13.4" | ||
"randexp": "^0.5.3" | ||
}, | ||
@@ -29,0 +28,0 @@ "dependencies": { |
# @anatine/zod-mock | ||
Generates a mock data object using [faker.js](https://www.npmjs.com/package/faker) from a [Zod](https://github.com/colinhacks/zod) schema. | ||
Generates a mock data object using [faker.js](https://www.npmjs.com/package/@faker-js/faker) from a [Zod](https://github.com/colinhacks/zod) schema. | ||
@@ -13,3 +13,3 @@ ---- | ||
```shell | ||
npm install faker zod @anatine/zod-mock | ||
npm install @faker-js/faker zod @anatine/zod-mock | ||
``` | ||
@@ -16,0 +16,0 @@ |
@@ -208,3 +208,3 @@ "use strict"; | ||
: { transform: () => input }; | ||
return effect.transform(input); | ||
return effect.transform(input, { addIssue: () => undefined, path: [] }); // TODO : Discover if context is necessary here | ||
} | ||
@@ -214,3 +214,3 @@ function parseUnion(zodRef, options) { | ||
const mockOptions = zodRef._def.options.map((option) => generateMock(option, options)); | ||
return faker_1.faker.helpers.randomize(mockOptions); | ||
return faker_1.faker.helpers.arrayElement(mockOptions); | ||
} | ||
@@ -217,0 +217,0 @@ const workerMap = { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
25526
3