emmo-model
Advanced tools
Comparing version
@@ -122,3 +122,3 @@ "use strict"; | ||
convertDate: function(text, property) { | ||
return text ? moment(text) : null; | ||
return moment(text); | ||
}, | ||
@@ -125,0 +125,0 @@ |
@@ -295,7 +295,8 @@ "use strict"; | ||
// load models | ||
_.each(fs.readdirSync(this.config.modelsPath), function(fileName) { | ||
var config = this.config; | ||
_.each(fs.readdirSync(config.modelsPath), function(fileName) { | ||
if (/\.js$/.test(fileName)) { | ||
require(path.resolve(this.config.modelsPath, fileName)); | ||
require(path.resolve(config.modelsPath, fileName)); | ||
} | ||
}, this); | ||
}); | ||
} | ||
@@ -302,0 +303,0 @@ |
@@ -82,5 +82,9 @@ "use strict"; | ||
case 'timestamptz': | ||
value = input ? moment(value, property.dateFormat) : em.agent.convertDate(value, property); | ||
invalid = value.isValid() === false; | ||
value = value._d; | ||
if (value) { | ||
value = input ? moment(value, property.dateFormat) : em.agent.convertDate(value, property); | ||
invalid = value.isValid() === false; | ||
value = value._d; | ||
} else { | ||
value = null; | ||
} | ||
break; | ||
@@ -87,0 +91,0 @@ default: |
{ | ||
"name": "emmo-model", | ||
"version": "2.4.8", | ||
"version": "2.4.10", | ||
"description": "Flexible lightweight orm framework, supports Structure Mirroring.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
185926
0.06%4777
0.1%