Socket
Socket
Sign inDemoInstall

@webreflection/custom-elements-builtin

Package Overview
Dependencies
1
Maintainers
1
Versions
39
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.1.4 to 0.1.5

2

cjs/index.js

@@ -60,3 +60,3 @@ 'use strict';

if (method in proto)
proto[method].call(element);
element[method]();
};

@@ -63,0 +63,0 @@

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

!function(){"use strict";const e=e=>"querySelectorAll"in e,{filter:t}=[];var r=r=>{const l=new WeakMap,n=l=>{const{query:n}=r;if(n.length)for(let r=0,{length:s}=l;r<s;r++)o(t.call(l[r].addedNodes,e),!0,n),o(t.call(l[r].removedNodes,e),!1,n)},o=(e,t,n,a=new Set)=>{for(let c,u,i=0,{length:h}=e;i<h;i++)if(!a.has(u=e[i])){if(a.add(u),t)for(let e,o=s(u),a=0,{length:i}=n;a<i;a++)o.call(u,e=n[a])&&(l.has(u)||l.set(u,new Set),c=l.get(u),c.has(e)||(c.add(e),r.handle(u,t,e)));else l.has(u)&&(c=l.get(u),l.delete(u),c.forEach(e=>{r.handle(u,t,e)}));o(u.querySelectorAll(n),t,n,a)}},s=e=>e.matches||e.webkitMatchesSelector||e.msMatchesSelector,a=(e,t=!0)=>{o(e,t,r.query)},c=new MutationObserver(n),u=r.root||document,{query:i}=r;return c.observe(u,{childList:!0,subtree:!0}),i.length&&a(u.querySelectorAll(i)),{drop:e=>{for(let t=0,{length:r}=e;t<r;t++)l.delete(e[t])},flush:()=>{n(c.takeRecords())},observer:c,parse:a}};const{attachShadow:l}=Element.prototype,{defineProperty:n,setPrototypeOf:o}=Object,{define:s,get:a}=customElements,{createElement:c}=document,u=new WeakMap,i=new Map,h=new Map,d=new Map,f=new Map,p=new Set,m=[],y=[],g=e=>{for(let t=0,{length:r}=e;t<r;t++){const{target:r,attributeName:l,oldValue:n}=e[t],o=r.getAttribute(l);r.attributeChangedCallback(l,n,o)}},b=(e,t)=>{const{observedAttributes:r}=e.constructor;return r&&(new MutationObserver(g).observe(e,{attributes:!0,attributeOldValue:!0,attributeFilter:r}),S(t).then(()=>{r.forEach(t=>{e.hasAttribute(t)&&e.attributeChangedCallback(t,null,e.getAttribute(t))})})),e},w=(e,t,r)=>{const l=d.get(r);if(t&&!l.isPrototypeOf(e)){q=o(e,l);try{new l.constructor}finally{q=null}}const n=(t?"":"dis")+"connectedCallback";n in l&&l[n].call(e)},{parse:E}=r({query:y,handle:w}),{parse:v}=r({query:m,handle(e,t){t?p.add(e):p.delete(e),A.call(y,e)}}),S=e=>{if(!h.has(e)){let t,r=new Promise(e=>{t=e});h.set(e,{$:r,_:t})}return h.get(e).$};let q=null;function A(e){E(u.get(e).querySelectorAll(this),e.isConnected)}Reflect.ownKeys(self).filter(e=>"string"==typeof e&&/^HTML(?!Element)/.test(e)).forEach(e=>{function t(){const{constructor:e}=this;if(!i.has(e))throw new TypeError("Illegal constructor");const{is:t,tag:r}=i.get(e);if(q)return b(q,t);const l=c.call(document,r);return l.setAttribute("is",t),b(o(l,e.prototype),t)}o(t,self[e]),(t.prototype=self[e].prototype).constructor=t,n(self,e,{value:t})}),n(Element.prototype,"attachShadow",{value(){const e=l.apply(this,arguments);return r({query:y,root:e,handle:w}),u.set(this,e),e}}),n(customElements,"define",{value(e,t,r){let l;const n=r&&r.extends;if(n){if(f.has(e))throw new Error(`the name "${e}" has already been used with this registry`);l=`${n}[is="${e}"]`,i.set(t,{is:e,tag:n}),d.set(l,t.prototype),f.set(e,t),y.push(l)}else s.apply(customElements,arguments),m.push(l=e);S(e).then(()=>{n?(E(document.querySelectorAll(l)),p.forEach(A,[l])):v(document.querySelectorAll(l))}),h.get(e)._()}}),n(customElements,"get",{value:e=>f.get(e)||a.call(customElements,e)}),n(customElements,"whenDefined",{value:S}),n(document,"createElement",{value(e,t){const r=t&&t.is;return r?new(f.get(r)):c.call(document,e)}})}();
!function(){"use strict";const e=e=>"querySelectorAll"in e,{filter:t}=[];var r=r=>{const l=new WeakMap,n=l=>{const{query:n}=r;if(n.length)for(let r=0,{length:s}=l;r<s;r++)o(t.call(l[r].addedNodes,e),!0,n),o(t.call(l[r].removedNodes,e),!1,n)},o=(e,t,n,a=new Set)=>{for(let c,u,i=0,{length:h}=e;i<h;i++)if(!a.has(u=e[i])){if(a.add(u),t)for(let e,o=s(u),a=0,{length:i}=n;a<i;a++)o.call(u,e=n[a])&&(l.has(u)||l.set(u,new Set),c=l.get(u),c.has(e)||(c.add(e),r.handle(u,t,e)));else l.has(u)&&(c=l.get(u),l.delete(u),c.forEach(e=>{r.handle(u,t,e)}));o(u.querySelectorAll(n),t,n,a)}},s=e=>e.matches||e.webkitMatchesSelector||e.msMatchesSelector,a=(e,t=!0)=>{o(e,t,r.query)},c=new MutationObserver(n),u=r.root||document,{query:i}=r;return c.observe(u,{childList:!0,subtree:!0}),i.length&&a(u.querySelectorAll(i)),{drop:e=>{for(let t=0,{length:r}=e;t<r;t++)l.delete(e[t])},flush:()=>{n(c.takeRecords())},observer:c,parse:a}};const{attachShadow:l}=Element.prototype,{defineProperty:n,setPrototypeOf:o}=Object,{define:s,get:a}=customElements,{createElement:c}=document,u=new WeakMap,i=new Map,h=new Map,d=new Map,f=new Map,p=new Set,m=[],y=[],g=e=>{for(let t=0,{length:r}=e;t<r;t++){const{target:r,attributeName:l,oldValue:n}=e[t],o=r.getAttribute(l);r.attributeChangedCallback(l,n,o)}},b=(e,t)=>{const{observedAttributes:r}=e.constructor;return r&&(new MutationObserver(g).observe(e,{attributes:!0,attributeOldValue:!0,attributeFilter:r}),S(t).then(()=>{r.forEach(t=>{e.hasAttribute(t)&&e.attributeChangedCallback(t,null,e.getAttribute(t))})})),e},w=(e,t,r)=>{const l=d.get(r);if(t&&!l.isPrototypeOf(e)){q=o(e,l);try{new l.constructor}finally{q=null}}const n=(t?"":"dis")+"connectedCallback";n in l&&e[n]()},{parse:E}=r({query:y,handle:w}),{parse:v}=r({query:m,handle(e,t){t?p.add(e):p.delete(e),A.call(y,e)}}),S=e=>{if(!h.has(e)){let t,r=new Promise(e=>{t=e});h.set(e,{$:r,_:t})}return h.get(e).$};let q=null;function A(e){E(u.get(e).querySelectorAll(this),e.isConnected)}Reflect.ownKeys(self).filter(e=>"string"==typeof e&&/^HTML(?!Element)/.test(e)).forEach(e=>{function t(){const{constructor:e}=this;if(!i.has(e))throw new TypeError("Illegal constructor");const{is:t,tag:r}=i.get(e);if(q)return b(q,t);const l=c.call(document,r);return l.setAttribute("is",t),b(o(l,e.prototype),t)}o(t,self[e]),(t.prototype=self[e].prototype).constructor=t,n(self,e,{value:t})}),n(Element.prototype,"attachShadow",{value(){const e=l.apply(this,arguments);return r({query:y,root:e,handle:w}),u.set(this,e),e}}),n(customElements,"define",{value(e,t,r){let l;const n=r&&r.extends;if(n){if(f.has(e))throw new Error(`the name "${e}" has already been used with this registry`);l=`${n}[is="${e}"]`,i.set(t,{is:e,tag:n}),d.set(l,t.prototype),f.set(e,t),y.push(l)}else s.apply(customElements,arguments),m.push(l=e);S(e).then(()=>{n?(E(document.querySelectorAll(l)),p.forEach(A,[l])):v(document.querySelectorAll(l))}),h.get(e)._()}}),n(customElements,"get",{value:e=>f.get(e)||a.call(customElements,e)}),n(customElements,"whenDefined",{value:S}),n(document,"createElement",{value(e,t){const r=t&&t.is;return r?new(f.get(r)):c.call(document,e)}})}();

@@ -59,3 +59,3 @@ import qsaObserver from 'qsa-observer';

if (method in proto)
proto[method].call(element);
element[method]();
};

@@ -62,0 +62,0 @@

@@ -129,3 +129,3 @@ (function () {

if (method in proto)
proto[method].call(element);
element[method]();
};

@@ -132,0 +132,0 @@

{
"name": "@webreflection/custom-elements-builtin",
"version": "0.1.4",
"version": "0.1.5",
"description": "A better custom-elements-builtin polyfill, Safari only",

@@ -5,0 +5,0 @@ "main": "./cjs/index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc