MCPcopy Create free account
hub / github.com/WebReflection/neverland / persistent

Function persistent

index.js:652–676  ·  view source on GitHub ↗
(fragment)

Source from the content-addressed store, hash-verified

650 return node.nodeType === nodeType ? 1 / operation < 0 ? operation ? remove(node) : node.lastChild : operation ? node.valueOf() : node.firstChild : node;
651 };
652 var persistent = function persistent(fragment) {
653 var childNodes = fragment.childNodes;
654 var length = childNodes.length;
655 if (length < 2) return length ? childNodes[0] : fragment;
656 var nodes = slice.call(childNodes, 0);
657 var firstChild = nodes[0];
658 var lastChild = nodes[length - 1];
659 return {
660 ELEMENT_NODE: ELEMENT_NODE$1,
661 nodeType: nodeType,
662 firstChild: firstChild,
663 lastChild: lastChild,
664 valueOf: function valueOf() {
665 if (childNodes.length !== length) {
666 var i = 0;
667
668 while (i < length) {
669 fragment.appendChild(nodes[i++]);
670 }
671 }
672
673 return fragment;
674 }
675 };
676 };
677
678 /*! (c) Andrea Giammarchi - ISC */
679 var createContent = function (document) {

Callers 1

unrollFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected