markmap-toolbar
Advanced tools
Comparing version 0.17.2 to 0.17.3-alpha.1
@@ -18,8 +18,5 @@ (function(exports) { | ||
let vtype; | ||
if (typeof type === "string") | ||
vtype = VTYPE_ELEMENT; | ||
else if (typeof type === "function") | ||
vtype = VTYPE_FUNCTION; | ||
else | ||
throw new Error("Invalid VNode type"); | ||
if (typeof type === "string") vtype = VTYPE_ELEMENT; | ||
else if (typeof type === "function") vtype = VTYPE_FUNCTION; | ||
else throw new Error("Invalid VNode type"); | ||
return { | ||
@@ -39,12 +36,9 @@ vtype, | ||
function insertDom(parent, nodes) { | ||
if (!Array.isArray(nodes)) | ||
nodes = [nodes]; | ||
if (!Array.isArray(nodes)) nodes = [nodes]; | ||
nodes = nodes.filter(Boolean); | ||
if (nodes.length) | ||
parent.append(...nodes); | ||
if (nodes.length) parent.append(...nodes); | ||
} | ||
function mountAttributes(domElement, props, env) { | ||
for (const key in props) { | ||
if (key === "key" || key === "children" || key === "ref") | ||
continue; | ||
if (key === "key" || key === "children" || key === "ref") continue; | ||
if (key === "dangerouslySetInnerHTML") { | ||
@@ -54,4 +48,3 @@ domElement.innerHTML = props[key].__html; | ||
const value = props[key]; | ||
if (value != null) | ||
domElement[key] = value; | ||
if (value != null) domElement[key] = value; | ||
} else if (key.startsWith("on")) { | ||
@@ -140,4 +133,3 @@ domElement[key.toLowerCase()] = props[key]; | ||
const children = mountChildren(props.children, childEnv); | ||
if (children != null) | ||
insertDom(node, children); | ||
if (children != null) insertDom(node, children); | ||
} | ||
@@ -147,4 +139,3 @@ const { | ||
} = props; | ||
if (typeof ref === "function") | ||
ref(node); | ||
if (typeof ref === "function") ref(node); | ||
return node; | ||
@@ -177,4 +168,3 @@ } | ||
return async (...args) => { | ||
if (promise) | ||
return; | ||
if (promise) return; | ||
promise = fn(...args); | ||
@@ -255,4 +245,3 @@ try { | ||
return () => { | ||
if (this.markmap) | ||
handle(this.markmap); | ||
if (this.markmap) handle(this.markmap); | ||
}; | ||
@@ -271,4 +260,3 @@ } | ||
const data = this.registry[item]; | ||
if (!data) | ||
console.warn(`[markmap-toolbar] ${item} not found`); | ||
if (!data) console.warn(`[markmap-toolbar] ${item} not found`); | ||
return data; | ||
@@ -275,0 +263,0 @@ } |
{ | ||
"name": "markmap-toolbar", | ||
"version": "0.17.2", | ||
"version": "0.17.3-alpha.1+4942a37", | ||
"description": "Extensible toolbar for markmap", | ||
@@ -39,3 +39,3 @@ "author": "Gerald <gera2ld@live.com>", | ||
"markmap-common": "0.17.1", | ||
"markmap-view": "0.17.2" | ||
"markmap-view": "0.17.3-alpha.1+4942a37" | ||
}, | ||
@@ -46,3 +46,3 @@ "dependencies": { | ||
}, | ||
"gitHead": "bbeec32d0efeea4e36755b1909a5993187264487" | ||
"gitHead": "4942a3759db08bbbc179034c0b08c5c2112566dc" | ||
} |
Sorry, the diff of this file is not supported yet
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
25512
637
1