@kubb/plugin-faker 5.0.11 → 5.0.13
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/README.md +2 -2
- package/dist/index.cjs +3 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +0 -4
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
[![Node][node-src]][node-href]
|
|
11
11
|
|
|
12
12
|
<h4>
|
|
13
|
-
<a href="https://kubb.dev/plugins/faker" target="_blank">Documentation</a>
|
|
13
|
+
<a href="https://kubb.dev/plugins/plugin-faker" target="_blank">Documentation</a>
|
|
14
14
|
<span> · </span>
|
|
15
15
|
<a href="https://github.com/kubb-labs/kubb/issues/" target="_blank">Report Bug</a>
|
|
16
16
|
<span> · </span>
|
|
@@ -38,7 +38,7 @@ npm install @kubb/plugin-faker
|
|
|
38
38
|
|
|
39
39
|
## Documentation
|
|
40
40
|
|
|
41
|
-
See the [full documentation](https://kubb.dev/plugins/faker) for configuration options and examples.
|
|
41
|
+
See the [full documentation](https://kubb.dev/plugins/plugin-faker) for configuration options and examples.
|
|
42
42
|
|
|
43
43
|
## Supporting Kubb
|
|
44
44
|
|
package/dist/index.cjs
CHANGED
|
@@ -625,13 +625,13 @@ function Faker({ node, description, name, typeName, printer, canOverride }) {
|
|
|
625
625
|
Object.defineProperty(defaultFakeData, key, { value, configurable: true, writable: true, enumerable: true })
|
|
626
626
|
}
|
|
627
627
|
}
|
|
628
|
-
return defaultFakeData as Omit<typeof defaultFakeData, keyof TData
|
|
628
|
+
return defaultFakeData as Omit<typeof defaultFakeData, keyof NoInfer<TData>> & NoInfer<TData>
|
|
629
629
|
}` : `{
|
|
630
630
|
const defaultFakeData = ${fakerText}
|
|
631
631
|
return {
|
|
632
632
|
...defaultFakeData,
|
|
633
633
|
...(data || {}),
|
|
634
|
-
} as Omit<typeof defaultFakeData, keyof TData
|
|
634
|
+
} as Omit<typeof defaultFakeData, keyof NoInfer<TData>> & NoInfer<TData>
|
|
635
635
|
}`;
|
|
636
636
|
return /* @__PURE__ */ (0, kubb_jsx_jsx_runtime.jsxs)(kubb_jsx.File.Source, {
|
|
637
637
|
name,
|
|
@@ -1072,7 +1072,7 @@ const printerFaker = kubb_kit.ast.createPrinter((options) => {
|
|
|
1072
1072
|
if (this.options.schemaName && refName === this.options.schemaName) return this.options.typeName ? `undefined as unknown as ${this.options.typeName}` : "undefined as unknown";
|
|
1073
1073
|
const resolvedName = node.ref ? this.options.resolver.name(refName) : refName;
|
|
1074
1074
|
if (!this.options.nestedInObject) return `${resolvedName}(data)`;
|
|
1075
|
-
return `${resolvedName}
|
|
1075
|
+
return `${resolvedName}()`;
|
|
1076
1076
|
},
|
|
1077
1077
|
enum(node) {
|
|
1078
1078
|
return fakerKeywordMapper.enum(kubb_kit.ast.getSchemaLiteralValues(node).map(parseEnumValue), this.options.typeName);
|