@easy-nest/sql2entry
Advanced tools
Comparing version 0.1.5 to 0.1.6
@@ -10,2 +10,3 @@ import { TableInterface } from 'sql-ddl-to-json-schema'; | ||
importMapping: Map<string, boolean>; | ||
skipMapping: Map<string, string[]>; | ||
mapping: Map<string, string>; | ||
@@ -21,2 +22,3 @@ objectTypeProperties: any[]; | ||
private getFn; | ||
private skipMethods; | ||
} |
@@ -21,2 +21,3 @@ "use strict"; | ||
]); | ||
this.skipMapping = new Map([['text', ['length']]]); | ||
this.mapping = new Map([['datatype', 'type']]); | ||
@@ -84,2 +85,8 @@ this.objectTypeProperties = []; | ||
} | ||
skipMethods(key, obj) { | ||
if (this.skipMapping.has(obj.datatype)) { | ||
const mappings = this.skipMapping.get(obj.datatype); | ||
return mappings.includes(key); | ||
} | ||
} | ||
} | ||
@@ -115,2 +122,5 @@ exports.GenerateEntity = GenerateEntity; | ||
Object.keys(merged).forEach((key) => { | ||
const skiped = this.skipMethods(key, merged); | ||
if (skiped) | ||
return; | ||
const $key = types.stringLiteral(this.mapping.has(key) ? this.mapping.get(key) : key); | ||
@@ -117,0 +127,0 @@ objProperties.push(types.objectProperty($key, tslib_1.__classPrivateFieldGet(this, _GenerateEntity_instances, "m", _GenerateEntity_switchValueType).call(this, merged[key], key, merged))); |
{ | ||
"name": "@easy-nest/sql2entry", | ||
"version": "0.1.5", | ||
"version": "0.1.6", | ||
"description": "mysql to entry", | ||
@@ -5,0 +5,0 @@ "keywords": [], |
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
132808
337