markmap-common
Advanced tools
Comparing version 0.13.3-alpha.1 to 0.13.3-alpha.2
@@ -1,2 +0,2 @@ | ||
/*! markmap-common v0.13.3-alpha.1+f7f5075 | MIT License */ | ||
/*! markmap-common v0.13.3-alpha.2+a5a159b | MIT License */ | ||
class Hook { | ||
@@ -47,2 +47,18 @@ constructor() { | ||
function _objectWithoutPropertiesLoose(source, excluded) { | ||
if (source == null) return {}; | ||
var target = {}; | ||
var sourceKeys = Object.keys(source); | ||
var key, i; | ||
for (i = 0; i < sourceKeys.length; i++) { | ||
key = sourceKeys[i]; | ||
if (excluded.indexOf(key) >= 0) continue; | ||
target[key] = source[key]; | ||
} | ||
return target; | ||
} | ||
const _excluded = ["textContent"]; | ||
function escapeHtml(html) { | ||
@@ -83,4 +99,12 @@ return html.replace(/[&<"]/g, m => ({ | ||
return items.map(item => { | ||
if (item.type === 'script') return wrapHtml('script', '', item.data); | ||
if (item.type === 'script') { | ||
const _item$data = item.data, | ||
{ | ||
textContent | ||
} = _item$data, | ||
rest = _objectWithoutPropertiesLoose(_item$data, _excluded); | ||
return wrapHtml('script', textContent, rest); | ||
} | ||
if (item.type === 'iife') { | ||
@@ -87,0 +111,0 @@ const { |
@@ -1,2 +0,2 @@ | ||
/*! markmap-common v0.13.3-alpha.1+f7f5075 | MIT License */ | ||
/*! markmap-common v0.13.3-alpha.2+a5a159b | MIT License */ | ||
'use strict'; | ||
@@ -51,2 +51,18 @@ | ||
function _objectWithoutPropertiesLoose(source, excluded) { | ||
if (source == null) return {}; | ||
var target = {}; | ||
var sourceKeys = Object.keys(source); | ||
var key, i; | ||
for (i = 0; i < sourceKeys.length; i++) { | ||
key = sourceKeys[i]; | ||
if (excluded.indexOf(key) >= 0) continue; | ||
target[key] = source[key]; | ||
} | ||
return target; | ||
} | ||
const _excluded = ["textContent"]; | ||
function escapeHtml(html) { | ||
@@ -87,4 +103,12 @@ return html.replace(/[&<"]/g, m => ({ | ||
return items.map(item => { | ||
if (item.type === 'script') return wrapHtml('script', '', item.data); | ||
if (item.type === 'script') { | ||
const _item$data = item.data, | ||
{ | ||
textContent | ||
} = _item$data, | ||
rest = _objectWithoutPropertiesLoose(_item$data, _excluded); | ||
return wrapHtml('script', textContent, rest); | ||
} | ||
if (item.type === 'iife') { | ||
@@ -91,0 +115,0 @@ const { |
{ | ||
"name": "markmap-common", | ||
"version": "0.13.3-alpha.1+f7f5075", | ||
"version": "0.13.3-alpha.2+a5a159b", | ||
"description": "", | ||
@@ -27,3 +27,3 @@ "author": "", | ||
}, | ||
"gitHead": "f7f507547a2e1b2b1637e532a1c67d6ad0eabaf9" | ||
"gitHead": "a5a159bee156ba7c77cf952f6f0f3e450f8c12fa" | ||
} |
@@ -57,3 +57,4 @@ export interface IHierarchy<T> { | ||
data: { | ||
src: string; | ||
src?: string; | ||
textContent?: string; | ||
async?: boolean; | ||
@@ -60,0 +61,0 @@ defer?: boolean; |
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
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
22475
731