@kubb/plugin-faker 5.0.9 → 5.0.10
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.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -170,7 +170,8 @@ declare global {
|
|
|
170
170
|
* Partial map of node-type overrides for the Faker printer. Each key is a
|
|
171
171
|
* `SchemaType` (`'string'`, `'date'`, ...) and each handler returns the
|
|
172
172
|
* Faker expression for that schema as a string. Use `this.transform` to
|
|
173
|
-
* recurse into nested schema nodes
|
|
173
|
+
* recurse into nested schema nodes, `this.base` to reuse the built-in handler,
|
|
174
|
+
* and `this.options` to read printer options.
|
|
174
175
|
*
|
|
175
176
|
* @example Override the integer handler
|
|
176
177
|
* ```ts
|
package/dist/index.js
CHANGED
|
@@ -1117,9 +1117,9 @@ const printerFaker = ast.createPrinter((options) => {
|
|
|
1117
1117
|
})) return `get ${objectKey(property.name)}() { const _value = ${value}; Object.defineProperty(this, ${JSON.stringify(property.name)}, { value: _value, configurable: true, writable: true, enumerable: true }); return _value }`;
|
|
1118
1118
|
return `${objectKey(property.name)}: ${value}`;
|
|
1119
1119
|
}));
|
|
1120
|
-
}
|
|
1121
|
-
...options.nodes
|
|
1120
|
+
}
|
|
1122
1121
|
},
|
|
1122
|
+
overrides: options.nodes,
|
|
1123
1123
|
print(node) {
|
|
1124
1124
|
return this.transform(node) ?? null;
|
|
1125
1125
|
}
|