Comparing version 0.0.4 to 0.0.5
@@ -312,10 +312,9 @@ "use strict"; | ||
if (category instanceof Array) { | ||
for (let i = 0, l = category.length; i < l; i++) { | ||
category[i] = yield this.getCategoryId(category[i]); | ||
} | ||
condition.category = { $in: category.filter(function (x) { | ||
condition.category = { $in: (yield Promise.all(category.map(function (c) { | ||
return _this.getCategoryId(c); | ||
}))).filter(function (x) { | ||
return x; | ||
}) }; | ||
} else if (category) { | ||
condition.category = yield this.getCategoryId(category); | ||
} else if (category && (category = yield this.getCategoryId(category))) { | ||
condition.category = category; | ||
} | ||
@@ -346,10 +345,10 @@ condition.delete = Boolean(del); | ||
cursor.skip(from).limit(length); | ||
ret.push(cursor.toArray().then(function (rs) { | ||
let list = cursor.toArray().then(function (rs) { | ||
return Promise.all(rs.map(function (r) { | ||
return info.call(_this, r); | ||
})); | ||
})); | ||
ret.push(cursor.count()); | ||
let [list, num] = yield Promise.all(ret); | ||
return { list, num }; | ||
}); | ||
let total = cursor.count(); | ||
[list, total] = yield Promise.all([list, total]); | ||
return { list, total }; | ||
}); | ||
@@ -356,0 +355,0 @@ |
{ | ||
"name": "cmk", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"description": "Content Management Kernel", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
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
26397
493