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

@yuheiy/childnode-ponyfill

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@yuheiy/childnode-ponyfill - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

15

lib/childnode-ponyfill.js

@@ -24,13 +24,6 @@ "use strict";

}
return nodes.reduce(function (frag, node) {
if (typeof node === 'string') {
var parser = document.createElement('div');
parser.innerHTML = node;
while (parser.firstChild) {
frag.appendChild(parser.firstChild);
}
}
else {
frag.appendChild(node);
}
return nodes.reduce(function (frag, nodeOrDomString) {
var isNode = nodeOrDomString instanceof Node;
var node = isNode ? nodeOrDomString : document.createTextNode(String(nodeOrDomString));
frag.appendChild(node);
return frag;

@@ -37,0 +30,0 @@ }, document.createDocumentFragment());

@@ -14,3 +14,3 @@ {

},
"version": "0.0.2",
"version": "0.0.3",
"main": "lib/childnode-ponyfill.js",

@@ -17,0 +17,0 @@ "types": "lib/childnode-ponyfill.d.ts",

@@ -24,12 +24,6 @@ type ImplementsOfChildNode = Element | DocumentType | CharacterData

const createDocumentFragmentFromNodes = (...nodes: /*Nodes*/Array<any>): DocumentFragment => {
return nodes.reduce((frag, node) => {
if (typeof node === 'string') {
const parser = document.createElement('div')
parser.innerHTML = node
while (parser.firstChild) {
frag.appendChild(parser.firstChild)
}
} else {
frag.appendChild(node)
}
return nodes.reduce((frag, nodeOrDomString) => {
const isNode = nodeOrDomString instanceof Node
const node = isNode ? nodeOrDomString : document.createTextNode(String(nodeOrDomString))
frag.appendChild(node)
return frag

@@ -36,0 +30,0 @@ }, document.createDocumentFragment())

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