@oridune/epic-odm
Advanced tools
Comparing version 1.0.45 to 1.0.46
{ | ||
"name": "@oridune/epic-odm", | ||
"version": "1.0.45", | ||
"version": "1.0.46", | ||
"description": "Install 1 ODM and code once with any database driver.", | ||
@@ -5,0 +5,0 @@ "main": "./src/index.js", |
@@ -45,5 +45,9 @@ "use strict"; | ||
// Append Default Value | ||
if (ModelOptions.fields[Key].options.default !== undefined) | ||
if (ModelOptions.fields[Key].options.default !== undefined) { | ||
const DefaultValue = ModelOptions.fields[Key].options.default; | ||
Item[Key] = | ||
(_c = Item[Key]) !== null && _c !== void 0 ? _c : ModelOptions.fields[Key].options.default; | ||
((_c = Item[Key]) !== null && _c !== void 0 ? _c : typeof DefaultValue === "function") | ||
? await DefaultValue(Item) | ||
: DefaultValue; | ||
} | ||
if (options.fieldsList[Key] === 1 && Item[Key] !== undefined) | ||
@@ -50,0 +54,0 @@ ValidatedItem[Key] = await ModelOptions.fields[Key].options.validator(Item[Key], ValidatedItem, options.mode); |
111846
2244