vuex-orm-decorators
Advanced tools
Comparing version 2.0.0-beta.5 to 2.0.0-beta.6
@@ -17,16 +17,19 @@ import { Type } from '@vuex-orm/core'; | ||
if (typeof value === 'string') { | ||
this.value = Date.parse(value); | ||
if (this.inRange(value)) { | ||
value = new Date(parseInt(value)); | ||
} | ||
if (this.mutator) { | ||
this.value = value; | ||
} | ||
else { | ||
return Date.parse(value); | ||
} | ||
} | ||
if (typeof value === 'number') { | ||
this.value = value; | ||
} | ||
if (this.isMilliseconds(value)) { | ||
this.value = parseInt(value); | ||
} | ||
return new Date(this.value); | ||
return new Date(this.value || value); | ||
} | ||
isMilliseconds(value) { | ||
return parseInt(value).toString().length > 12; | ||
inRange(value) { | ||
const length = parseInt(value).toString().length; | ||
return length < 15 && length > 12; | ||
} | ||
} | ||
//# sourceMappingURL=DateType.js.map |
{ | ||
"name": "vuex-orm-decorators", | ||
"version": "2.0.0-beta.5", | ||
"version": "2.0.0-beta.6", | ||
"description": "Simple Typescript decorators to improve the vuex-orm experience in Typescript by introducing typed property access.", | ||
@@ -11,2 +11,3 @@ "main": "dist/index.js", | ||
"lint": "eslint . --ext .ts", | ||
"lint:report": "yarn lint --output-file eslint_report.json --format json", | ||
"test": "jest", | ||
@@ -40,3 +41,2 @@ "test:coverage": "jest --collect-coverage" | ||
"eslint-plugin-sort-keys-fix": "^1.1", | ||
"eslint-plugin-standard": "^5.0", | ||
"eslint-plugin-unused-imports": "^1.0", | ||
@@ -43,0 +43,0 @@ "jest": "^26.6", |
Sorry, the diff of this file is not supported yet
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
34387
17
327