domain-knex
Advanced tools
Comparing version 0.0.11 to 0.0.12
@@ -81,15 +81,16 @@ "use strict"; | ||
var type = value.type.constructor === Array ? value.type[0] : value.type; | ||
if (type.name === 'Boolean') { | ||
var hasTypeOf = function (targetType) { return type === targetType || type.prototype instanceof targetType; }; | ||
if (hasTypeOf(Boolean)) { | ||
column = table.boolean(columnName); | ||
} | ||
else if (type.name === 'Integer') { | ||
else if (hasTypeOf(domain_schema_1.default.Int)) { | ||
column = table.integer(columnName); | ||
} | ||
else if (type.name === 'Number') { | ||
else if (hasTypeOf(domain_schema_1.default.Float)) { | ||
column = table.float(columnName); | ||
} | ||
else if (type.name === 'String') { | ||
else if (hasTypeOf(String)) { | ||
column = table.string(columnName, value.max || undefined); | ||
} | ||
else if (type.name === 'Date') { | ||
else if (hasTypeOf(Date)) { | ||
column = table.dateTime(columnName); | ||
@@ -96,0 +97,0 @@ } |
{ | ||
"name": "domain-knex", | ||
"version": "0.0.11", | ||
"version": "0.0.12", | ||
"description": "Knex generator for Domain Schema", | ||
@@ -53,3 +53,3 @@ "repository": "https://github.com/sysgears/domain-schema.git", | ||
}, | ||
"testRegex": "(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$", | ||
"testRegex": "(/__tests__/.*\\.(test|spec))\\.(ts|tsx|js)$", | ||
"moduleFileExtensions": [ | ||
@@ -56,0 +56,0 @@ "ts", |
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
21085
219