@schmock/faker 1.7.0 → 1.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.
- package/dist/index.d.ts +1 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +66 -66
- package/package.json +3 -3
- package/src/index.ts +4 -3
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@schmock/faker",
|
|
3
3
|
"description": "Faker-powered automatic data generation for Schmock",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.9.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
@@ -34,12 +34,12 @@
|
|
|
34
34
|
"json-schema-faker": "^0.5.6"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
|
-
"@schmock/core": "^1.
|
|
37
|
+
"@schmock/core": "^1.9.0"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@amiceli/vitest-cucumber": "^6.2.0",
|
|
41
41
|
"@types/json-schema": "^7.0.15",
|
|
42
|
-
"@types/node": "^25.2.
|
|
42
|
+
"@types/node": "^25.2.3",
|
|
43
43
|
"vitest": "^4.0.18"
|
|
44
44
|
}
|
|
45
45
|
}
|
package/src/index.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
/// <reference path="../../core/schmock.d.ts" />
|
|
2
|
+
|
|
1
3
|
import { en, Faker } from "@faker-js/faker";
|
|
2
|
-
import type { Plugin, PluginContext } from "@schmock/core";
|
|
3
4
|
import {
|
|
4
5
|
ResourceLimitError,
|
|
5
6
|
SchemaGenerationError,
|
|
@@ -95,7 +96,7 @@ export interface FakerPluginOptions {
|
|
|
95
96
|
seed?: number;
|
|
96
97
|
}
|
|
97
98
|
|
|
98
|
-
export function fakerPlugin(options: FakerPluginOptions): Plugin {
|
|
99
|
+
export function fakerPlugin(options: FakerPluginOptions): Schmock.Plugin {
|
|
99
100
|
// Validate schema immediately when plugin is created
|
|
100
101
|
validateSchema(options.schema);
|
|
101
102
|
|
|
@@ -103,7 +104,7 @@ export function fakerPlugin(options: FakerPluginOptions): Plugin {
|
|
|
103
104
|
name: "faker",
|
|
104
105
|
version: "1.0.1",
|
|
105
106
|
|
|
106
|
-
process(context: PluginContext, response?: any) {
|
|
107
|
+
process(context: Schmock.PluginContext, response?: any) {
|
|
107
108
|
// If response already exists, pass it through
|
|
108
109
|
if (response !== undefined && response !== null) {
|
|
109
110
|
return { context, response };
|