Comparing version 2.5.0 to 2.6.0
@@ -16,3 +16,3 @@ /* UNIQORM | ||
const DATE_PATTERN = /^(19[0-9]{2}|2[0-9]{3})-(0[1-9]|1[012])-([123]0|[012][1-9]|31)(?:[ T]([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])(?:\.(\d{1,6}))?)?$/; | ||
const TIMESTAMP_PATTERN = /^(19[0-9]{2}|2[0-9]{3})-?(0[1-9]|1[012])-?([123]0|[012][1-9]|31)(?:[ T]([01][0-9]|2[0-3]):?([0-5][0-9]):?([0-5][0-9])(?:\.(\d{1,6}))?)?$/; | ||
@@ -56,5 +56,5 @@ /** | ||
return value; | ||
if (isNumeric(value)) | ||
if (typeof value === 'number') | ||
return new Date(value); | ||
const m = String(value).match(DATE_PATTERN); | ||
const m = String(value).match(TIMESTAMP_PATTERN); | ||
if (!m) | ||
@@ -75,6 +75,2 @@ throw new ArgumentError('"%s" is not a valid date format', String(value)); | ||
function isNumeric(n) { | ||
return !isNaN(parseFloat(n)) && isFinite(n); | ||
} | ||
/** | ||
@@ -81,0 +77,0 @@ * Expose `TIMESTAMP`. |
@@ -31,2 +31,3 @@ /* UNIQORM | ||
DataField.register(require('./fields/TIMESTAMP')); | ||
DataField.register(require('./fields/TIMESTAMPTZ')); | ||
DataField.register(require('./fields/TIME')); | ||
@@ -33,0 +34,0 @@ DataField.register(require('./fields/CLOB')); |
{ | ||
"name": "uniqorm", | ||
"description": "Multi dialect and multi schema ORM framework for enterprise level NodeJS applications", | ||
"version": "2.5.0", | ||
"version": "2.6.0", | ||
"author": "Panates Ltd.", | ||
@@ -31,3 +31,3 @@ "contributors": [ | ||
"babel-eslint": "^10.0.1", | ||
"eslint": "^5.9.0", | ||
"eslint": "^5.10.0", | ||
"eslint-config-google": "^0.11.0", | ||
@@ -34,0 +34,0 @@ "mocha": "^5.2.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
85882
31
2808