Socket
Socket
Sign inDemoInstall

uhooks-dom

Package Overview
Dependencies
5
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.1.8 to 0.1.9

4

es.js

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

self.uhooksDOM=function(e){"use strict";var t=CustomEvent;const n=(e,t,n,o)=>{const c=new WeakMap,l=new WeakMap,r=new WeakMap,a=e=>c.has(e),u=e=>{a(e)&&(i(e,e.removeEventListener,c.get(e)),c.delete(e))},i=(e,t,n)=>{t.call(e,"disconnected",n),t.call(e,"connected",n)},h=(e,t,n,s)=>{for(let{length:o}=e,c=0;c<o;c++)d(e[c],t,n,s)},d=(e,s,o,c)=>{a(e)&&!o.has(e)&&(c.delete(e),o.set(e,0),e.dispatchEvent(new(n||CustomEvent)(s))),h(e[t||"children"]||[],s,o,c)},p=new(o||MutationObserver)((e=>{for(let{length:t}=e,n=0;n<t;n++){const{removedNodes:t,addedNodes:s}=e[n];h(t,"disconnected",r,l),h(s,"connected",l,r)}}));return p.observe(e||document,{subtree:!0,childList:!0}),{has:a,connect:(e,t)=>{u(e),(t||(t={})).handleEvent||(t.handleEvent=s),i(e,e.addEventListener,t),c.set(e,t)},disconnect:u,kill(){p.disconnect()}}};function s(e){e.type in this&&this[e.type](e)}var o=Promise;let c=null,l=new Set;const r=new WeakMap,a=e=>{const{$:t,r:n,h:s}=e;y(n)&&(i.get(s).delete(e),n()),y(e.r=t())&&i.get(s).add(e)},u=()=>{const e=l;l=new Set,e.forEach((({h:e,c:t,a:n,e:s})=>{s&&e.apply(t,n)}))},i=new WeakMap,h=[],d=[];function p(e,t){return e!==this[t]}const f=e=>{const t=i.get(e);t&&g.then((()=>{t.forEach((e=>{e.r(),e.r=null})),t.clear()}))},v=()=>r.get(c),w=e=>i.has(e),y=e=>"function"==typeof e,E=e=>{const t={h:n,c:null,a:null,e:0,i:0,s:[]};return r.set(n,t),n;function n(){const s=c;c=n,t.e=t.i=0;try{return e.apply(t.c=this,t.a=arguments)}finally{c=s,h.length&&g.then(h.forEach.bind(h.splice(0),a)),d.length&&d.splice(0).forEach(a)}}},g=new o((e=>e()));function m(e){const{_:t,value:n}=this;n!==e&&(this._=new Set,this.value=e,t.forEach((({h:e,c:t,a:n})=>{e.apply(t,n)})))}const k=(e,t)=>{const n=v(),{i:s,s:o}=n;return s!==o.length&&t&&!t.some(p,o[s]._)||(o[s]={$:e(),_:t}),o[n.i++].$},M=e=>(t,n)=>{const s=v(),{i:o,s:c,h:l}=s,r=o===c.length;r&&(i.has(l)||i.set(l,new Set),c.push({$:t,_:n,r:null,h:l}));const a=c[s.i++];(r||!n||n.some(p,a._))&&e.push(a)},_=M(h),b=M(d),$=(e,t)=>y(t)?t(e):t,S=(e,t,n)=>{const s=v(),{i:o,s:c}=s;o===c.length&&c.push({$:y(n)?n(t):$(void 0,t),set:t=>{c[o].$=e(c[o].$,t),(e=>{l.has(e)||(e.e=1,l.add(e),g.then(u))})(s)}});const{$:r,set:a}=c[s.i++];return[r,a]};
self.uhooksDOM=function(e){"use strict";var t=CustomEvent;const n=(e,t,n,o)=>{const c=new WeakMap,l=new WeakMap,r=new WeakMap,a=e=>c.has(e),u=e=>{a(e)&&(i(e,e.removeEventListener,c.get(e)),c.delete(e))},i=(e,t,n)=>{t.call(e,"disconnected",n),t.call(e,"connected",n)},h=(e,t,n,s)=>{for(let{length:o}=e,c=0;c<o;c++)d(e[c],t,n,s)},d=(e,s,o,c)=>{a(e)&&!o.has(e)&&(c.delete(e),o.set(e,0),e.dispatchEvent(new(n||CustomEvent)(s))),h(e[t||"children"]||[],s,o,c)},p=new(o||MutationObserver)((e=>{for(let{length:t}=e,n=0;n<t;n++){const{removedNodes:t,addedNodes:s}=e[n];h(t,"disconnected",r,l),h(s,"connected",l,r)}}));return p.observe(e||document,{subtree:!0,childList:!0}),{has:a,connect:(e,t)=>{u(e),(t||(t={})).handleEvent||(t.handleEvent=s),i(e,e.addEventListener,t),c.set(e,t)},disconnect:u,kill(){p.disconnect()}}};function s(e){e.type in this&&this[e.type](e)}var o=Promise;let c=null,l=new Set;const r=new WeakMap,a=e=>{const{$:t,r:n,h:s}=e;y(n)&&(i.get(s).delete(e),n()),y(e.r=t())&&i.get(s).add(e)},u=()=>{const e=l;l=new Set,e.forEach((({h:e,c:t,a:n,e:s})=>{s&&e.apply(t,n)}))},i=new WeakMap,h=[],d=[];function p(e,t){return e!==this[t]}const f=e=>{const t=i.get(e);t&&g.then((()=>{t.forEach((e=>{e.r(),e.r=null})),t.clear()}))},v=()=>r.get(c),w=e=>i.has(e),y=e=>"function"==typeof e,E=e=>{const t={h:n,c:null,a:null,e:0,i:0,s:[]};return r.set(n,t),n;function n(){const s=c;c=n,t.e=t.i=0;try{return e.apply(t.c=this,t.a=arguments)}finally{c=s,h.length&&g.then(h.forEach.bind(h.splice(0),a)),d.length&&d.splice(0).forEach(a)}}},g=new o((e=>e()));function m(e){const{_:t,value:n}=this;n!==e&&(this._=new Set,this.value=e,t.forEach((({h:e,c:t,a:n})=>{e.apply(t,n)})))}const _=(e,t)=>{const n=v(),{i:s,s:o}=n;return s!==o.length&&t&&!t.some(p,o[s]._)||(o[s]={$:e(),_:t}),o[n.i++].$},k=e=>(t,n)=>{const s=v(),{i:o,s:c,h:l}=s,r=o===c.length;s.i++,r&&(i.has(l)||i.set(l,new Set),c[o]={$:t,_:n,r:null,h:l}),(r||!n||n.some(p,c[o]._))&&e.push(c[o]),c[o].$=t,c[o]._=n},M=k(h),b=k(d),$=(e,t)=>y(t)?t(e):t,S=(e,t,n)=>{const s=v(),{i:o,s:c}=s;o===c.length&&c.push({$:y(n)?n(t):$(void 0,t),set:t=>{c[o].$=e(c[o].$,t),(e=>{l.has(e)||(e.e=1,l.add(e),g.then(u))})(s)}});const{$:r,set:a}=c[s.i++];return[r,a]};
/*! (c) Andrea Giammarchi - ISC */
let C=null,W=null,L=null;const O=new WeakMap,x=(e,t,n,s)=>e?[s[0],o=>{O.has(e)||(O.set(e,0),g.then((()=>{O.delete(e),e.apply(t,n)}))),s[1](o)}]:s,D=(e,t)=>E(t?function t(){const[n,s,o]=[C,W,L];[C,W,L]=[t,this,arguments];try{return e.apply(W,L)}finally{[C,W,L]=[n,s,o]}}:e);
/*! (c) Andrea Giammarchi - ISC */
let N=null;const P=({firstChild:e})=>{if(e&&1!==e.nodeType&&!(e=e.nextElementSibling))throw"unobservable";return e},R=e=>{const{nodeType:t}=e;if(t)return 1===t?e:P(e);{const t=e.valueOf();return t!==e?R(t):P(t)}};return e.createContext=e=>({_:new Set,provide:m,value:e}),e.hooked=(e,s)=>{const o=D(e,s);return function(){const e=o.apply(this,arguments);if(w(o)){const s=R(e);N||(N=n(s.ownerDocument,"children",t)),N.has(s)||N.connect(s,{disconnected(){f(o)}})}return e}},e.useCallback=(e,t)=>k((()=>e),t),e.useContext=({_:e,value:t})=>(e.add(v()),t),e.useEffect=_,e.useLayoutEffect=b,e.useMemo=k,e.useReducer=(e,t,n)=>x(C,W,L,S(e,t,n)),e.useRef=e=>{const t=v(),{i:n,s:s}=t;return n===s.length&&s.push({current:e}),s[t.i++]},e.useState=e=>x(C,W,L,(e=>S($,e))(e)),e.wait=g,e}({});
let N=null;const P=({firstChild:e})=>{if(e&&1!==e.nodeType&&!(e=e.nextElementSibling))throw"unobservable";return e},R=e=>{const{nodeType:t}=e;if(t)return 1===t?e:P(e);{const t=e.valueOf();return t!==e?R(t):P(t)}};return e.createContext=e=>({_:new Set,provide:m,value:e}),e.hooked=(e,s)=>{const o=D(e,s);return function(){const e=o.apply(this,arguments);if(w(o)){const s=R(e);N||(N=n(s.ownerDocument,"children",t)),N.has(s)||N.connect(s,{disconnected(){f(o)}})}return e}},e.useCallback=(e,t)=>_((()=>e),t),e.useContext=({_:e,value:t})=>(e.add(v()),t),e.useEffect=M,e.useLayoutEffect=b,e.useMemo=_,e.useReducer=(e,t,n)=>x(C,W,L,S(e,t,n)),e.useRef=e=>{const t=v(),{i:n,s:s}=t;return n===s.length&&s.push({current:e}),s[t.i++]},e.useState=e=>x(C,W,L,(e=>S($,e))(e)),e.wait=g,e}({});

