think-model
Advanced tools
Comparing version 1.1.5 to 1.1.6
@@ -237,3 +237,3 @@ | ||
interface ModelThknkExtend { | ||
interface ModelThinkExtend { | ||
Model: Model; | ||
@@ -249,3 +249,3 @@ } | ||
declare module 'thinkjs' { | ||
interface Think extends ThinkModel.ModelExtend, ThinkModel.ModelThknkExtend {} | ||
interface Think extends ThinkModel.ModelExtend, ThinkModel.ModelThinkExtend {} | ||
interface Controller extends ThinkModel.ModelExtend {} | ||
@@ -256,2 +256,2 @@ interface Context extends ThinkModel.ModelExtend {} | ||
export = ThinkModel; | ||
export = ThinkModel; |
@@ -36,8 +36,8 @@ 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"); }); }; } | ||
db(db) { | ||
const Handle = this.config.handle; | ||
if (db) { | ||
this[DB] = db; | ||
this[DB] = new Handle(this, { query: db.query }); | ||
return this; | ||
} | ||
if (this[DB]) return this[DB]; | ||
const Handle = this.config.handle; | ||
const instance = new Handle(this); | ||
@@ -557,3 +557,3 @@ this[DB] = instance; | ||
if (helper.isEmpty(parsedData)) { | ||
return Promise.reject(new Error('update data is empty')); | ||
return Promise.reject(new Error(`update data is empty, original data is ${JSON.stringify(data)}`)); | ||
} | ||
@@ -728,7 +728,7 @@ const rows = yield _this7.db().update(parsedData, options); | ||
field.split(/\s*,\s*/).forEach(function (item) { | ||
result[item] = []; | ||
result[item] = one === true ? undefined : []; | ||
}); | ||
return result; | ||
} else { | ||
return []; | ||
return one === true ? undefined : []; | ||
} | ||
@@ -735,0 +735,0 @@ } |
{ | ||
"name": "think-model", | ||
"version": "1.1.5", | ||
"version": "1.1.6", | ||
"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
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
84575
22
3062
4