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.2.0 to 0.2.1

4

async.js

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

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

@@ -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&&E.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,g=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&&E.then(h.forEach.bind(h.splice(0),a)),d.length&&d.splice(0).forEach(a)}}},E=new o((e=>e()));function k(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 m=(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;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(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),E.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,r=new WeakMap,l=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",l,r),h(s,"connected",r,l)}}));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,r=new Set;const l=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=r;r=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&&E.then((()=>{t.forEach((e=>{e.r(),e.r=null})),t.clear()}))},v=()=>l.get(c),w=e=>i.has(e),y=e=>"function"==typeof e,g=e=>{const t={h:n,c:null,a:null,e:0,i:0,s:[]};return l.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&&E.then(h.forEach.bind(h.splice(0),a)),d.length&&d.splice(0).forEach(a)}}},E=new o((e=>e()));function k(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 m=(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:r}=s,l=o===c.length;s.i++,l&&(i.has(r)||i.set(r,new Set),c[o]={$:t,_:n,r:null,h:r}),(l||!n||n.some(p,c[o]._))&&e.push(c[o]),c[o].$=t,c[o]._=n},_=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=>{r.has(e)||(e.e=1,r.add(e),E.then(u))})(s)}});const{$:l,set:a}=c[s.i++];return[l,a]};
/*! (c) Andrea Giammarchi - ISC */
let W=null,C=null,L=null;const O=new WeakMap,x=new WeakMap,D=(e,t,n,s)=>{const o=o=>{O.has(e)||(O.set(e,0),E.then((()=>{O.delete(e),e.apply(t,n)}))),s(o)};return x.set(s,o),o},N=(e,t,n,s)=>e?[s[0],x.get(s[1])||D(e,t,n,s[1])]:s,P=(e,t)=>g(t?function t(){const[n,s,o]=[W,C,L];[W,C,L]=[t,this,arguments];try{return e.apply(C,L)}finally{[W,C,L]=[n,s,o]}}:e);
let W=null,C=null,L=null;const O=new WeakMap,x=new WeakMap,D=(e,t,n,s)=>{const o=o=>{O.has(e)||(O.set(e,0),E.then((()=>{O.delete(e),e.apply(t,n)}))),s(o)};return x.set(s,o),o},N=(e,t,n,s)=>e?[s[0],x.get(s[1])||D(e,t,n,s[1])]:s,P=(e,t)=>{const n=g(t?function(){const[t,s,o]=[W,C,L];[W,C,L]=[n,this,arguments];try{return e.apply(C,L)}finally{[W,C,L]=[t,s,o]}}:e);return n};
/*! (c) Andrea Giammarchi - ISC */
let R=null;const T=({firstChild:e})=>{if(e&&1!==e.nodeType&&!(e=e.nextElementSibling))throw"unobservable";return e},j=e=>{const{nodeType:t}=e;if(t)return 1===t?e:T(e);{const t=e.valueOf();return t!==e?j(t):T(t)}};return e.createContext=e=>({_:new Set,provide:k,value:e}),e.hooked=(e,s)=>{const o=P(e,s);return function(){const e=o.apply(this,arguments);if(w(o)){const s=j(e);R||(R=n(s.ownerDocument,"children",t)),R.has(s)||R.connect(s,{disconnected(){f(o)}})}return e}},e.useCallback=(e,t)=>m((()=>e),t),e.useContext=({_:e,value:t})=>(e.add(v()),t),e.useEffect=_,e.useLayoutEffect=b,e.useMemo=m,e.useReducer=(e,t,n)=>N(W,C,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=>N(W,C,L,(e=>S($,e))(e)),e.wait=E,e}({});

@@ -363,5 +363,5 @@ self.uhooksDOM = (function (exports) {

var hooked$1 = function hooked$1(callback, outer) {
return hooked(outer ?
var hook = hooked(outer ?
/*async*/
function hook() {
function () {
var ph = h$1,

@@ -385,2 +385,3 @@ pc = c,

} : callback);
return hook;
};

@@ -387,0 +388,0 @@ var useReducer$1 = function useReducer$1(reducer, value, init) {

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;w(t)&&(l.get(r).delete(n),t()),w(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&&y.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)},w=function(n){return"function"==typeof n},y=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++].$},k=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}},C=k(h),M=k(v),$=function(n,e){return w(e)?e(n):e},_=function(n,e,t){var r=E(),u=r.i,o=r.s;u===o.length&&o.push({$:w(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),y.then(s))}(r)}});var i=o[r.i++];return[i.$,i.set]},S=null,W=null,L=null,x=new WeakMap,O=new WeakMap,T=function(n,e,t,r){var u=function(u){x.has(n)||(x.set(n,0),y.then((function(){x.delete(n),n.apply(e,t)}))),r(u)};return O.set(r,u),u},D=function(n,e,t,r){return n?[r[0],O.get(r[1])||T(n,e,t,r[1])]:r},N=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&&y.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)},P=null,R=function(n){var e=n.firstChild;if(e&&1!==e.nodeType&&!(e=e.nextElementSibling))throw"unobservable";return e},j=function n(e){var t=e.nodeType;if(t)return 1===t?e:R(e);var r=e.valueOf();return r!==e?n(r):R(r)};return n.createContext=function(n){return{_:new Set,provide:g,value:n}},n.hooked=function(n,e){var u=N(n,e);return function(){var n=u.apply(this,arguments);if(m(u)){var e=j(n);P||(P=r(e.ownerDocument,"children",t)),P.has(e)||P.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=C,n.useLayoutEffect=M,n.useMemo=b,n.useReducer=function(n,e,t){return D(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 D(S,W,L,function(n){return _($,n)}(n))},n.wait=y,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++)v(n[o],e,t,r)},v=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)},h=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 h.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(){h.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;w(t)&&(l.get(r).delete(n),t()),w(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,v=[],h=[];function d(n,e){return n!==this[e]}var p=function(n){var e=l.get(n);e&&y.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)},w=function(n){return"function"==typeof n},y=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++].$},k=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}},C=k(v),M=k(h),$=function(n,e){return w(e)?e(n):e},_=function(n,e,t){var r=E(),u=r.i,o=r.s;u===o.length&&o.push({$:w(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),y.then(s))}(r)}});var i=o[r.i++];return[i.$,i.set]},S=null,W=null,L=null,x=new WeakMap,O=new WeakMap,T=function(n,e,t,r){var u=function(u){x.has(n)||(x.set(n,0),y.then((function(){x.delete(n),n.apply(e,t)}))),r(u)};return O.set(r,u),u},D=function(n,e,t,r){return n?[r[0],O.get(r[1])||T(n,e,t,r[1])]:r},N=function(n,e){var t=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,v.length&&y.then(v.forEach.bind(v.splice(0),f)),h.length&&h.splice(0).forEach(f)}}}(e?function(){var e=S,r=W,u=L;S=t,W=this,L=arguments;try{return n.apply(W,L)}finally{S=e,W=r,L=u}}:n);return t},P=null,R=function(n){var e=n.firstChild;if(e&&1!==e.nodeType&&!(e=e.nextElementSibling))throw"unobservable";return e},j=function n(e){var t=e.nodeType;if(t)return 1===t?e:R(e);var r=e.valueOf();return r!==e?n(r):R(r)};return n.createContext=function(n){return{_:new Set,provide:g,value:n}},n.hooked=function(n,e){var u=N(n,e);return function(){var n=u.apply(this,arguments);if(m(u)){var e=j(n);P||(P=r(e.ownerDocument,"children",t)),P.has(e)||P.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=C,n.useLayoutEffect=M,n.useMemo=b,n.useReducer=function(n,e,t){return D(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 D(S,W,L,function(n){return _($,n)}(n))},n.wait=y,n}({});
{
"name": "uhooks-dom",
"version": "0.2.0",
"version": "0.2.1",
"description": "A uhooks + uconnect based alternative to dom-augmentor",

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

"uconnect": "^0.2.7",
"uhooks-fx": "^0.2.0"
"uhooks-fx": "^0.2.1"
},

@@ -55,0 +55,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