@kubb/plugin-faker 5.3.1 → 5.3.2
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 +6 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +6 -2
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1027,7 +1027,11 @@ const printerFaker = ast.createPrinter((options) => {
|
|
|
1027
1027
|
integer: (node) => numberCall("int", node.min, node.max),
|
|
1028
1028
|
bigint: () => "faker.number.bigInt()",
|
|
1029
1029
|
blob: () => "faker.image.url() as unknown as Blob",
|
|
1030
|
-
datetime
|
|
1030
|
+
datetime(node) {
|
|
1031
|
+
const parser = this.options.dateParser ?? "faker";
|
|
1032
|
+
if (parser === "faker") return "faker.date.anytime().toISOString()";
|
|
1033
|
+
return `${parser}(faker.date.anytime()).format("${node.local ? "YYYY-MM-DDTHH:mm:ss" : node.offset ? "YYYY-MM-DDTHH:mm:ssZ" : "YYYY-MM-DDTHH:mm:ss[Z]"}")`;
|
|
1034
|
+
},
|
|
1031
1035
|
date(node) {
|
|
1032
1036
|
return dateTimeCall(node.representation ?? "string", {
|
|
1033
1037
|
format: "YYYY-MM-DD",
|
|
@@ -1493,7 +1497,7 @@ var compatibility = {
|
|
|
1493
1497
|
"node": ">=22.22"
|
|
1494
1498
|
};
|
|
1495
1499
|
// package.json
|
|
1496
|
-
var version = "5.3.
|
|
1500
|
+
var version = "5.3.2";
|
|
1497
1501
|
// src/resolvers/resolverFaker.ts
|
|
1498
1502
|
/**
|
|
1499
1503
|
* Default resolver used by `@kubb/plugin-faker`. Decides the names and file
|