@@ -279,6 +279,7 @@ self.uhooksDOM = (function (exports) {

var call = i === s.length;
info.i++;
if (call) {
if (!fx.has(h)) fx.set(h, new Set());
s.push({
s[i] = {
$: callback,

@@ -288,7 +289,8 @@ _: guards,

h: h
});
};
}
var effect = s[info.i++];
if (call || !guards || guards.some(different, effect._)) stack.push(effect);
if (call || !guards || guards.some(different, s[i]._)) stack.push(s[i]);
s[i].$ = callback;
s[i]._ = guards;
};

@@ -295,0 +297,0 @@ };

self.uhooksDOM=function(n){"use strict";
/*! (c) Andrea Giammarchi - ISC */var e={};e.CustomEvent="function"==typeof CustomEvent?CustomEvent:function(n){return e[n]=new e("").constructor[n],e;function e(n,e){e||(e={});var t=document.createEvent("CustomEvent");return t.initCustomEvent(n,!!e.bubbles,!!e.cancelable,e.detail),t}}("prototype");var t=e.CustomEvent,r=function(n,e,t,r){var o=new WeakMap,i=new WeakMap,c=new WeakMap,a=function(n){return o.has(n)},f=function(n){a(n)&&(s(n,n.removeEventListener,o.get(n)),o.delete(n))},s=function(n,e,t){e.call(n,"disconnected",t),e.call(n,"connected",t)},l=function(n,e,t,r){for(var u=n.length,o=0;o<u;o++)h(n[o],e,t,r)},h=function(n,r,u,o){a(n)&&!u.has(n)&&(o.delete(n),u.set(n,0),n.dispatchEvent(new(t||CustomEvent)(r))),l(n[e||"children"]||[],r,u,o)},v=new(r||MutationObserver)((function(n){for(var e=n.length,t=0;t<e;t++){var r=n[t],u=r.removedNodes,o=r.addedNodes;l(u,"disconnected",c,i),l(o,"connected",i,c)}}));return v.observe(n||document,{subtree:!0,childList:!0}),{has:a,connect:function(n,e){f(n),(e||(e={})).handleEvent||(e.handleEvent=u),s(n,n.addEventListener,e),o.set(n,e)},disconnect:f,kill:function(){v.disconnect()}}};function u(n){n.type in this&&this[n.type](n)}var o="function"==typeof Promise?Promise:function(n){var e,t=[],r=0;return n((function(n){e=n,r=1,t.splice(0).forEach(u)})),{then:u};function u(n){return r?setTimeout(n,0,e):t.push(n),this}},i=null,c=new Set,a=new WeakMap,f=function(n){var e=n.$,t=n.r,r=n.h;y(t)&&(l.get(r).delete(n),t()),y(n.r=e())&&l.get(r).add(n)},s=function(){var n=c;c=new Set,n.forEach((function(n){var e=n.h,t=n.c,r=n.a;n.e&&e.apply(t,r)}))},l=new WeakMap,h=[],v=[];function d(n,e){return n!==this[e]}var p=function(n){var e=l.get(n);e&&w.then((function(){e.forEach((function(n){n.r(),n.r=null})),e.clear()}))},E=function(){return a.get(i)},m=function(n){return l.has(n)},y=function(n){return"function"==typeof n},w=new o((function(n){return n()}));function g(n){var e=this._;this.value!==n&&(this._=new Set,this.value=n,e.forEach((function(n){var e=n.h,t=n.c,r=n.a;e.apply(t,r)})))}var b=function(n,e){var t=E(),r=t.i,u=t.s;return r!==u.length&&e&&!e.some(d,u[r]._)||(u[r]={$:n(),_:e}),u[t.i++].$},C=function(n){return function(e,t){var r=E(),u=r.i,o=r.s,i=r.h,c=u===o.length;c&&(l.has(i)||l.set(i,new Set),o.push({$:e,_:t,r:null,h:i}));var a=o[r.i++];(c||!t||t.some(d,a._))&&n.push(a)}},k=C(h),M=C(v),$=function(n,e){return y(e)?e(n):e},_=function(n,e,t){var r=E(),u=r.i,o=r.s;u===o.length&&o.push({$:y(t)?t(e):$(void 0,e),set:function(e){o[u].$=n(o[u].$,e),function(n){c.has(n)||(n.e=1,c.add(n),w.then(s))}(r)}});var i=o[r.i++];return[i.$,i.set]},S=null,W=null,L=null,x=new WeakMap,O=function(n,e,t,r){return n?[r[0],function(u){x.has(n)||(x.set(n,0),w.then((function(){x.delete(n),n.apply(e,t)}))),r[1](u)}]:r},T=function(n,e){return function(n){var e={h:t,c:null,a:null,e:0,i:0,s:[]};return a.set(t,e),t;function t(){var r=i;i=t,e.e=e.i=0;try{return n.apply(e.c=this,e.a=arguments)}finally{i=r,h.length&&w.then(h.forEach.bind(h.splice(0),f)),v.length&&v.splice(0).forEach(f)}}}(e?function e(){var t=S,r=W,u=L;S=e,W=this,L=arguments;try{return n.apply(W,L)}finally{S=t,W=r,L=u}}:n)},D=null,N=function(n){var e=n.firstChild;if(e&&1!==e.nodeType&&!(e=e.nextElementSibling))throw"unobservable";return e},P=function n(e){var t=e.nodeType;if(t)return 1===t?e:N(e);var r=e.valueOf();return r!==e?n(r):N(r)};return n.createContext=function(n){return{_:new Set,provide:g,value:n}},n.hooked=function(n,e){var u=T(n,e);return function(){var n=u.apply(this,arguments);if(m(u)){var e=P(n);D||(D=r(e.ownerDocument,"children",t)),D.has(e)||D.connect(e,{disconnected:function(){p(u)}})}return n}},n.useCallback=function(n,e){return b((function(){return n}),e)},n.useContext=function(n){var e=n._,t=n.value;return e.add(E()),t},n.useEffect=k,n.useLayoutEffect=M,n.useMemo=b,n.useReducer=function(n,e,t){return O(S,W,L,_(n,e,t))},n.useRef=function(n){var e=E(),t=e.i,r=e.s;return t===r.length&&r.push({current:n}),r[e.i++]},n.useState=function(n){return O(S,W,L,function(n){return _($,n)}(n))},n.wait=w,n}({});
/*! (c) Andrea Giammarchi - ISC */var e={};e.CustomEvent="function"==typeof CustomEvent?CustomEvent:function(n){return e[n]=new e("").constructor[n],e;function e(n,e){e||(e={});var t=document.createEvent("CustomEvent");return t.initCustomEvent(n,!!e.bubbles,!!e.cancelable,e.detail),t}}("prototype");var t=e.CustomEvent,r=function(n,e,t,r){var o=new WeakMap,i=new WeakMap,c=new WeakMap,a=function(n){return o.has(n)},f=function(n){a(n)&&(s(n,n.removeEventListener,o.get(n)),o.delete(n))},s=function(n,e,t){e.call(n,"disconnected",t),e.call(n,"connected",t)},l=function(n,e,t,r){for(var u=n.length,o=0;o<u;o++)h(n[o],e,t,r)},h=function(n,r,u,o){a(n)&&!u.has(n)&&(o.delete(n),u.set(n,0),n.dispatchEvent(new(t||CustomEvent)(r))),l(n[e||"children"]||[],r,u,o)},v=new(r||MutationObserver)((function(n){for(var e=n.length,t=0;t<e;t++){var r=n[t],u=r.removedNodes,o=r.addedNodes;l(u,"disconnected",c,i),l(o,"connected",i,c)}}));return v.observe(n||document,{subtree:!0,childList:!0}),{has:a,connect:function(n,e){f(n),(e||(e={})).handleEvent||(e.handleEvent=u),s(n,n.addEventListener,e),o.set(n,e)},disconnect:f,kill:function(){v.disconnect()}}};function u(n){n.type in this&&this[n.type](n)}var o="function"==typeof Promise?Promise:function(n){var e,t=[],r=0;return n((function(n){e=n,r=1,t.splice(0).forEach(u)})),{then:u};function u(n){return r?setTimeout(n,0,e):t.push(n),this}},i=null,c=new Set,a=new WeakMap,f=function(n){var e=n.$,t=n.r,r=n.h;y(t)&&(l.get(r).delete(n),t()),y(n.r=e())&&l.get(r).add(n)},s=function(){var n=c;c=new Set,n.forEach((function(n){var e=n.h,t=n.c,r=n.a;n.e&&e.apply(t,r)}))},l=new WeakMap,h=[],v=[];function d(n,e){return n!==this[e]}var p=function(n){var e=l.get(n);e&&w.then((function(){e.forEach((function(n){n.r(),n.r=null})),e.clear()}))},E=function(){return a.get(i)},m=function(n){return l.has(n)},y=function(n){return"function"==typeof n},w=new o((function(n){return n()}));function g(n){var e=this._;this.value!==n&&(this._=new Set,this.value=n,e.forEach((function(n){var e=n.h,t=n.c,r=n.a;e.apply(t,r)})))}var b=function(n,e){var t=E(),r=t.i,u=t.s;return r!==u.length&&e&&!e.some(d,u[r]._)||(u[r]={$:n(),_:e}),u[t.i++].$},C=function(n){return function(e,t){var r=E(),u=r.i,o=r.s,i=r.h,c=u===o.length;r.i++,c&&(l.has(i)||l.set(i,new Set),o[u]={$:e,_:t,r:null,h:i}),(c||!t||t.some(d,o[u]._))&&n.push(o[u]),o[u].$=e,o[u]._=t}},k=C(h),M=C(v),$=function(n,e){return y(e)?e(n):e},_=function(n,e,t){var r=E(),u=r.i,o=r.s;u===o.length&&o.push({$:y(t)?t(e):$(void 0,e),set:function(e){o[u].$=n(o[u].$,e),function(n){c.has(n)||(n.e=1,c.add(n),w.then(s))}(r)}});var i=o[r.i++];return[i.$,i.set]},S=null,W=null,L=null,x=new WeakMap,O=function(n,e,t,r){return n?[r[0],function(u){x.has(n)||(x.set(n,0),w.then((function(){x.delete(n),n.apply(e,t)}))),r[1](u)}]:r},T=function(n,e){return function(n){var e={h:t,c:null,a:null,e:0,i:0,s:[]};return a.set(t,e),t;function t(){var r=i;i=t,e.e=e.i=0;try{return n.apply(e.c=this,e.a=arguments)}finally{i=r,h.length&&w.then(h.forEach.bind(h.splice(0),f)),v.length&&v.splice(0).forEach(f)}}}(e?function e(){var t=S,r=W,u=L;S=e,W=this,L=arguments;try{return n.apply(W,L)}finally{S=t,W=r,L=u}}:n)},D=null,N=function(n){var e=n.firstChild;if(e&&1!==e.nodeType&&!(e=e.nextElementSibling))throw"unobservable";return e},P=function n(e){var t=e.nodeType;if(t)return 1===t?e:N(e);var r=e.valueOf();return r!==e?n(r):N(r)};return n.createContext=function(n){return{_:new Set,provide:g,value:n}},n.hooked=function(n,e){var u=T(n,e);return function(){var n=u.apply(this,arguments);if(m(u)){var e=P(n);D||(D=r(e.ownerDocument,"children",t)),D.has(e)||D.connect(e,{disconnected:function(){p(u)}})}return n}},n.useCallback=function(n,e){return b((function(){return n}),e)},n.useContext=function(n){var e=n._,t=n.value;return e.add(E()),t},n.useEffect=k,n.useLayoutEffect=M,n.useMemo=b,n.useReducer=function(n,e,t){return O(S,W,L,_(n,e,t))},n.useRef=function(n){var e=E(),t=e.i,r=e.s;return t===r.length&&r.push({current:n}),r[e.i++]},n.useState=function(n){return O(S,W,L,function(n){return _($,n)}(n))},n.wait=w,n}({});
{
"name": "uhooks-dom",
"version": "0.1.8",
"version": "0.1.9",
"description": "A uhooks + uconnect based alternative to dom-augmentor",

@@ -46,3 +46,3 @@ "main": "./cjs/index.js",

"uconnect": "^0.2.7",
"uhooks-fx": "^0.1.5"
"uhooks-fx": "^0.1.6"
},

@@ -49,0 +49,0 @@ "repository": {

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