Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cmk

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cmk - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

LICENSE

45

lib/index.js

@@ -18,3 +18,4 @@ "use strict";

}
})((yield this.filter([...filter]))).map(function (x) {
});
(yield this.filter([...filter])).map(function (x) {
return filters.add(x);

@@ -313,3 +314,3 @@ });

for (let i = 0, l = category.length; i < l; i++) {
category[i] = this.getCategoryId(category[i]);
category[i] = yield this.getCategoryId(category[i]);
}

@@ -320,3 +321,3 @@ condition.category = { $in: category.filter(function (x) {

} else if (category) {
condition.category = this.getCategoryId(category);
condition.category = yield this.getCategoryId(category);
}

@@ -334,27 +335,21 @@ condition.delete = Boolean(del);

}
filter = yield getFilter(filter);
console.log(filter);
filter = yield getFilter.call(this, filter);
let cursor = this.db.find(condition, filter);
console.log(filter);
let ret = [];
if (type & 1) {
cursor.sort(getSort(sort));
if (from < 0 || from !== parseInt(from) || isNaN(from) || from > 0xFFFFFFFF) {
from = 0;
}
if (length <= 0 || length !== parseInt(length) || isNaN(length) || length > 1000) {
length = 10;
}
cursor.skip(from).limit(length);
ret.push(cursor.toArray().then(function (rs) {
return Promise.all(rs.map(function (r) {
return info.call(_this, r);
}));
}));
} else {
ret.push(null);
cursor.sort(getSort(sort));
if (from < 0 || from !== parseInt(from) || isNaN(from) || from > 0xFFFFFFFF) {
from = 0;
}
if (type & 2) {
ret.push(cursor.count());
} else {
ret.push(null);
if (length <= 0 || length !== parseInt(length) || isNaN(length) || length > 1000) {
length = 10;
}
cursor.skip(from).limit(length);
ret.push(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);

@@ -428,3 +423,3 @@ return { list, num };

}
const keyfield = ["title", "category", "image", "description", "keyword", "content", "order", "review", "hide", "top", "label"];
const keyfield = ["title", "category", "image", "description", "keyword", "content", "order", "review", "hide", "top", "label", "createDate", "reviewDate", "updateDate", "reviewer", "author"];

@@ -431,0 +426,0 @@ function getSort(order) {

{
"name": "cmk",
"version": "0.0.3",
"version": "0.0.4",
"description": "Content Management Kernel",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc