think-model-abstract
Advanced tools
Comparing version 1.4.0 to 1.4.2
@@ -92,15 +92,16 @@ const helper = require('think-helper'); | ||
const parser = this.parser; | ||
const fields = Object.keys(data[0]).map(item => parser.parseKey(item)); | ||
let fields = Object.keys(data[0]); | ||
const values = data.map(item => { | ||
const value = []; | ||
for (const key in item) { | ||
let val = item[key]; | ||
val = parser.parseValue(val); | ||
fields.forEach(key => { | ||
const val = parser.parseValue(item[key]); | ||
if (helper.isString(val) || helper.isBoolean(val) || helper.isNumber(val)) { | ||
value.push(val); | ||
} | ||
} | ||
}); | ||
return `(${value.join(',')})`; | ||
}).join(','); | ||
fields = fields.map(field => parser.parseKey(field)); | ||
// compatiable with boolean and array update property value | ||
@@ -107,0 +108,0 @@ if (options.update === true) { |
{ | ||
"name": "think-model-abstract", | ||
"version": "1.4.0", | ||
"version": "1.4.2", | ||
"description": "Abstract adapter for ThinkJS 3.x", | ||
@@ -5,0 +5,0 @@ "scripts": { |
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
86710