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

as-custom-element

Package Overview
Dependencies
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

as-custom-element - npm Package Compare versions

Comparing version 0.2.4 to 0.2.5

6

cjs/index.js

@@ -30,7 +30,7 @@ 'use strict';

const mainLoop = records => {
for (let parsed = new Set, i = 0, {length} = records; i < length; i++) {
for (let c = new Set, d = new Set, i = 0, {length} = records; i < length; i++) {
const {addedNodes, removedNodes} = records[i];
invoke(addedNodes, 'c', parsed);
invoke(addedNodes, 'c', c);
attributeChanged(sao.takeRecords());
invoke(removedNodes, 'd', parsed);
invoke(removedNodes, 'd', d);
}

@@ -37,0 +37,0 @@ };

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

self.asCustomElement=function(e){"use strict";const t=new Set,r=new MutationObserver(e=>{t.forEach(a,e)});function a(e){e(this,r)}r.observe(document,{subtree:!0,childList:!0}),t.observer=r;const n=new WeakMap,{observer:o}=t,c=e=>{for(let t=0,{length:r}=e;t<r;t++){const{target:r,attributeName:a,oldValue:o}=e[t],c=r.getAttribute(a);n.get(r).a[a].forEach(e=>{e.call(r,a,o,c)})}},l=(e,t,r)=>{for(let a=0,{length:o}=e;a<o;a++){const o=e[a];!r.has(o)&&"querySelectorAll"in o&&(r.add(o),n.has(o)&&n.get(o)[t].forEach(u,o),l(o.querySelectorAll("*"),t,r))}},s=e=>{for(let t=new Set,r=0,{length:a}=e;r<a;r++){const{addedNodes:a,removedNodes:n}=e[r];l(a,"c",t),c(d.takeRecords()),l(n,"d",t)}},d=new MutationObserver(c);t.add(s);function u(e){e.call(this)}return e.default=(e,{connectedCallback:t,disconnectedCallback:r,observedAttributes:a,attributeChangedCallback:c})=>{s(o.takeRecords());const{a:l,c:u,d:i}=n.get(e)||(e=>{const t={a:{},c:new Set,d:new Set};return n.set(e,t),t})(e);return a&&(d.observe(e,{attributes:!0,attributeOldValue:!0,attributeFilter:a}),a.forEach(t=>{(l[t]||(l[t]=new Set)).add(c),e.hasAttribute(t)&&c.call(e,t,null,e.getAttribute(t))})),r&&i.add(r),t&&(u.add(t),e.ownerDocument.compareDocumentPosition(e)&e.DOCUMENT_POSITION_DISCONNECTED||t.call(e)),e},e}({}).default;
self.asCustomElement=function(e){"use strict";const t=new Set,r=new MutationObserver(e=>{t.forEach(a,e)});function a(e){e(this,r)}r.observe(document,{subtree:!0,childList:!0}),t.observer=r;const n=new WeakMap,{observer:o}=t,c=e=>{for(let t=0,{length:r}=e;t<r;t++){const{target:r,attributeName:a,oldValue:o}=e[t],c=r.getAttribute(a);n.get(r).a[a].forEach(e=>{e.call(r,a,o,c)})}},l=(e,t,r)=>{for(let a=0,{length:o}=e;a<o;a++){const o=e[a];!r.has(o)&&"querySelectorAll"in o&&(r.add(o),n.has(o)&&n.get(o)[t].forEach(u,o),l(o.querySelectorAll("*"),t,r))}},s=e=>{for(let t=new Set,r=new Set,a=0,{length:n}=e;a<n;a++){const{addedNodes:n,removedNodes:o}=e[a];l(n,"c",t),c(d.takeRecords()),l(o,"d",r)}},d=new MutationObserver(c);t.add(s);function u(e){e.call(this)}return e.default=(e,{connectedCallback:t,disconnectedCallback:r,observedAttributes:a,attributeChangedCallback:c})=>{s(o.takeRecords());const{a:l,c:u,d:i}=n.get(e)||(e=>{const t={a:{},c:new Set,d:new Set};return n.set(e,t),t})(e);return a&&(d.observe(e,{attributes:!0,attributeOldValue:!0,attributeFilter:a}),a.forEach(t=>{(l[t]||(l[t]=new Set)).add(c),e.hasAttribute(t)&&c.call(e,t,null,e.getAttribute(t))})),r&&i.add(r),t&&(u.add(t),e.ownerDocument.compareDocumentPosition(e)&e.DOCUMENT_POSITION_DISCONNECTED||t.call(e)),e},e}({}).default;

@@ -29,7 +29,7 @@ import sdo from 'shared-document-observer';

const mainLoop = records => {
for (let parsed = new Set, i = 0, {length} = records; i < length; i++) {
for (let c = new Set, d = new Set, i = 0, {length} = records; i < length; i++) {
const {addedNodes, removedNodes} = records[i];
invoke(addedNodes, 'c', parsed);
invoke(addedNodes, 'c', c);
attributeChanged(sao.takeRecords());
invoke(removedNodes, 'd', parsed);
invoke(removedNodes, 'd', d);
}

@@ -36,0 +36,0 @@ };

@@ -51,9 +51,9 @@ self.asCustomElement = (function (exports) {

var mainLoop = function mainLoop(records) {
for (var parsed = new Set(), i = 0, length = records.length; i < length; i++) {
for (var c = new Set(), d = new Set(), i = 0, length = records.length; i < length; i++) {
var _records$i2 = records[i],
addedNodes = _records$i2.addedNodes,
removedNodes = _records$i2.removedNodes;
invoke$1(addedNodes, 'c', parsed);
invoke$1(addedNodes, 'c', c);
attributeChanged(sao.takeRecords());
invoke$1(removedNodes, 'd', parsed);
invoke$1(removedNodes, 'd', d);
}

@@ -60,0 +60,0 @@ };

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

self.asCustomElement=function(e){"use strict";var t=new Set,r=new MutationObserver((function(e){t.forEach(a,e)}));function a(e){e(this,r)}r.observe(document,{subtree:!0,childList:!0}),t.observer=r;var n=new WeakMap,o=t.observer,c=function(e){for(var t=function(t,r){var a=e[t],o=a.target,c=a.attributeName,u=a.oldValue,l=o.getAttribute(c);n.get(o).a[c].forEach((function(e){e.call(o,c,u,l)}))},r=0,a=e.length;r<a;r++)t(r)},u=function e(t,r,a){for(var o=0,c=t.length;o<c;o++){var u=t[o];!a.has(u)&&"querySelectorAll"in u&&(a.add(u),n.has(u)&&n.get(u)[r].forEach(d,u),e(u.querySelectorAll("*"),r,a))}},l=function(e){for(var t=new Set,r=0,a=e.length;r<a;r++){var n=e[r],o=n.addedNodes,l=n.removedNodes;u(o,"c",t),c(i.takeRecords()),u(l,"d",t)}},i=new MutationObserver(c);t.add(l);function d(e){e.call(this)}return e.default=function(e,t){var r=t.connectedCallback,a=t.disconnectedCallback,c=t.observedAttributes,u=t.attributeChangedCallback;l(o.takeRecords());var d=n.get(e)||function(e){var t={a:{},c:new Set,d:new Set};return n.set(e,t),t}(e),s=d.a,f=d.c,b=d.d;return c&&(i.observe(e,{attributes:!0,attributeOldValue:!0,attributeFilter:c}),c.forEach((function(t){(s[t]||(s[t]=new Set)).add(u),e.hasAttribute(t)&&u.call(e,t,null,e.getAttribute(t))}))),a&&b.add(a),r&&(f.add(r),e.ownerDocument.compareDocumentPosition(e)&e.DOCUMENT_POSITION_DISCONNECTED||r.call(e)),e},e}({}).default;
self.asCustomElement=function(e){"use strict";var t=new Set,r=new MutationObserver((function(e){t.forEach(a,e)}));function a(e){e(this,r)}r.observe(document,{subtree:!0,childList:!0}),t.observer=r;var n=new WeakMap,o=t.observer,c=function(e){for(var t=function(t,r){var a=e[t],o=a.target,c=a.attributeName,u=a.oldValue,l=o.getAttribute(c);n.get(o).a[c].forEach((function(e){e.call(o,c,u,l)}))},r=0,a=e.length;r<a;r++)t(r)},u=function e(t,r,a){for(var o=0,c=t.length;o<c;o++){var u=t[o];!a.has(u)&&"querySelectorAll"in u&&(a.add(u),n.has(u)&&n.get(u)[r].forEach(d,u),e(u.querySelectorAll("*"),r,a))}},l=function(e){for(var t=new Set,r=new Set,a=0,n=e.length;a<n;a++){var o=e[a],l=o.addedNodes,d=o.removedNodes;u(l,"c",t),c(i.takeRecords()),u(d,"d",r)}},i=new MutationObserver(c);t.add(l);function d(e){e.call(this)}return e.default=function(e,t){var r=t.connectedCallback,a=t.disconnectedCallback,c=t.observedAttributes,u=t.attributeChangedCallback;l(o.takeRecords());var d=n.get(e)||function(e){var t={a:{},c:new Set,d:new Set};return n.set(e,t),t}(e),s=d.a,f=d.c,b=d.d;return c&&(i.observe(e,{attributes:!0,attributeOldValue:!0,attributeFilter:c}),c.forEach((function(t){(s[t]||(s[t]=new Set)).add(u),e.hasAttribute(t)&&u.call(e,t,null,e.getAttribute(t))}))),a&&b.add(a),r&&(f.add(r),e.ownerDocument.compareDocumentPosition(e)&e.DOCUMENT_POSITION_DISCONNECTED||r.call(e)),e},e}({}).default;
{
"name": "as-custom-element",
"version": "0.2.4",
"version": "0.2.5",
"description": "Setup any element as if it was a Custom Element",

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

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