think-model
Advanced tools
Comparing version 1.3.5 to 1.4.0
@@ -436,3 +436,6 @@ function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } | ||
if (helper.isEmpty(parsedData)) return Promise.reject(new Error('add data is empty')); | ||
const lastInsertId = yield _this2.db().add(parsedData, options, replace); | ||
if (replace) { | ||
options.replace = replace; | ||
} | ||
const lastInsertId = yield _this2.db().add(parsedData, options); | ||
const copyData = Object.assign({}, data, parsedData, { [_this2.pk]: lastInsertId }); | ||
@@ -505,3 +508,6 @@ yield _this2.afterAdd(copyData, options); | ||
data = yield Promise.all(promises); | ||
const insertIds = yield _this5.db().addMany(data, options, replace); | ||
if (replace) { | ||
options.replace = replace; | ||
} | ||
const insertIds = yield _this5.db().addMany(data, options); | ||
promises = data.map(function (item, i) { | ||
@@ -632,3 +638,4 @@ item[_this5.pk] = insertIds[i]; | ||
if (!fields) { | ||
fields = yield _this10.db().getSchema(); | ||
const schema = yield _this10.db().getSchema(); | ||
fields = Object.keys(schema); | ||
} | ||
@@ -635,0 +642,0 @@ return _this10.db().selectAdd(fields, data[0].table, data[1]); |
{ | ||
"name": "think-model", | ||
"version": "1.3.5", | ||
"version": "1.4.0", | ||
"description": "An adapter-based ORM 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
96054
3416