@famgia/omnify-laravel 0.0.81 → 0.0.82
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/{chunk-WFEVU3LX.js → chunk-FCTB4WKW.js} +14 -2
- package/dist/{chunk-WFEVU3LX.js.map → chunk-FCTB4WKW.js.map} +1 -1
- package/dist/index.cjs +13 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/plugin.cjs +13 -1
- package/dist/plugin.cjs.map +1 -1
- package/dist/plugin.js +1 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
package/dist/plugin.cjs
CHANGED
|
@@ -3312,6 +3312,17 @@ function getModuleName2(schema) {
|
|
|
3312
3312
|
}
|
|
3313
3313
|
return "";
|
|
3314
3314
|
}
|
|
3315
|
+
function getFieldExpression(fieldName, propDef) {
|
|
3316
|
+
switch (propDef.type) {
|
|
3317
|
+
case "Date":
|
|
3318
|
+
return `$this->${fieldName}?->toDateString()`;
|
|
3319
|
+
case "DateTime":
|
|
3320
|
+
case "Timestamp":
|
|
3321
|
+
return `$this->${fieldName}?->toISOString()`;
|
|
3322
|
+
default:
|
|
3323
|
+
return `$this->${fieldName}`;
|
|
3324
|
+
}
|
|
3325
|
+
}
|
|
3315
3326
|
function getPropertyOutput(propName, propDef, schemas, options) {
|
|
3316
3327
|
const snakeName = toSnakeCase(propName);
|
|
3317
3328
|
const lines = [];
|
|
@@ -3358,7 +3369,8 @@ function getPropertyOutput(propName, propDef, schemas, options) {
|
|
|
3358
3369
|
}
|
|
3359
3370
|
return lines;
|
|
3360
3371
|
}
|
|
3361
|
-
|
|
3372
|
+
const expression = getFieldExpression(snakeName, propDef);
|
|
3373
|
+
lines.push(` '${snakeName}' => ${expression},`);
|
|
3362
3374
|
return lines;
|
|
3363
3375
|
}
|
|
3364
3376
|
function generateResourceBase(schema, schemas, options) {
|