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

skatejs-named-slots

Package Overview
Dependencies
Maintainers
4
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

skatejs-named-slots - npm Package Compare versions

Comparing version 0.2.8 to 0.2.9

src/util/pseudo-array-to-array.js

22

dist/index.js

@@ -199,2 +199,6 @@ (function (global, factory) {

var pseudoArrayToArray = (function (pseudoArray) {
return Array.prototype.slice.call(pseudoArray);
})
var version = '0.0.1';

@@ -299,12 +303,2 @@

var toConsumableArray = function (arr) {
if (Array.isArray(arr)) {
for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];
return arr2;
} else {
return Array.from(arr);
}
};
var arrProto = Array.prototype;

@@ -585,4 +579,4 @@ var forEach = arrProto.forEach;

// possible for WebKit.
if (!canPatchNativeAccessors && !slot.childNodes.push) {
staticProp(slot, 'childNodes', [].concat(toConsumableArray(slot.childNodes)));
if (!canPatchNativeAccessors && !Array.isArray(slot.childNodes)) {
staticProp(slot, 'childNodes', pseudoArrayToArray(slot.childNodes));
}

@@ -697,4 +691,4 @@

// Ensure childNodes is patched so we can manually update it for WebKit.
if (!canPatchNativeAccessors && !host.childNodes.push) {
staticProp(host, 'childNodes', [].concat(toConsumableArray(host.childNodes)));
if (!canPatchNativeAccessors && !Array.isArray(host.childNodes)) {
staticProp(host, 'childNodes', pseudoArrayToArray(host.childNodes));
}

@@ -701,0 +695,0 @@

@@ -1,2 +0,2 @@

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(e.skatejsNamedSlots=e.skatejsNamedSlots||{})}(this,function(e){function t(e,t){if(e)for(var n=e.childNodes,r=n.length,i=0;i<r;i++){var o=t(n[i],i,n);if("undefined"!=typeof o)return o}}function n(e,t){if(e instanceof DocumentFragment)for(var n=e.childNodes,r=n.length,i=0;i<r;i++)t(n[i],i);else t(e,0)}function r(e,t){for(var n=void 0;e&&!(n=Object.getOwnPropertyDescriptor(e,t));)e=Object.getPrototypeOf(e);return n}function i(e,t){e instanceof Node&&(e=B);var n=r(e,t);if(n){var i=n.get,o=n.set,s={configurable:!0,enumerable:!0};if(i)return s.get=i,s.set=o,s;if("function"==typeof e[t])return s.value=e[t],s}var u=Object.getOwnPropertyDescriptor(e,t);if(u&&u.get)return u}function o(e,t){return t={exports:{}},e(t,t.exports),t.exports}function s(e){return e.textContent.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function u(e){return e.text||"<!--"+e.textContent+"-->"}function a(e){return"SLOT"===e.tagName}function l(e){var t=arguments.length<=1||void 0===arguments[1]?[]:arguments[1],n=e.childNodes;if(!n||e.nodeType!==Node.ELEMENT_NODE)return t;for(var r=n.length,i=0;i<r;i++){var o=n[i];a(o)&&t.push(o),l(o,t)}return t}function d(e){return"_SHADOW_ROOT_"===e.tagName}function c(e){var t=document.createElement("div");if(R)return t.__innerHTML=e,t;for(var n=pe.parseFromString("<div>"+e+"</div>","text/html").body.firstChild;n.hasChildNodes();){var r=n.firstChild;n.removeChild(r),t.appendChild(r)}return document.importNode(t,!0)}function f(e,t,n){Object.defineProperty(e,t,{configurable:!0,get:function(){return n}})}function h(e){return this[e]}function p(e){return e.item=h,e}function v(e){return!!ue.get(e)}function _(e){return v(e)?"host":a(e)?"slot":d(e)?"root":"node"}function g(e,t){for(;e&&e!==document;){if(t(e))return e;e=e.parentNode}}function m(e){return e.getAttribute&&e.getAttribute("name")||"default"}function N(e){return e.getAttribute&&e.getAttribute("slot")||"default"}function C(e,t,n){if((3!==t.nodeType||!t.textContent||0!==t.textContent.trim().length)&&ie.indexOf(t.nodeType)!==-1){var r=e.assignedNodes(),i=0===r.length,o=r.indexOf(n);de.set(t,e),i&&U.call(e.childNodes,function(t){return e.__removeChild(t)}),o>-1?(e.__insertBefore(t,void 0!==n?n:null),r.splice(o,0,t)):(e.__appendChild(t),r.push(t)),e.____triggerSlotChangeEvent()}}function y(e){var t=e.assignedSlot;if(t){var n=t.assignedNodes(),r=n.indexOf(e);if(r>-1){var i=1===n.length;n.splice(r,1),de.set(e,null),t.__removeChild(e),i&&U.call(t.childNodes,function(e){return t.__appendChild(e)}),t.____triggerSlotChangeEvent()}}}function b(e,t){for(var n=e.childNodes,r=n.length,i=0;i<r;i++)if(n[i]===t)return i;return-1}function E(e,t,r,i){var o=b(e,r);n(t,function(t,n){i(t,n),R?le.set(t,e):f(t,"parentNode",e),o>-1?Q.splice.call(e.childNodes,o+n,0,t):Q.push.call(e.childNodes,t)})}function w(e,t,n){var r=b(e,t);r>-1&&(n(t,0),R?le.set(t,null):f(t,"parentNode",null),Q.splice.call(e.childNodes,r,1))}function O(e,t,n){E(e,t,n,function(t){e.__insertBefore(t,void 0!==n?n:null)})}function T(e,t,n){E(e,t,n,function(t){var r=ue.get(e),i=fe.get(r),o=i[N(t)];o&&C(o,t,n)})}function x(e,n){var r=m(n);R||n.childNodes.push||f(n,"childNodes",[].concat(K(n.childNodes))),fe.get(e)[r]=n,he.has(n)||he.set(n,e),t(ce.get(e),function(e){e.assignedSlot||r!==N(e)||C(n,e)})}function M(e,t,r){n(t,function(t){if(a(t))x(e,t);else{var n=l(t);if(n)for(var r=n.length,i=0;i<r;i++)x(e,n[i])}}),O(e,t,r)}function L(e,t,n){var r=0===e.assignedNodes().length;E(e,t,n,function(t){r&&e.__insertBefore(t,void 0!==n?n:null)})}function j(e,t){var n=0===e.assignedNodes().length;w(e,t,function(){n&&e.__removeChild(t)})}function S(e,t){w(e,t,function(){e.__removeChild(t)})}function P(e,t){w(e,t,function(){y(t)})}function k(e,t){t.assignedNodes().forEach(y),delete fe.get(e)[m(t)],he["delete"](t)}function D(e,t){w(e,t,function(){if(a(t))k(e,t);else{var n=l(t);if(n)for(var r=0;r<n.length;r++)k(e,n[r])}e.__removeChild(t)})}function A(e){if(d(e))return e;if(e.parentNode)return A(e.parentNode)}function W(e,t,n){var r=_(e),i=t.parentNode,o=A(e);return R||e.childNodes.push||f(e,"childNodes",[].concat(K(e.childNodes))),o&&"slot"===_(t)&&x(o,t),i&&"host"===_(i)&&(R?le.set(t,null):f(t,"parentNode",null)),"node"===r?R?(le.set(t,e),e.__insertBefore(t,void 0!==n?n:null)):O(e,t,n):"slot"===r?L(e,t,n):"host"===r?T(e,t,n):"root"===r?M(e,t,n):void 0}function H(e){if(R&&"slot"===_(e)&&e.__childNodes.length!==e.childNodes.length){for(;e.hasChildNodes();)e.removeChild(e.firstChild);U.call(e.__childNodes,function(t){return e.appendChild(t)})}}var B=document.createElement("div"),F=i(Element.prototype,"innerHTML"),R=!!F,G=o(function(e){function t(){return(new Date).getTime()}e.exports=Date.now||t}),I=G&&"object"==typeof G&&"default"in G?G["default"]:G,V=o(function(e){var t=I;e.exports=function(e,n,r){function i(){var d=t()-a;d<n&&d>0?o=setTimeout(i,n-d):(o=null,r||(l=e.apply(u,s),o||(u=s=null)))}var o,s,u,a,l;return null==n&&(n=100),function(){u=this,s=arguments,a=t();var d=r&&!o;return o||(o=setTimeout(i,n)),d&&(l=e.apply(u,s),u=s=null),l}}}),X=V&&"object"==typeof V&&"default"in V?V["default"]:V,Y="0.0.1";"undefined"==typeof WeakMap&&!function(){var e=Object.defineProperty,t=Date.now()%1e9,n=function(){this.name="__st"+(1e9*Math.random()>>>0)+(t++ +"__")};n.prototype={set:function(t,n){var r=t[this.name];return r&&r[0]===t?r[1]=n:e(t,this.name,{value:[t,n],writable:!0}),this},get:function(e){var t;return(t=e[this.name])&&t[0]===e?t[1]:void 0},"delete":function(e){var t=e[this.name];return!(!t||t[0]!==e)&&(t[0]=t[1]=void 0,!0)},has:function(e){var t=e[this.name];return!!t&&t[0]===e}},window.WeakMap=n}();try{var q=new window.CustomEvent("test",{bubbles:!1,cancelable:!0,detail:{x:"y"}});if(q.preventDefault(),q.defaultPrevented!==!0)throw new Error("Could not prevent default")}catch(z){var J=function(e,t){var n;t=t||{bubbles:!1,cancelable:!1,detail:void 0},n=document.createEvent("CustomEvent"),n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail);var r=n.preventDefault;return n.preventDefault=function(){r.call(this);try{Object.defineProperty(this,"defaultPrevented",{get:function(){return!0}})}catch(e){this.defaultPrevented=!0}},n};J.prototype=window.Event.prototype,window.CustomEvent=J}var K=function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)},Q=Array.prototype,U=Q.forEach,Z="_shadow_root_",$=["childNodes","parentNode"],ee=["textContent"],te=["assignedSlot"],ne=["textContent"],re=[],ie=[Node.ELEMENT_NODE,Node.TEXT_NODE],oe=new WeakMap,se=new WeakMap,ue=new WeakMap,ae=new WeakMap,le=new WeakMap,de=new WeakMap,ce=new WeakMap,fe=new WeakMap,he=new WeakMap,pe=new DOMParser,ve={____assignedNodes:{get:function(){return this.______assignedNodes||(this.______assignedNodes=[])}},____isInFallbackMode:{get:function(){return 0===this.assignedNodes().length}},____slotChangeListeners:{get:function(){return"undefined"==typeof this.______slotChangeListeners&&(this.______slotChangeListeners=0),this.______slotChangeListeners},set:function(e){this.______slotChangeListeners=e}},____triggerSlotChangeEvent:{value:X(function(){this.____slotChangeListeners&&this.dispatchEvent(new CustomEvent("slotchange",{bubbles:!1,cancelable:!1}))})},addEventListener:{value:function(e,t,n){return"slotchange"===e&&a(this)&&this.____slotChangeListeners++,this.__addEventListener(e,t,n)}},appendChild:{value:function(e){return W(this,e),e}},assignedSlot:{get:function(){var e=de.get(this);if(!e)return null;var t=he.get(e),n=ce.get(t),r=se.get(n);return"open"===r?e:null}},attachShadow:{value:function(e){var t=this,n=e&&e.mode;if("closed"!==n&&"open"!==n)throw new Error('You must specify { mode } as "open" or "closed" to attachShadow().');var r=ue.get(this);if(r)return r;var i=p([].slice.call(this.childNodes)),o=document.createElement(e.polyfillShadowRootTagName||Z);return se.set(this,n),ue.set(this,o),ce.set(o,this),fe.set(o,{}),R?ae.set(this,i):f(this,"childNodes",i),i.forEach(function(e){t.__removeChild(e),R?le.set(e,t):f(e,"parentNode",t)}),this.__appendChild(o)}},childElementCount:{get:function(){return this.children.length}},childNodes:{get:function(){if(R&&"node"===_(this))return this.__childNodes;var e=ae.get(this);return e||ae.set(this,e=p([])),e}},children:{get:function(){var e=[];return t(this,function(t){1===t.nodeType&&e.push(t)}),p(e)}},firstChild:{get:function(){return this.childNodes[0]||null}},firstElementChild:{get:function(){return this.children[0]||null}},assignedNodes:{value:function(){if(a(this)){var e=oe.get(this);return e||oe.set(this,e=[]),e}}},hasChildNodes:{value:function(){return this.childNodes.length>0}},innerHTML:{get:function(){var e="",n=function(e){return e.outerHTML},r={1:n,3:s,8:u};return t(this,function(t){var i=r[t.nodeType]||n;e+=i(t)}),e},set:function(e){for(var t=c(e);this.hasChildNodes();)this.removeChild(this.firstChild);var n=l(t);for(U.call(n,function(e){return H(e)});t.hasChildNodes();){var r=t.firstChild;t.removeChild(r),this.appendChild(r)}}},insertBefore:{value:function(e,t){return W(this,e,t),e}},lastChild:{get:function(){var e=this.childNodes;return e[e.length-1]||null}},lastElementChild:{get:function(){var e=this.children;return e[e.length-1]||null}},name:{get:function(){return this.getAttribute("name")},set:function(e){return this.setAttribute("name",e)}},nextSibling:{get:function(){var e=this;return t(this.parentNode,function(t,n,r){if(e===t)return r[n+1]||null})}},nextElementSibling:{get:function(){var e=this,n=void 0;return t(this.parentNode,function(t){return n&&1===t.nodeType?t:void(e===t&&(n=!0))})}},outerHTML:{get:function(){var e=this.tagName.toLowerCase(),t=Array.prototype.slice.call(this.attributes).map(function(e){return" "+e.name+(e.value?'="'+e.value+'"':"")}).join("");return"<"+e+t+">"+this.innerHTML+"</"+e+">"},set:function(e){if(this.parentNode){var t=c(e);this.parentNode.replaceChild(t.firstChild,this)}else{if(!R)throw new Error("Failed to set the 'outerHTML' property on 'Element': This element has no parent node.");this.__outerHTML=e}}},parentElement:{get:function(){return g(this.parentNode,function(e){return 1===e.nodeType})}},parentNode:{get:function(){return le.get(this)||this.__parentNode||null}},previousSibling:{get:function(){var e=this;return t(this.parentNode,function(t,n,r){if(e===t)return r[n-1]||null})}},previousElementSibling:{get:function(){var e=this,n=void 0;return t(this.parentNode,function(t){return n&&e===t?n:void(1===t.nodeType&&(n=t))})}},removeChild:{value:function(e){var t=_(this);switch(t){case"node":if(R)return le.set(e,null),this.__removeChild(e);S(this,e);break;case"slot":j(this,e);break;case"host":P(this,e);break;case"root":D(this,e)}return e}},removeEventListener:{value:function(e,t,n){return"slotchange"===e&&this.____slotChangeListeners&&a(this)&&this.____slotChangeListeners--,this.__removeEventListener(e,t,n)}},replaceChild:{value:function(e,t){return this.insertBefore(e,t),this.removeChild(t)}},shadowRoot:{get:function(){return"open"===se.get(this)?ue.get(this):null}},textContent:{get:function(){var e="";return t(this,function(t){t.nodeType!==Node.COMMENT_NODE&&(e+=t.textContent)}),e},set:function(e){for(;this.hasChildNodes();)this.removeChild(this.firstChild);e&&this.appendChild(document.createTextNode(e))}}};"attachShadow"in document.createElement("div")||!function(){var e=Comment.prototype,t=HTMLElement.prototype,n=SVGElement.prototype,r=Text.prototype,o=document.createTextNode(""),s=document.createComment("");Object.keys(ve).forEach(function(u){var a=ve[u];if(a.configurable=!0,a.hasOwnProperty("value")&&(a.writable=!0),R||$.indexOf(u)===-1){var l=i(t,u),d=i(r,u),c=i(e,u),f=u in o&&ee.indexOf(u)===-1||~te.indexOf(u),h=u in s&&ne.indexOf(u)===-1||~re.indexOf(u),p="__"+u;Object.defineProperty(t,u,a),Object.defineProperty(n,u,a),l&&Object.defineProperty(t,p,l),f&&Object.defineProperty(r,u,a),f&&d&&Object.defineProperty(r,p,d),h&&Object.defineProperty(e,u,a),h&&c&&Object.defineProperty(e,p,c)}})}(),e["default"]=Y,Object.defineProperty(e,"__esModule",{value:!0})});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(e.skatejsNamedSlots=e.skatejsNamedSlots||{})}(this,function(e){function t(e,t){if(e)for(var n=e.childNodes,i=n.length,r=0;r<i;r++){var o=t(n[r],r,n);if("undefined"!=typeof o)return o}}function n(e,t){if(e instanceof DocumentFragment)for(var n=e.childNodes,i=n.length,r=0;r<i;r++)t(n[r],r);else t(e,0)}function i(e,t){for(var n=void 0;e&&!(n=Object.getOwnPropertyDescriptor(e,t));)e=Object.getPrototypeOf(e);return n}function r(e,t){e instanceof Node&&(e=B);var n=i(e,t);if(n){var r=n.get,o=n.set,s={configurable:!0,enumerable:!0};if(r)return s.get=r,s.set=o,s;if("function"==typeof e[t])return s.value=e[t],s}var u=Object.getOwnPropertyDescriptor(e,t);if(u&&u.get)return u}function o(e,t){return t={exports:{}},e(t,t.exports),t.exports}function s(e){return e.textContent.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function u(e){return e.text||"<!--"+e.textContent+"-->"}function a(e){return"SLOT"===e.tagName}function l(e){var t=arguments.length<=1||void 0===arguments[1]?[]:arguments[1],n=e.childNodes;if(!n||e.nodeType!==Node.ELEMENT_NODE)return t;for(var i=n.length,r=0;r<i;r++){var o=n[r];a(o)&&t.push(o),l(o,t)}return t}function d(e){return"_SHADOW_ROOT_"===e.tagName}function c(e){var t=document.createElement("div");if(R)return t.__innerHTML=e,t;for(var n=pe.parseFromString("<div>"+e+"</div>","text/html").body.firstChild;n.hasChildNodes();){var i=n.firstChild;n.removeChild(i),t.appendChild(i)}return document.importNode(t,!0)}function f(e,t,n){Object.defineProperty(e,t,{configurable:!0,get:function(){return n}})}function h(e){return this[e]}function p(e){return e.item=h,e}function v(e){return!!ue.get(e)}function _(e){return v(e)?"host":a(e)?"slot":d(e)?"root":"node"}function g(e,t){for(;e&&e!==document;){if(t(e))return e;e=e.parentNode}}function m(e){return e.getAttribute&&e.getAttribute("name")||"default"}function N(e){return e.getAttribute&&e.getAttribute("slot")||"default"}function C(e,t,n){if((3!==t.nodeType||!t.textContent||0!==t.textContent.trim().length)&&re.indexOf(t.nodeType)!==-1){var i=e.assignedNodes(),r=0===i.length,o=i.indexOf(n);de.set(t,e),r&&U.call(e.childNodes,function(t){return e.__removeChild(t)}),o>-1?(e.__insertBefore(t,void 0!==n?n:null),i.splice(o,0,t)):(e.__appendChild(t),i.push(t)),e.____triggerSlotChangeEvent()}}function y(e){var t=e.assignedSlot;if(t){var n=t.assignedNodes(),i=n.indexOf(e);if(i>-1){var r=1===n.length;n.splice(i,1),de.set(e,null),t.__removeChild(e),r&&U.call(t.childNodes,function(e){return t.__appendChild(e)}),t.____triggerSlotChangeEvent()}}}function b(e,t){for(var n=e.childNodes,i=n.length,r=0;r<i;r++)if(n[r]===t)return r;return-1}function E(e,t,i,r){var o=b(e,i);n(t,function(t,n){r(t,n),R?le.set(t,e):f(t,"parentNode",e),o>-1?Q.splice.call(e.childNodes,o+n,0,t):Q.push.call(e.childNodes,t)})}function w(e,t,n){var i=b(e,t);i>-1&&(n(t,0),R?le.set(t,null):f(t,"parentNode",null),Q.splice.call(e.childNodes,i,1))}function O(e,t,n){E(e,t,n,function(t){e.__insertBefore(t,void 0!==n?n:null)})}function T(e,t,n){E(e,t,n,function(t){var i=ue.get(e),r=fe.get(i),o=r[N(t)];o&&C(o,t,n)})}function x(e,n){var i=m(n);R||Array.isArray(n.childNodes)||f(n,"childNodes",Y(n.childNodes)),fe.get(e)[i]=n,he.has(n)||he.set(n,e),t(ce.get(e),function(e){e.assignedSlot||i!==N(e)||C(n,e)})}function M(e,t,i){n(t,function(t){if(a(t))x(e,t);else{var n=l(t);if(n)for(var i=n.length,r=0;r<i;r++)x(e,n[r])}}),O(e,t,i)}function L(e,t,n){var i=0===e.assignedNodes().length;E(e,t,n,function(t){i&&e.__insertBefore(t,void 0!==n?n:null)})}function j(e,t){var n=0===e.assignedNodes().length;w(e,t,function(){n&&e.__removeChild(t)})}function S(e,t){w(e,t,function(){e.__removeChild(t)})}function P(e,t){w(e,t,function(){y(t)})}function k(e,t){t.assignedNodes().forEach(y),delete fe.get(e)[m(t)],he["delete"](t)}function D(e,t){w(e,t,function(){if(a(t))k(e,t);else{var n=l(t);if(n)for(var i=0;i<n.length;i++)k(e,n[i])}e.__removeChild(t)})}function A(e){if(d(e))return e;if(e.parentNode)return A(e.parentNode)}function W(e,t,n){var i=_(e),r=t.parentNode,o=A(e);return R||Array.isArray(e.childNodes)||f(e,"childNodes",Y(e.childNodes)),o&&"slot"===_(t)&&x(o,t),r&&"host"===_(r)&&(R?le.set(t,null):f(t,"parentNode",null)),"node"===i?R?(le.set(t,e),e.__insertBefore(t,void 0!==n?n:null)):O(e,t,n):"slot"===i?L(e,t,n):"host"===i?T(e,t,n):"root"===i?M(e,t,n):void 0}function H(e){if(R&&"slot"===_(e)&&e.__childNodes.length!==e.childNodes.length){for(;e.hasChildNodes();)e.removeChild(e.firstChild);U.call(e.__childNodes,function(t){return e.appendChild(t)})}}var B=document.createElement("div"),F=r(Element.prototype,"innerHTML"),R=!!F,G=o(function(e){function t(){return(new Date).getTime()}e.exports=Date.now||t}),I=G&&"object"==typeof G&&"default"in G?G["default"]:G,V=o(function(e){var t=I;e.exports=function(e,n,i){function r(){var d=t()-a;d<n&&d>0?o=setTimeout(r,n-d):(o=null,i||(l=e.apply(u,s),o||(u=s=null)))}var o,s,u,a,l;return null==n&&(n=100),function(){u=this,s=arguments,a=t();var d=i&&!o;return o||(o=setTimeout(r,n)),d&&(l=e.apply(u,s),u=s=null),l}}}),X=V&&"object"==typeof V&&"default"in V?V["default"]:V,Y=function(e){return Array.prototype.slice.call(e)},q="0.0.1";"undefined"==typeof WeakMap&&!function(){var e=Object.defineProperty,t=Date.now()%1e9,n=function(){this.name="__st"+(1e9*Math.random()>>>0)+(t++ +"__")};n.prototype={set:function(t,n){var i=t[this.name];return i&&i[0]===t?i[1]=n:e(t,this.name,{value:[t,n],writable:!0}),this},get:function(e){var t;return(t=e[this.name])&&t[0]===e?t[1]:void 0},"delete":function(e){var t=e[this.name];return!(!t||t[0]!==e)&&(t[0]=t[1]=void 0,!0)},has:function(e){var t=e[this.name];return!!t&&t[0]===e}},window.WeakMap=n}();try{var z=new window.CustomEvent("test",{bubbles:!1,cancelable:!0,detail:{x:"y"}});if(z.preventDefault(),z.defaultPrevented!==!0)throw new Error("Could not prevent default")}catch(J){var K=function(e,t){var n;t=t||{bubbles:!1,cancelable:!1,detail:void 0},n=document.createEvent("CustomEvent"),n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail);var i=n.preventDefault;return n.preventDefault=function(){i.call(this);try{Object.defineProperty(this,"defaultPrevented",{get:function(){return!0}})}catch(e){this.defaultPrevented=!0}},n};K.prototype=window.Event.prototype,window.CustomEvent=K}var Q=Array.prototype,U=Q.forEach,Z="_shadow_root_",$=["childNodes","parentNode"],ee=["textContent"],te=["assignedSlot"],ne=["textContent"],ie=[],re=[Node.ELEMENT_NODE,Node.TEXT_NODE],oe=new WeakMap,se=new WeakMap,ue=new WeakMap,ae=new WeakMap,le=new WeakMap,de=new WeakMap,ce=new WeakMap,fe=new WeakMap,he=new WeakMap,pe=new DOMParser,ve={____assignedNodes:{get:function(){return this.______assignedNodes||(this.______assignedNodes=[])}},____isInFallbackMode:{get:function(){return 0===this.assignedNodes().length}},____slotChangeListeners:{get:function(){return"undefined"==typeof this.______slotChangeListeners&&(this.______slotChangeListeners=0),this.______slotChangeListeners},set:function(e){this.______slotChangeListeners=e}},____triggerSlotChangeEvent:{value:X(function(){this.____slotChangeListeners&&this.dispatchEvent(new CustomEvent("slotchange",{bubbles:!1,cancelable:!1}))})},addEventListener:{value:function(e,t,n){return"slotchange"===e&&a(this)&&this.____slotChangeListeners++,this.__addEventListener(e,t,n)}},appendChild:{value:function(e){return W(this,e),e}},assignedSlot:{get:function(){var e=de.get(this);if(!e)return null;var t=he.get(e),n=ce.get(t),i=se.get(n);return"open"===i?e:null}},attachShadow:{value:function(e){var t=this,n=e&&e.mode;if("closed"!==n&&"open"!==n)throw new Error('You must specify { mode } as "open" or "closed" to attachShadow().');var i=ue.get(this);if(i)return i;var r=p([].slice.call(this.childNodes)),o=document.createElement(e.polyfillShadowRootTagName||Z);return se.set(this,n),ue.set(this,o),ce.set(o,this),fe.set(o,{}),R?ae.set(this,r):f(this,"childNodes",r),r.forEach(function(e){t.__removeChild(e),R?le.set(e,t):f(e,"parentNode",t)}),this.__appendChild(o)}},childElementCount:{get:function(){return this.children.length}},childNodes:{get:function(){if(R&&"node"===_(this))return this.__childNodes;var e=ae.get(this);return e||ae.set(this,e=p([])),e}},children:{get:function(){var e=[];return t(this,function(t){1===t.nodeType&&e.push(t)}),p(e)}},firstChild:{get:function(){return this.childNodes[0]||null}},firstElementChild:{get:function(){return this.children[0]||null}},assignedNodes:{value:function(){if(a(this)){var e=oe.get(this);return e||oe.set(this,e=[]),e}}},hasChildNodes:{value:function(){return this.childNodes.length>0}},innerHTML:{get:function(){var e="",n=function(e){return e.outerHTML},i={1:n,3:s,8:u};return t(this,function(t){var r=i[t.nodeType]||n;e+=r(t)}),e},set:function(e){for(var t=c(e);this.hasChildNodes();)this.removeChild(this.firstChild);var n=l(t);for(U.call(n,function(e){return H(e)});t.hasChildNodes();){var i=t.firstChild;t.removeChild(i),this.appendChild(i)}}},insertBefore:{value:function(e,t){return W(this,e,t),e}},lastChild:{get:function(){var e=this.childNodes;return e[e.length-1]||null}},lastElementChild:{get:function(){var e=this.children;return e[e.length-1]||null}},name:{get:function(){return this.getAttribute("name")},set:function(e){return this.setAttribute("name",e)}},nextSibling:{get:function(){var e=this;return t(this.parentNode,function(t,n,i){if(e===t)return i[n+1]||null})}},nextElementSibling:{get:function(){var e=this,n=void 0;return t(this.parentNode,function(t){return n&&1===t.nodeType?t:void(e===t&&(n=!0))})}},outerHTML:{get:function(){var e=this.tagName.toLowerCase(),t=Array.prototype.slice.call(this.attributes).map(function(e){return" "+e.name+(e.value?'="'+e.value+'"':"")}).join("");return"<"+e+t+">"+this.innerHTML+"</"+e+">"},set:function(e){if(this.parentNode){var t=c(e);this.parentNode.replaceChild(t.firstChild,this)}else{if(!R)throw new Error("Failed to set the 'outerHTML' property on 'Element': This element has no parent node.");this.__outerHTML=e}}},parentElement:{get:function(){return g(this.parentNode,function(e){return 1===e.nodeType})}},parentNode:{get:function(){return le.get(this)||this.__parentNode||null}},previousSibling:{get:function(){var e=this;return t(this.parentNode,function(t,n,i){if(e===t)return i[n-1]||null})}},previousElementSibling:{get:function(){var e=this,n=void 0;return t(this.parentNode,function(t){return n&&e===t?n:void(1===t.nodeType&&(n=t))})}},removeChild:{value:function(e){var t=_(this);switch(t){case"node":if(R)return le.set(e,null),this.__removeChild(e);S(this,e);break;case"slot":j(this,e);break;case"host":P(this,e);break;case"root":D(this,e)}return e}},removeEventListener:{value:function(e,t,n){return"slotchange"===e&&this.____slotChangeListeners&&a(this)&&this.____slotChangeListeners--,this.__removeEventListener(e,t,n)}},replaceChild:{value:function(e,t){return this.insertBefore(e,t),this.removeChild(t)}},shadowRoot:{get:function(){return"open"===se.get(this)?ue.get(this):null}},textContent:{get:function(){var e="";return t(this,function(t){t.nodeType!==Node.COMMENT_NODE&&(e+=t.textContent)}),e},set:function(e){for(;this.hasChildNodes();)this.removeChild(this.firstChild);e&&this.appendChild(document.createTextNode(e))}}};"attachShadow"in document.createElement("div")||!function(){var e=Comment.prototype,t=HTMLElement.prototype,n=SVGElement.prototype,i=Text.prototype,o=document.createTextNode(""),s=document.createComment("");Object.keys(ve).forEach(function(u){var a=ve[u];if(a.configurable=!0,a.hasOwnProperty("value")&&(a.writable=!0),R||$.indexOf(u)===-1){var l=r(t,u),d=r(i,u),c=r(e,u),f=u in o&&ee.indexOf(u)===-1||~te.indexOf(u),h=u in s&&ne.indexOf(u)===-1||~ie.indexOf(u),p="__"+u;Object.defineProperty(t,u,a),Object.defineProperty(n,u,a),l&&Object.defineProperty(t,p,l),f&&Object.defineProperty(i,u,a),f&&d&&Object.defineProperty(i,p,d),h&&Object.defineProperty(e,u,a),h&&c&&Object.defineProperty(e,p,c)}})}(),e["default"]=q,Object.defineProperty(e,"__esModule",{value:!0})});
//# sourceMappingURL=index.min.js.map

