Socket
Socket
Sign inDemoInstall

@webreflection/custom-elements-builtin

Package Overview
Dependencies
4
Maintainers
1
Versions
39
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.2.0 to 0.2.1

2

cjs/index.js

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

getOwnPropertyNames(self)
.filter(k => /^HTML/.test(k))
.filter(k => /^HTML.*Element$/.test(k))
.forEach(k => {

@@ -82,0 +82,0 @@ const HTMLElement = self[k];

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

!function(){"use strict";const{keys:e}=Object,t=!0,r=!1,n="querySelectorAll";function l(e){this.observe(e,{subtree:t,childList:t})}const o="querySelectorAll",{document:s,Element:a,MutationObserver:c,Set:u,WeakMap:i}=self,d=e=>o in e,{filter:h}=[];var f=e=>{const f=new i,g=(t,r)=>{let n;if(r)for(let l,o=(e=>e.matches||e.webkitMatchesSelector||e.msMatchesSelector)(t),s=0,{length:a}=b;s<a;s++)o.call(t,l=b[s])&&(f.has(t)||f.set(t,new u),n=f.get(t),n.has(l)||(n.add(l),e.handle(t,r,l)));else f.has(t)&&(n=f.get(t),f.delete(t),n.forEach((n=>{e.handle(t,r,n)})))},p=(e,t=!0)=>{for(let r=0,{length:n}=e;r<n;r++)g(e[r],t)},{query:b}=e,w=e.root||s,y=((e,o,s)=>{const a=(r,l,o,s,c)=>{for(let u=0,{length:i}=r;u<i;u++){const i=r[u];(c||n in i)&&(s?l.has(i)||(l.add(i),o.delete(i),e(i,s)):o.has(i)||(o.add(i),l.delete(i),e(i,s)),c||a(i[n]("*"),l,o,s,t))}},c=new(s||MutationObserver)((e=>{for(let n=new Set,l=new Set,o=0,{length:s}=e;o<s;o++){const{addedNodes:s,removedNodes:c}=e[o];a(c,n,l,r,r),a(s,n,l,t,r)}}));return c.add=l,c.add(o||document),c})(g,w,c),{attachShadow:m}=a.prototype;return m&&(a.prototype.attachShadow=function(e){const t=m.call(this,e);return y.add(t),t}),b.length&&p(w[o](b)),{drop:e=>{for(let t=0,{length:r}=e;t<r;t++)f.delete(e[t])},flush:()=>{const e=y.takeRecords();for(let t=0,{length:r}=e;t<r;t++)p(h.call(e[t].removedNodes,d),!1),p(h.call(e[t].addedNodes,d),!0)},observer:y,parse:p}};const{customElements:g,document:p,Element:b,MutationObserver:w,Object:y,Promise:m,Map:v,Set:S,WeakMap:A,Reflect:E}=self,{attachShadow:M}=b.prototype,{createElement:O}=p,{define:q,get:k}=g,{construct:N}=E||{construct(e){return e.call(this)}},{defineProperty:P,getOwnPropertyNames:$,setPrototypeOf:C}=y,V=new A,j=new S,L=new v,R=new v,T=new v,W=new v,_=[],x=[],D=e=>W.get(e)||k.call(g,e),{parse:F}=f({query:x,handle:(t,r,n)=>{const l=T.get(n);if(r&&!l.isPrototypeOf(t)){const r=(t=>{const r=e(t),n=[],{length:l}=r;for(let e=0;e<l;e++)n[e]=t[r[e]],delete t[r[e]];return()=>{for(let e=0;e<l;e++)t[r[e]]=n[e]}})(t);B=C(t,l);try{new l.constructor}finally{B=null,r()}}const o=(r?"":"dis")+"connectedCallback";o in l&&t[o]()}}),{parse:H}=f({query:_,handle(e,t){V.has(e)&&(t?j.add(e):j.delete(e),x.length&&G.call(x,e))}}),I=e=>{if(!R.has(e)){let t,r=new m((e=>{t=e}));R.set(e,{$:r,_:t})}return R.get(e).$},z=((e,t)=>{const r=e=>{for(let t=0,{length:r}=e;t<r;t++)n(e[t])},n=({target:e,attributeName:t,oldValue:r})=>{e.attributeChangedCallback(t,r,e.getAttribute(t))};return(l,o)=>{const{observedAttributes:s}=l.constructor;return s&&e(o).then((()=>{new t(r).observe(l,{attributes:!0,attributeOldValue:!0,attributeFilter:s});for(let e=0,{length:t}=s;e<t;e++)l.hasAttribute(s[e])&&n({target:l,attributeName:s[e],oldValue:null})})),l}})(I,w);let B=null;function G(e){const t=V.get(e);F(t.querySelectorAll(this),e.isConnected)}$(self).filter((e=>/^HTML/.test(e))).forEach((e=>{const t=self[e];function r(){const{constructor:e}=this;if(!L.has(e))throw new TypeError("Illegal constructor");const{is:r,tag:n}=L.get(e);if(r){if(B)return z(B,r);const t=O.call(p,n);return t.setAttribute("is",r),z(C(t,e.prototype),r)}return N.call(this,t,[],e)}C(r,t),P(r.prototype=t.prototype,"constructor",{value:r}),P(self,e,{value:r})})),P(p,"createElement",{configurable:!0,value(e,t){const r=t&&t.is;if(r){const t=W.get(r);if(t&&L.get(t).tag===e)return new t}const n=O.call(p,e);return r&&n.setAttribute("is",r),n}}),M&&(b.prototype.attachShadow=function(e){const t=M.call(this,e);return V.set(this,t),t}),P(g,"get",{configurable:!0,value:D}),P(g,"whenDefined",{configurable:!0,value:I}),P(g,"define",{configurable:!0,value(e,t,r){if(D(e))throw new Error(`'${e}' has already been defined as a custom element`);let n;const l=r&&r.extends;L.set(t,l?{is:e,tag:l}:{is:"",tag:e}),l?(n=`${l}[is="${e}"]`,T.set(n,t.prototype),W.set(e,t),x.push(n)):(q.apply(g,arguments),_.push(n=e)),I(e).then((()=>{l?(F(p.querySelectorAll(n)),j.forEach(G,[n])):H(p.querySelectorAll(n))})),R.get(e)._(t)}})}();
!function(){"use strict";const{keys:e}=Object,t=!0,r=!1,n="querySelectorAll";function l(e){this.observe(e,{subtree:t,childList:t})}const o="querySelectorAll",{document:s,Element:a,MutationObserver:c,Set:u,WeakMap:i}=self,d=e=>o in e,{filter:h}=[];var f=e=>{const f=new i,g=(t,r)=>{let n;if(r)for(let l,o=(e=>e.matches||e.webkitMatchesSelector||e.msMatchesSelector)(t),s=0,{length:a}=b;s<a;s++)o.call(t,l=b[s])&&(f.has(t)||f.set(t,new u),n=f.get(t),n.has(l)||(n.add(l),e.handle(t,r,l)));else f.has(t)&&(n=f.get(t),f.delete(t),n.forEach((n=>{e.handle(t,r,n)})))},p=(e,t=!0)=>{for(let r=0,{length:n}=e;r<n;r++)g(e[r],t)},{query:b}=e,w=e.root||s,y=((e,o,s)=>{const a=(r,l,o,s,c)=>{for(let u=0,{length:i}=r;u<i;u++){const i=r[u];(c||n in i)&&(s?l.has(i)||(l.add(i),o.delete(i),e(i,s)):o.has(i)||(o.add(i),l.delete(i),e(i,s)),c||a(i[n]("*"),l,o,s,t))}},c=new(s||MutationObserver)((e=>{for(let n=new Set,l=new Set,o=0,{length:s}=e;o<s;o++){const{addedNodes:s,removedNodes:c}=e[o];a(c,n,l,r,r),a(s,n,l,t,r)}}));return c.add=l,c.add(o||document),c})(g,w,c),{attachShadow:m}=a.prototype;return m&&(a.prototype.attachShadow=function(e){const t=m.call(this,e);return y.add(t),t}),b.length&&p(w[o](b)),{drop:e=>{for(let t=0,{length:r}=e;t<r;t++)f.delete(e[t])},flush:()=>{const e=y.takeRecords();for(let t=0,{length:r}=e;t<r;t++)p(h.call(e[t].removedNodes,d),!1),p(h.call(e[t].addedNodes,d),!0)},observer:y,parse:p}};const{customElements:g,document:p,Element:b,MutationObserver:w,Object:y,Promise:m,Map:v,Set:S,WeakMap:E,Reflect:A}=self,{attachShadow:M}=b.prototype,{createElement:O}=p,{define:q,get:k}=g,{construct:N}=A||{construct(e){return e.call(this)}},{defineProperty:$,getOwnPropertyNames:P,setPrototypeOf:C}=y,V=new E,j=new S,L=new v,R=new v,T=new v,W=new v,_=[],x=[],D=e=>W.get(e)||k.call(g,e),{parse:F}=f({query:x,handle:(t,r,n)=>{const l=T.get(n);if(r&&!l.isPrototypeOf(t)){const r=(t=>{const r=e(t),n=[],{length:l}=r;for(let e=0;e<l;e++)n[e]=t[r[e]],delete t[r[e]];return()=>{for(let e=0;e<l;e++)t[r[e]]=n[e]}})(t);B=C(t,l);try{new l.constructor}finally{B=null,r()}}const o=(r?"":"dis")+"connectedCallback";o in l&&t[o]()}}),{parse:H}=f({query:_,handle(e,t){V.has(e)&&(t?j.add(e):j.delete(e),x.length&&G.call(x,e))}}),I=e=>{if(!R.has(e)){let t,r=new m((e=>{t=e}));R.set(e,{$:r,_:t})}return R.get(e).$},z=((e,t)=>{const r=e=>{for(let t=0,{length:r}=e;t<r;t++)n(e[t])},n=({target:e,attributeName:t,oldValue:r})=>{e.attributeChangedCallback(t,r,e.getAttribute(t))};return(l,o)=>{const{observedAttributes:s}=l.constructor;return s&&e(o).then((()=>{new t(r).observe(l,{attributes:!0,attributeOldValue:!0,attributeFilter:s});for(let e=0,{length:t}=s;e<t;e++)l.hasAttribute(s[e])&&n({target:l,attributeName:s[e],oldValue:null})})),l}})(I,w);let B=null;function G(e){const t=V.get(e);F(t.querySelectorAll(this),e.isConnected)}P(self).filter((e=>/^HTML.*Element$/.test(e))).forEach((e=>{const t=self[e];function r(){const{constructor:e}=this;if(!L.has(e))throw new TypeError("Illegal constructor");const{is:r,tag:n}=L.get(e);if(r){if(B)return z(B,r);const t=O.call(p,n);return t.setAttribute("is",r),z(C(t,e.prototype),r)}return N.call(this,t,[],e)}C(r,t),$(r.prototype=t.prototype,"constructor",{value:r}),$(self,e,{value:r})})),$(p,"createElement",{configurable:!0,value(e,t){const r=t&&t.is;if(r){const t=W.get(r);if(t&&L.get(t).tag===e)return new t}const n=O.call(p,e);return r&&n.setAttribute("is",r),n}}),M&&(b.prototype.attachShadow=function(e){const t=M.call(this,e);return V.set(this,t),t}),$(g,"get",{configurable:!0,value:D}),$(g,"whenDefined",{configurable:!0,value:I}),$(g,"define",{configurable:!0,value(e,t,r){if(D(e))throw new Error(`'${e}' has already been defined as a custom element`);let n;const l=r&&r.extends;L.set(t,l?{is:e,tag:l}:{is:"",tag:e}),l?(n=`${l}[is="${e}"]`,T.set(n,t.prototype),W.set(e,t),x.push(n)):(q.apply(g,arguments),_.push(n=e)),I(e).then((()=>{l?(F(p.querySelectorAll(n)),j.forEach(G,[n])):H(p.querySelectorAll(n))})),R.get(e)._(t)}})}();

@@ -78,3 +78,3 @@ import attributesObserver from '@webreflection/custom-elements-attributes';

getOwnPropertyNames(self)
.filter(k => /^HTML/.test(k))
.filter(k => /^HTML.*Element$/.test(k))
.forEach(k => {

@@ -81,0 +81,0 @@ const HTMLElement = self[k];

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

getOwnPropertyNames(self)
.filter(k => /^HTML/.test(k))
.filter(k => /^HTML.*Element$/.test(k))
.forEach(k => {

@@ -253,0 +253,0 @@ const HTMLElement = self[k];

{
"name": "@webreflection/custom-elements-builtin",
"version": "0.2.0",
"version": "0.2.1",
"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