Comparing version 0.1.0 to 0.1.1
@@ -96,3 +96,3 @@ "use strict"; | ||
*/ | ||
async function create({title, category, image, description, keyword, label, order, content, hide, top, author, review}) { | ||
async function create({title, category, image, description, keyword, label, order, format, content, hide, top, author, review}) { | ||
//标题,分类,图片,简介,顺序,隐藏,作者 | ||
@@ -118,3 +118,4 @@ if (!isString(title, true)) { | ||
} | ||
content = await this.getContent(content, category); | ||
format = String(format); | ||
content = await this.getContent(content, format, category); | ||
hide = Boolean(hide); | ||
@@ -153,3 +154,3 @@ top = Boolean(top); | ||
*/ | ||
async function set(id, {title, category, image, description, keyword, label, order, content, hide, top, author, review}) { | ||
async function set(id, {title, category, image, description, keyword, label, order, format, content, hide, top, author, review}) { | ||
if (!(id = getId(id))) { | ||
@@ -195,3 +196,8 @@ return false; | ||
if (content) { | ||
$set.content = await this.getContent(content, category); | ||
if (typeof format === "string") { | ||
$set.format = format; | ||
} else { | ||
format = info.format; | ||
} | ||
$set.content = await this.getContent(content, format, category); | ||
} | ||
@@ -198,0 +204,0 @@ if (typeof hide === "boolean") { |
{ | ||
"name": "cmk", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "Content Management Kernel", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
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
11516
384