@@ -50,3 +50,3 @@ {

},
"version": "0.2.8"
"version": "0.2.9"
}

@@ -10,2 +10,3 @@ import { eachChildNode, eachNodeOrFragmentNodes } from './util/each';

import isSlotNode from './util/is-slot-node';
import pseudoArrayToArray from './util/pseudo-array-to-array';
import version from './version';

@@ -285,4 +286,4 @@ import 'webcomponents.js/src/WeakMap/WeakMap.js';

// possible for WebKit.
if (!canPatchNativeAccessors && !slot.childNodes.push) {
staticProp(slot, 'childNodes', [...slot.childNodes]);
if (!canPatchNativeAccessors && !Array.isArray(slot.childNodes)) {
staticProp(slot, 'childNodes', pseudoArrayToArray(slot.childNodes));
}

@@ -397,4 +398,4 @@

// Ensure childNodes is patched so we can manually update it for WebKit.
if (!canPatchNativeAccessors && !host.childNodes.push) {
staticProp(host, 'childNodes', [...host.childNodes]);
if (!canPatchNativeAccessors && !Array.isArray(host.childNodes)) {
staticProp(host, 'childNodes', pseudoArrayToArray(host.childNodes));
}

@@ -401,0 +402,0 @@

Sorry, the diff of this file is not supported yet

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