dynamodb-raw
Advanced tools
Comparing version 1.1.1 to 1.1.2
@@ -128,7 +128,7 @@ 'use strict'; | ||
if(self.createdAt !== false) { | ||
valids[createdAtParamName] = Joi.date(); | ||
valids[createdAtParamName] = Joi.date().timestamp('unix'); | ||
} | ||
if(self.updatedAt !== false) { | ||
valids[updatedAtParamName] = Joi.date(); | ||
valids[updatedAtParamName] = Joi.date().timestamp('unix'); | ||
} | ||
@@ -135,0 +135,0 @@ |
@@ -32,7 +32,8 @@ 'use strict'; | ||
date : function (value) { | ||
if(_.isDate(value)) { | ||
return value.toISOString(); | ||
} else { | ||
return new Date(value).toISOString(); | ||
} | ||
return parseInt(value) || 0 | ||
//if(_.isDate(value)) { | ||
//return value.toISOString(); | ||
//} else { | ||
//return new Date(value).toISOString(); | ||
//} | ||
}, | ||
@@ -39,0 +40,0 @@ |
@@ -153,3 +153,4 @@ 'use strict'; | ||
if(self.schema.timestamps && self.schema.createdAt !== false && !_.has(data, paramName)) { | ||
data[paramName] = new Date().toISOString(); | ||
//data[paramName] = new Date().toISOString(); | ||
data[paramName] = +(new Date) / 1000 >>> 0; | ||
} | ||
@@ -254,3 +255,4 @@ | ||
if(self.schema.timestamps && self.schema.updatedAt !== false && !_.has(item, paramName)) { | ||
item[paramName] = new Date().toISOString(); | ||
// item[paramName] = new Date().toISOString(); | ||
item[paramName] = +(new Date) / 1000 >>> 0; | ||
} | ||
@@ -257,0 +259,0 @@ |
{ | ||
"name": "dynamodb-raw", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"contributors": [ | ||
@@ -5,0 +5,0 @@ "Ryan Fitzgerald <ryan@codebrewstudios.com>", |
Following modification made on the original [dynamodb](https://github.com/yi/dynamodb) module | ||
### Following modification made on the original [dynamodb](https://github.com/yi/dynamodb) module | ||
* return raw data rather then instance of Item/Model, for the ease of local cache | ||
* Return raw data rather then instance of Item/Model, for the ease of local cache | ||
* Change value of `DATE` data type to [Unix Epoch Time](https://en.wikipedia.org/wiki/Unix_time) | ||
* Change auto timestamps to [Unix Epoch Time](https://en.wikipedia.org/wiki/Unix_time) | ||
--- | ||
@@ -8,0 +9,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
127379
2851
1119