New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@locker/near-membrane-base

Package Overview
Dependencies
Maintainers
7
Versions
121
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@locker/near-membrane-base - npm Package Compare versions

Comparing version 0.7.1 to 0.7.2

2

lib/index.min.js

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

function t(t,e,r,n,o){const{distortionCallback:i=(t=>t),instrumentation:s}=o||{__proto__:null},{eval:a}=globalThis,{defineProperty:c,getOwnPropertyDescriptor:l,setPrototypeOf:u,apply:p,construct:y,deleteProperty:f,get:h,set:d,has:g,getPrototypeOf:b,isExtensible:P,ownKeys:T,preventExtensions:m}=Reflect,{freeze:v,seal:w,isFrozen:E,isSealed:I,defineProperties:x}=Object,{isArray:O}=Array,{map:S,push:k,slice:A}=Array.prototype,{revocable:D}=Proxy,{set:R,get:G}=WeakMap.prototype,F=TypeError,{hasOwnProperty:_}=Object.prototype,N=new WeakMap,U=Symbol.for("@@lockerLiveValue"),C=`to:${e}`,V=`from:${e}`,z=(t,...e)=>{const r=p(A,t,[0]),{length:n}=e;for(let t=0;t<n;t+=1){const n=e[t];p(k,r,O(n)?n:[n])}return r};let j,K,B,L,M,$,H,W,J,q,Q,X,Y,Z,tt,et,rt;function nt(e){return e===t}function ot(t){return function(...e){try{return p(t,this,e)}catch(t){const e=ct();if(e)throw e;throw new F(t.message)}}}function it(t,e){return s?function(...r){let n;s.start(e);try{n=p(t,this,r)}finally{s.end(e)}return n}:t}function st(t){const e=ht(t);return"function"==typeof e&&e(),t}function at(t){const e=()=>{j=t};return e["[[OriginalTarget]]"]=t,e}function ct(){const t=j;return j=void 0,t}function lt(t,e,r,n,o,i){const s={__proto__:null};return nt(t)||(s.configurable=!!t),nt(e)||(s.enumerable=!!e),nt(r)||(s.writable=!!r),nt(o)||(s.get=ft(o)),nt(i)||(s.set=ft(i)),nt(n)||(s.value=ft(n)),s}function ut(t,e,r){let n;H(e,r,((...t)=>{n=p(lt,void 0,t)})),void 0!==n&&c(t,r,n)}function pt(t,e){let r=[];Q(e,((...t)=>{r=t}));const n={__proto__:null};let o;const i=(...t)=>{o=p(lt,void 0,t)};for(let t=0,s=r.length;t<s;t+=1){const s=r[t];H(e,s,i),n[s]=o}x(t,n)}function yt(t){let e=p(G,N,[t]);if(e)return e;let r,n=et.None;const o=function(t){let e;try{e=i(t)}finally{if(e!==t&&typeof e!=typeof t)throw new F(`Invalid distortion ${t}.`)}return e}(t);if("function"==typeof o){n|=et.IsFunction;try{n|=+!("prototype"in o)&&et.IsArrowFunction}catch{}try{r=l(o,"name")?.value}catch{}}else{let t=!1;try{t=O(o)}catch{n|=et.Revoked}n|=+t&&et.IsArray,n|=+!t&&et.IsObject}const s=at(o);return e=K(s,n,r),p(R,N,[t,e]),e}function ft(t){return"function"==typeof t?(t(),ct()):t}function ht(t){var e;if(void 0!==t)return null===(e=t)||"function"!=typeof e&&"object"!=typeof e?t:yt(t)}function dt(e){const{configurable:r,enumerable:n,writable:o,value:i,get:s,set:a}=e;return["configurable"in e?!!r:t,"enumerable"in e?!!n:t,"writable"in e?!!o:t,"value"in e?ht(i):t,"get"in e?ht(s):t,"set"in e?ht(a):t]}function gt(t,e){pt(t,e);const r=W(e);u(t,ft(r)),m(t)}!function(t){t[t.None=0]="None",t[t.IsArray=1]="IsArray",t[t.IsFunction=2]="IsFunction",t[t.IsObject=4]="IsObject",t[t.IsArrowFunction=8]="IsArrowFunction",t[t.Revoked=16]="Revoked"}(et||(et={})),function(t){t[t.None=0]="None",t[t.IsNotExtensible=1]="IsNotExtensible",t[t.IsSealed=2]="IsSealed",t[t.IsFrozen=4]="IsFrozen",t[t.Revoked=16]="Revoked"}(rt||(rt={})),p(_,Error,["stackTraceLimit"])&&"number"==typeof Error.stackTraceLimit&&(Error.stackTraceLimit*=2);class bt{constructor(t,n,o){this.color=e,this.apply=function(t,e,r){const{targetPointer:n}=this,o=ht(e),i=p(S,r,[ht]),s=z([n,o],i);return ft(p(B,void 0,s))},this.construct=function(t,e,r){const{targetPointer:n}=this;if(void 0===r)throw new F;const o=ht(r),i=p(S,e,[ht]),s=z([n,o],i);return ft(p(L,void 0,s))},this.targetPointer=t;const i=function(t,e){let r;return t&et.IsFunction?(r=t&et.IsArrowFunction?()=>{}:function(){},c(r,"name",{value:e,configurable:!0})):r=t&et.IsArray?[]:{},r}(n,o),{proxy:s,revoke:a}=D(i,this);this.proxy=s,this.revoke=a,this.ownKeys=bt.defaultOwnKeysTrap,this.isExtensible=bt.defaultIsExtensibleTrap,this.getOwnPropertyDescriptor=bt.defaultGetOwnPropertyDescriptorTrap,this.getPrototypeOf=bt.defaultGetPrototypeOfTrap,this.get=bt.defaultGetTrap,this.has=bt.defaultHasTrap,this.setPrototypeOf=bt.defaultSetPrototypeOfTrap,this.set=bt.defaultSetTrap,this.deleteProperty=bt.defaultDeletePropertyTrap,this.preventExtensions=bt.defaultPreventExtensionsTrap,this.defineProperty=bt.defaultDefinePropertyTrap,n&et.Revoked&&a(),r||v(this)}isTargetMarkAsDynamic(){const{targetPointer:t}=this;try{return J(t,U)}catch{}return!1}makeProxyDynamic(){this.set=bt.dynamicSetTrap,this.deleteProperty=bt.dynamicDeletePropertyTrap,this.setPrototypeOf=bt.dynamicSetPrototypeOfTrap,this.preventExtensions=bt.dynamicPreventExtensionsTrap,this.defineProperty=bt.dynamicDefinePropertyTrap,v(this)}makeProxyStatic(t){const{targetPointer:e}=this,r=Z(e);if(r&rt.Revoked)return void this.revoke();let n=null;try{n=W(e),u(t,ft(n))}catch{return void this.revoke()}pt(t,e),r&rt.IsFrozen?v(t):r&rt.IsSealed?w(t):r&rt.IsNotExtensible&&m(t),this.getOwnPropertyDescriptor=l,this.getPrototypeOf=b,this.get=h,this.has=g,this.ownKeys=T,this.isExtensible=P,this.set=d,this.defineProperty=c,this.deleteProperty=f,this.setPrototypeOf=u,this.preventExtensions=m,v(this)}makeProxyUnambiguous(t){this.isTargetMarkAsDynamic()?this.makeProxyDynamic():this.makeProxyStatic(t)}static dynamicDefinePropertyTrap(t,e,r){const{targetPointer:n}=this,o=dt(r),i=[n,e];p(k,i,o);const s=p(M,void 0,i);if(s){const[r]=o;!1===r&&ut(t,n,e)}return s}static dynamicDeletePropertyTrap(t,e){const{targetPointer:r}=this;return $(r,e)}static dynamicGetOwnPropertyDescriptorTrap(t,e){const{targetPointer:r}=this;let n;return H(r,e,((...t)=>{n=p(lt,void 0,t)})),void 0===n||!1===n.configurable&&ut(t,r,e),n}static dynamicGetPrototypeOfTrap(t){const{targetPointer:e}=this;return ft(W(e))}static dynamicIsExtensibleTrap(t){if(!P(t))return!1;const{targetPointer:e}=this;return!!q(e)||(gt(t,e),!1)}static dynamicOwnKeysTrap(t){const{targetPointer:e}=this;let r=[];return Q(e,((...t)=>{r=t})),r}static dynamicPreventExtensionsTrap(t){const{targetPointer:e}=this;if(P(t)){if(!X(e))return q(e)||gt(t,e),!1;gt(t,e)}return!0}static dynamicSetPrototypeOfTrap(t,e){const{targetPointer:r}=this,n=ht(e);return Y(r,n)}static dynamicHasTrap(t,e){const{targetPointer:r}=this;if(tt(r,e))return!0;const n=W(r);if(null===n)return!1;let o=ft(n);for(;null!==o;){if(p(_,o,[e]))return!0;o=b(o)}return!1}static dynamicGetTrap(t,e,r){let n=this.proxy;for(;null!==n;){if(p(_,n,[e])){const{get:t,value:o}=l(n,e);return t?p(t,r,[]):o}n=b(n)}}static dynamicSetTrap(e,r,n,o){const{targetPointer:i}=this;let s=this.proxy;for(;null!==s;){if(p(_,s,[r])){const{set:t,get:e}=l(s,r);return t?(p(t,o,[n]),!0):!e&&c(s,r,{value:n})}s=b(s)}const a=ht(n);return M(i,r,!0,!0,!0,a,t,t)}static pendingSetPrototypeOfTrap(t,e){return this.makeProxyUnambiguous(t),this.setPrototypeOf?.(t,e)}static pendingSetTrap(t,e,r,n){return this.makeProxyUnambiguous(t),this.set?.(t,e,r,n)}static pendingDeletePropertyTrap(t,e){return this.makeProxyUnambiguous(t),this.deleteProperty?.(t,e)}static pendingPreventExtensionsTrap(t){return this.makeProxyUnambiguous(t),this.preventExtensions?.(t)}static pendingDefinePropertyTrap(t,e,r){return this.makeProxyUnambiguous(t),this.defineProperty?.(t,e,r)}}bt.defaultOwnKeysTrap=bt.dynamicOwnKeysTrap,bt.defaultIsExtensibleTrap=bt.dynamicIsExtensibleTrap,bt.defaultGetOwnPropertyDescriptorTrap=bt.dynamicGetOwnPropertyDescriptorTrap,bt.defaultGetPrototypeOfTrap=bt.dynamicGetPrototypeOfTrap,bt.defaultGetTrap=bt.dynamicGetTrap,bt.defaultHasTrap=bt.dynamicHasTrap,bt.defaultSetPrototypeOfTrap=r?bt.pendingSetPrototypeOfTrap:bt.dynamicSetPrototypeOfTrap,bt.defaultSetTrap=r?bt.pendingSetTrap:bt.dynamicSetTrap,bt.defaultDeletePropertyTrap=r?bt.pendingDeletePropertyTrap:bt.dynamicDeletePropertyTrap,bt.defaultPreventExtensionsTrap=r?bt.pendingPreventExtensionsTrap:bt.dynamicPreventExtensionsTrap,bt.defaultDefinePropertyTrap=r?bt.pendingDefinePropertyTrap:bt.dynamicDefinePropertyTrap,u(bt.prototype,null),v(bt.prototype);const Pt=[],Tt=[];["AggregateError","Array","Error","EvalError","Function","Object","Proxy","RangeError","ReferenceError","SyntaxError","TypeError","URIError"].forEach((t=>{const e=globalThis[t];if(!e)return;const r=at(e);Tt.push(e),Pt.push(r);const n=e.prototype;if(n){const t=at(n);Tt.push(n),Pt.push(t)}}));const mt=[],vt=[];if(globalThis.EventTarget&&globalThis instanceof EventTarget){const{document:t}=globalThis;mt.push(at(t)),vt.push(t);const e=b(globalThis);mt.push(at(e)),vt.push(e);const r=b(e);mt.push(at(r)),vt.push(r);const n=b(r);mt.push(at(n)),vt.push(n)}function wt(t,e,r){const n=yt(t);let o;const i=(...t)=>{o=p(lt,void 0,t)};return{enumerable:r,configurable:!0,writable:!0,get:()=>(H(n,e,i),void 0===o?delete t[e]:c(t,e,o),h(t,e)),set(r){H(n,e,i),void 0===o?delete t[e]:c(t,e,o),d(t,e,r)}}}return n(ct,ht,(t=>{try{a(t)}catch(t){throw st(t)}}),((t,...e)=>{t();const r=ct();for(let t=0,n=e.length;t<n;t+=2){const n=e[t],o=wt(r,n,!!e[t+1]);try{c(r,n,o)}catch{}}}),((t,e,r)=>{const{proxy:n}=new bt(t,e,r);return p(R,N,[n,t]),at(n)}),it(((t,e,...r)=>{t();const n=ct(),o=ft(e),i=p(S,r,[ft]);let s;try{s=p(n,o,i)}catch(t){throw st(t)}return ht(s)}),C),it(((t,e,...r)=>{t();const n=ct(),o=ft(e),i=p(S,r,[ft]);let s;try{s=y(n,i,o)}catch(t){throw st(t)}return ht(s)}),C),it(((t,e,...r)=>{t();const n=ct(),o=p(lt,void 0,r);try{return c(n,e,o)}catch(t){throw st(t)}}),C),it(((t,e)=>{t();const r=ct();try{return f(r,e)}catch(t){throw st(t)}}),C),it(((t,e,r)=>{t();const n=ct();let o;try{o=l(n,e)}catch(t){throw st(t)}if(!o)return;const i=dt(o);p(r,void 0,i)}),C),it((t=>{t();const e=ct();let r;try{r=b(e)}catch(t){throw st(t)}return ht(r)}),C),it(((t,e)=>{t();const r=ct();try{return g(r,e)}catch(t){throw st(t)}}),C),it((t=>{t();const e=ct();try{return P(e)}catch(t){throw st(t)}}),C),it(((t,e)=>{t();const r=ct();let n;try{n=T(r)}catch(t){throw st(t)}p(e,void 0,n)}),C),it((t=>{t();const e=ct();try{return m(e)}catch(t){throw st(t)}}),C),it(((t,e)=>{t();const r=ct(),n=ft(e);try{return u(r,n)}catch(t){throw st(t)}}),C),it((t=>{t();const e=ct();let r=rt.None;try{E(e)?r|=rt.IsSealed&rt.IsFrozen&rt.IsNotExtensible:I(e)?r|=rt.IsSealed:P(e)||(r|=rt.IsNotExtensible),O(e)}catch{r|=rt.Revoked}return r}),C),it(((t,e)=>{t();const r=ct();try{return p(_,r,[e])}catch(t){throw st(t)}}),C),((...t)=>{for(let e=0,r=Tt.length;e<r;e+=1)null!==Tt[e]&&p(R,N,[Tt[e],t[e]])}),((...t)=>{for(let e=0,r=vt.length;e<r;e+=1)null!==vt[e]&&p(R,N,[vt[e],t[e]])}),at(globalThis)),(...t)=>{const[,,,,e,r,n,o,i,s,a,c,l,u,y,f,h,d,g,b,P]=t;K=e,B=ot(it(r,V)),L=ot(it(n,V)),M=ot(it(o,V)),$=ot(it(i,V)),H=ot(it(s,V)),W=ot(it(a,V)),J=ot(it(c,V)),q=ot(it(l,V)),Q=ot(it(u,V)),X=ot(it(y,V)),Y=ot(it(f,V)),Z=ot(it(h,V)),tt=ot(it(d,V)),p(R,N,[globalThis,P]),p(g,void 0,Pt),p(b,void 0,mt)}}const e=`(function(){'use strict';return (${t.toString()})})()`,r=/^\d+$/,n=Symbol("membrane@undefined"),{test:o}=RegExp.prototype,i=Error,{keys:s,propertyIsEnumerable:a}=Object,{apply:c,ownKeys:l}=Reflect,{includes:u,push:p}=Array.prototype;function y(t,e){return c(o,t,[e])}class f{constructor(t){if(void 0===t)throw new i("Missing VirtualEnvironmentOptions options bag.");const{blueConnector:e,redConnector:r,distortionCallback:o}=t;let s,a;const l=e(n,"blue",false,((...t)=>{s=t}),{distortionCallback:o}),u=r(n,"red",true,((...t)=>{a=t}));c(l,void 0,a),c(u,void 0,s);const[p,y]=s;this.blueGetSelectedTarget=p,this.blueGetTransferableValue=y;const[,,f,h,,,,d,,,,,,,,g]=a;this.redCallableEvaluate=f,this.redCallableInstallLazyDescriptors=h,this.redCallableSetPrototypeOf=g,this.redCallableDefineProperty=d}evaluate(t){try{this.redCallableEvaluate(t)}catch(t){const e=this.blueGetSelectedTarget();if(e)throw e;throw t}}remap(t,e){const o=l(e),i=this.blueGetTransferableValue(t);for(let t=0,s=o.length;t<s;t+=1){const s=o[t];if("symbol"!=typeof s&&y(r,s))continue;const a={__proto__:null,...e[s]},c="configurable"in a?!!a.configurable:n,l="enumerable"in a?!!a.enumerable:n,u="writable"in a?!!a.writable:n,p="value"in a?this.blueGetTransferableValue(a.value):n,f="get"in a?this.blueGetTransferableValue(a.get):n,h="set"in a?this.blueGetTransferableValue(a.set):n;this.redCallableDefineProperty(i,s,c,l,u,p,f,h)}}lazyRemap(t,e){const n=s(t),o=[this.blueGetTransferableValue(t)];for(let i=0,s=e.length;i<s;i+=1){const s=e[i];if("symbol"!=typeof s&&y(r,s))continue;const l="symbol"==typeof s?c(a,t,[s]):c(u,n,[s]);c(p,o,[s,l])}c(this.redCallableInstallLazyDescriptors,void 0,o)}remapProto(t,e){const r=this.blueGetTransferableValue(t),n=this.blueGetTransferableValue(e);this.redCallableSetPrototypeOf(r,n)}}const{has:h}=Set.prototype,{apply:d,getOwnPropertyDescriptor:g,ownKeys:b}=Reflect;function P(t,e){return d(h,t,[e])}const T=new Set(["Infinity","NaN","undefined","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","AggregateError","Array","ArrayBuffer","BigInt","BigInt64Array","BigUint64Array","Boolean","DataView","Error","EvalError","FinalizationRegistry","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Number","Object","Proxy","RangeError","ReferenceError","RegExp","SharedArrayBuffer","String","Symbol","SyntaxError","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","URIError","WeakRef","Atomics","JSON","Math","Reflect","escape","unescape"]);function m(t){const e={__proto__:null},r=b(t);for(let n=0,o=r.length;n<o;n+=1){const o=r[n];P(T,o)||(e[o]=g(t,o))}return e}function v(t){return P(T,t)}export{f as VirtualEnvironment,m as getFilteredEndowmentDescriptors,t as init,e as initSourceTextInStrictMode,v as isIntrinsicGlobalName};
var t;function e(e,r,n=t.None,o,i){let a,s,l;!function(t){t[t.None=0]="None",t[t.MagicMarker=1]="MagicMarker"}(a||(a={})),function(t){t[t.None=0]="None",t[t.IsArray=1]="IsArray",t[t.IsFunction=2]="IsFunction",t[t.IsObject=4]="IsObject",t[t.IsArrowFunction=8]="IsArrowFunction",t[t.Revoked=16]="Revoked"}(s||(s={})),function(t){t[t.None=0]="None",t[t.IsNotExtensible=1]="IsNotExtensible",t[t.IsSealed=2]="IsSealed",t[t.IsFrozen=4]="IsFrozen",t[t.Revoked=16]="Revoked"}(l||(l={}));const{distortionCallback:c=(t=>t),instrumentation:u}=i||{__proto__:null},{eval:p}=globalThis,y=Array,{isArray:f}=Array,{push:h}=Array.prototype,{defineProperties:d,freeze:g,isFrozen:b,isSealed:P,seal:T}=Object,{hasOwnProperty:m}=Object.prototype,{revocable:v}=Proxy,{defineProperty:w,getOwnPropertyDescriptor:k,setPrototypeOf:E,apply:I,construct:x,deleteProperty:O,get:S,set:A,has:G,getPrototypeOf:M,isExtensible:D,ownKeys:R,preventExtensions:C}=Reflect,N=TypeError,{get:F,set:_}=WeakMap.prototype,U=new WeakMap,V=Symbol.for("@@lockerLiveValue"),L=Symbol.for("@@lockerMagicValue"),j=Symbol.for("@@membraneUndefinedValue"),z=`to:${e}`,K=`from:${e}`,B=n&a.MagicMarker;let $,H,W,J,q,Q,X,Y,Z,tt,et,rt,nt,ot,it;function at(t){return function(...e){try{return I(t,this,e)}catch(t){const e=ut();if(e)throw e;throw new N(t?.message)}}}function st(t,e){return u?function(...r){let n;u.start(e);try{n=I(t,this,r)}finally{u.end(e)}return n}:t}function lt(t){const e=gt(t);return"function"==typeof e&&e(),t}function ct(t){const e=()=>{$=t};return e["[[OriginalTarget]]"]=t,e}function ut(){const t=$;return $=void 0,t}function pt(t,e,r,n,o,i){const a={__proto__:null};return t!==j&&(a.configurable=!!t),e!==j&&(a.enumerable=!!e),r!==j&&(a.writable=!!r),o!==j&&(a.get=dt(o)),i!==j&&(a.set=dt(i)),n!==j&&(a.value=dt(n)),a}function yt(t,e,r){let n;X(e,r,((...t)=>{n=I(pt,void 0,t)})),void 0!==n&&w(t,r,n)}function ft(t,e){let r=[];et(e,((...t)=>{r=t}));const n={__proto__:null};let o;const i=(...t)=>{o=I(pt,void 0,t)};for(let t=0,a=r.length;t<a;t+=1){const a=r[t];X(e,a,i),n[a]=o}d(t,n)}function ht(t){let e=I(F,U,[t]);if(e)return e;let r,n=s.None;const o=function(t){let e;try{e=c(t)}finally{if(e!==t&&typeof e!=typeof t)throw new N(`Invalid distortion ${t}.`)}return e}(t);if("function"==typeof o){n|=s.IsFunction;try{n|=+!("prototype"in o)&&s.IsArrowFunction}catch{}try{r=k(o,"name")?.value}catch{}}else{let t=!1;try{t=f(o)}catch{n|=s.Revoked}n|=+t&&s.IsArray,n|=+!t&&s.IsObject}const i=ct(o);return e=H(i,n,r),I(_,U,[t,e]),e}function dt(t){return"function"==typeof t?(t(),ut()):t}function gt(t){var e;if(void 0!==t)return null===(e=t)||"function"!=typeof e&&"object"!=typeof e?t:ht(t)}function bt(t){const{configurable:e,enumerable:r,writable:n,value:o,get:i,set:a}=t;return["configurable"in t?!!e:j,"enumerable"in t?!!r:j,"writable"in t?!!n:j,"value"in t?gt(o):j,"get"in t?gt(i):j,"set"in t?gt(a):j]}function Pt(t,e){ft(t,e);const r=Y(e);E(t,dt(r)),C(t)}I(m,Error,["stackTraceLimit"])&&"number"==typeof Error.stackTraceLimit&&(Error.stackTraceLimit*=2);class Tt{constructor(t,n,o){this.color=e,this.targetMarkedAsMagic=!1,this.apply=function(t,e,r){const{targetPointer:n}=this,o=[n,gt(e)],{length:i}=r,{length:a}=o;o.length+=i;for(let t=0,e=i;t<e;t+=1)o[t+a]=gt(r[t]);return dt(I(W,void 0,o))},this.construct=function(t,e,r){const{targetPointer:n}=this;if(void 0===r)throw new N;const o=[n,gt(r)],{length:i}=e,{length:a}=o;o.length+=i;for(let t=0,r=i;t<r;t+=1)o[t+a]=gt(e[t]);return dt(I(J,void 0,o))},this.targetPointer=t;const i=function(t,e){let r;return t&s.IsFunction?(r=t&s.IsArrowFunction?()=>{}:function(){},w(r,"name",{value:e,configurable:!0})):r=t&s.IsArray?[]:{},r}(n,o),{proxy:a,revoke:l}=v(i,this);this.proxy=a,this.revoke=l,this.ownKeys=Tt.defaultOwnKeysTrap,this.isExtensible=Tt.defaultIsExtensibleTrap,this.getOwnPropertyDescriptor=Tt.defaultGetOwnPropertyDescriptorTrap,this.getPrototypeOf=Tt.defaultGetPrototypeOfTrap,this.get=Tt.defaultGetTrap,this.has=Tt.defaultHasTrap,this.setPrototypeOf=Tt.defaultSetPrototypeOfTrap,this.set=Tt.defaultSetTrap,this.deleteProperty=Tt.defaultDeletePropertyTrap,this.preventExtensions=Tt.defaultPreventExtensionsTrap,this.defineProperty=Tt.defaultDefinePropertyTrap,n&s.Revoked&&l(),r||g(this)}isTargetMarkedAsLive(){const{targetPointer:t}=this;try{return Z(t,V)}catch{}return!1}isTargetMarkedAsMagic(){if(B){const{targetPointer:t}=this;try{return Z(t,L)}catch{}}return!1}makeProxyDynamic(){this.set=Tt.dynamicSetTrap,this.deleteProperty=Tt.dynamicDeletePropertyTrap,this.setPrototypeOf=Tt.dynamicSetPrototypeOfTrap,this.preventExtensions=Tt.dynamicPreventExtensionsTrap,this.defineProperty=Tt.dynamicDefinePropertyTrap,this.targetMarkedAsMagic=this.isTargetMarkedAsMagic(),g(this)}makeProxyStatic(t){const{targetPointer:e}=this,r=ot(e);if(r&l.Revoked)return void this.revoke();let n=null;try{n=Y(e),E(t,dt(n))}catch{return void this.revoke()}ft(t,e),r&l.IsFrozen?g(t):r&l.IsSealed?T(t):r&l.IsNotExtensible&&C(t),this.getOwnPropertyDescriptor=k,this.getPrototypeOf=M,this.get=S,this.has=G,this.ownKeys=R,this.isExtensible=D,this.set=A,this.defineProperty=w,this.deleteProperty=O,this.setPrototypeOf=E,this.preventExtensions=C,g(this)}makeProxyUnambiguous(t){this.isTargetMarkedAsLive()?this.makeProxyDynamic():this.makeProxyStatic(t)}static dynamicDefinePropertyTrap(t,e,r){const{targetPointer:n}=this,o=bt(r),i=[n,e];I(h,i,o);const a=I(q,void 0,i);if(a){const[r]=o;!1===r&&yt(t,n,e)}return a}static dynamicDeletePropertyTrap(t,e){const{targetPointer:r}=this;return Q(r,e)}static dynamicGetOwnPropertyDescriptorTrap(t,e){const{targetPointer:r}=this;let n;return X(r,e,((...t)=>{n=I(pt,void 0,t)})),void 0===n||!1===n.configurable&&yt(t,r,e),n}static dynamicGetPrototypeOfTrap(t){const{targetPointer:e}=this;return dt(Y(e))}static dynamicIsExtensibleTrap(t){if(!D(t))return!1;const{targetPointer:e}=this;return!!tt(e)||(Pt(t,e),!1)}static dynamicOwnKeysTrap(t){const{targetPointer:e}=this;let r=[];return et(e,((...t)=>{r=t})),r}static dynamicPreventExtensionsTrap(t){const{targetPointer:e}=this;if(D(t)){if(!rt(e))return tt(e)||Pt(t,e),!1;Pt(t,e)}return!0}static dynamicSetPrototypeOfTrap(t,e){const{targetPointer:r}=this,n=gt(e);return nt(r,n)}static dynamicHasTrap(t,e){const{targetPointer:r}=this;if(it(r,e))return!0;const n=Y(r);if(null===n)return!1;let o=dt(n);for(;null!==o;){if(I(m,o,[e]))return!0;o=M(o)}return!1}static dynamicGetTrap(t,e,r){let n=this.proxy;for(;null!==n;){if(I(m,n,[e])){const{get:t,value:o}=k(n,e);return t?I(t,r,[]):o}n=M(n)}}static dynamicSetTrap(t,e,r,n){const{targetPointer:o}=this;let i=this.proxy;for(;null!==i;){if(I(m,i,[e])){const{get:t,set:o}=k(i,e);return o?(I(o,n,[r]),!0):!t&&(this.targetMarkedAsMagic?A(i,e,r,i):w(i,e,{value:r}))}i=M(i)}const a=gt(r);return q(o,e,!0,!0,!0,a,j,j)}static pendingSetPrototypeOfTrap(t,e){return this.makeProxyUnambiguous(t),this.setPrototypeOf?.(t,e)}static pendingSetTrap(t,e,r,n){return this.makeProxyUnambiguous(t),this.set?.(t,e,r,n)}static pendingDeletePropertyTrap(t,e){return this.makeProxyUnambiguous(t),this.deleteProperty?.(t,e)}static pendingPreventExtensionsTrap(t){return this.makeProxyUnambiguous(t),this.preventExtensions?.(t)}static pendingDefinePropertyTrap(t,e,r){return this.makeProxyUnambiguous(t),this.defineProperty?.(t,e,r)}}function mt(t,e,r){const n=ht(t);let o;const i=(...t)=>{o=I(pt,void 0,t)};return{enumerable:r,configurable:!0,writable:!0,get:()=>(X(n,e,i),void 0===o?delete t[e]:w(t,e,o),S(t,e)),set(r){X(n,e,i),void 0===o?delete t[e]:w(t,e,o),A(t,e,r)}}}return Tt.defaultOwnKeysTrap=Tt.dynamicOwnKeysTrap,Tt.defaultIsExtensibleTrap=Tt.dynamicIsExtensibleTrap,Tt.defaultGetOwnPropertyDescriptorTrap=Tt.dynamicGetOwnPropertyDescriptorTrap,Tt.defaultGetPrototypeOfTrap=Tt.dynamicGetPrototypeOfTrap,Tt.defaultGetTrap=Tt.dynamicGetTrap,Tt.defaultHasTrap=Tt.dynamicHasTrap,Tt.defaultSetPrototypeOfTrap=r?Tt.pendingSetPrototypeOfTrap:Tt.dynamicSetPrototypeOfTrap,Tt.defaultSetTrap=r?Tt.pendingSetTrap:Tt.dynamicSetTrap,Tt.defaultDeletePropertyTrap=r?Tt.pendingDeletePropertyTrap:Tt.dynamicDeletePropertyTrap,Tt.defaultPreventExtensionsTrap=r?Tt.pendingPreventExtensionsTrap:Tt.dynamicPreventExtensionsTrap,Tt.defaultDefinePropertyTrap=r?Tt.pendingDefinePropertyTrap:Tt.dynamicDefinePropertyTrap,E(Tt.prototype,null),g(Tt.prototype),o(ct(globalThis),ut,gt,((t,e)=>{t();return ct(ut()[e])}),(t=>{try{p(t)}catch(t){throw lt(t)}}),((t,e)=>{t();const r=ut();I(_,U,[r,e])}),((t,...e)=>{t();const r=ut();for(let t=0,n=e.length;t<n;t+=2){const n=e[t],o=mt(r,n,!!e[t+1]);try{w(r,n,o)}catch{}}}),((t,e,r)=>{const{proxy:n}=new Tt(t,e,r);return I(_,U,[n,t]),ct(n)}),st(((t,e,...r)=>{t();const n=ut(),o=dt(e),{length:i}=r,a=new y(i);for(let t=0,e=i;t<e;t+=1)a[t]=dt(r[t]);let s;try{s=I(n,o,a)}catch(t){throw lt(t)}return gt(s)}),z),st(((t,e,...r)=>{t();const n=ut(),o=dt(e),{length:i}=r,a=new y(i);for(let t=0,e=i;t<e;t+=1)a[t]=dt(r[t]);let s;try{s=x(n,a,o)}catch(t){throw lt(t)}return gt(s)}),z),st(((t,e,...r)=>{t();const n=ut(),o=I(pt,void 0,r);try{return w(n,e,o)}catch(t){throw lt(t)}}),z),st(((t,e)=>{t();const r=ut();try{return O(r,e)}catch(t){throw lt(t)}}),z),st(((t,e,r)=>{t();const n=ut();let o;try{o=k(n,e)}catch(t){throw lt(t)}if(!o)return;const i=bt(o);I(r,void 0,i)}),z),st((t=>{t();const e=ut();let r;try{r=M(e)}catch(t){throw lt(t)}return gt(r)}),z),st(((t,e)=>{t();const r=ut();try{return G(r,e)}catch(t){throw lt(t)}}),z),st((t=>{t();const e=ut();try{return D(e)}catch(t){throw lt(t)}}),z),st(((t,e)=>{t();const r=ut();let n;try{n=R(r)}catch(t){throw lt(t)}I(e,void 0,n)}),z),st((t=>{t();const e=ut();try{return C(e)}catch(t){throw lt(t)}}),z),st(((t,e)=>{t();const r=ut(),n=dt(e);try{return E(r,n)}catch(t){throw lt(t)}}),z),st((t=>{t();const e=ut();let r=l.None;try{b(e)?r|=l.IsSealed&l.IsFrozen&l.IsNotExtensible:P(e)?r|=l.IsSealed:D(e)||(r|=l.IsNotExtensible),f(e)}catch{r|=l.Revoked}return r}),z),st(((t,e)=>{t();const r=ut();try{return I(m,r,[e])}catch(t){throw lt(t)}}),z)),(...t)=>{const[,,,,,,,e,r,n,o,i,a,s,l,c,u,p,y,f,h]=t;H=e,W=at(st(r,K)),J=at(st(n,K)),q=at(st(o,K)),Q=at(st(i,K)),X=at(st(a,K)),Y=at(st(s,K)),Z=at(st(l,K)),tt=at(st(c,K)),et=at(st(u,K)),rt=at(st(p,K)),nt=at(st(y,K)),ot=at(st(f,K)),it=at(st(h,K))}}!function(t){t[t.None=0]="None",t[t.MagicMarker=1]="MagicMarker"}(t||(t={}));const r=`(function(){'use strict';return (${e.toString()})})()`,n=Symbol.for("@@membraneUndefinedValue"),o=/^\d+$/,{includes:i,push:a}=Array.prototype,s=Error,{assign:l,keys:c}=Object,{propertyIsEnumerable:u}=Object.prototype,{apply:p,ownKeys:y}=Reflect,{test:f}=RegExp.prototype;function h(t,e){return p(f,t,[e])}class d{constructor(e){if(void 0===e)throw new s("Missing VirtualEnvironmentOptions options bag.");const{blueConnector:r,redConnector:n,distortionCallback:o,support:i}=e;let a,l;const c={distortionCallback:o};let u=t.None;u|=i?.magicMarker&&t.MagicMarker;const y=r("blue",false,u,((...t)=>{a=t}),c),f=n("red",true,u,((...t)=>{l=t}));p(y,void 0,l),p(f,void 0,a);const[h,d,g,b,,P]=a;this.blueGlobalThisPointer=h,this.blueGetSelectedTarget=d,this.blueGetTransferableValue=g,this.blueCallableGetPropertyValuePointer=b,this.blueCallableLinkPointers=P;const[T,,,m,v,w,k,,,,E,,,,,,,,I]=l;this.redGlobalThisPointer=T,this.redCallableEvaluate=v,this.redCallableInstallLazyDescriptors=k,this.redCallableSetPrototypeOf=I,this.redCallableDefineProperty=E,this.redCallableGetPropertyValuePointer=m,this.redCallableLinkPointers=w}evaluate(t){try{this.redCallableEvaluate(t)}catch(t){const e=this.blueGetSelectedTarget();if(e)throw e;throw t}}link(...t){let e=this.blueGlobalThisPointer,r=this.redGlobalThisPointer;for(let n=0,o=t.length;n<o;n+=1)e=this.blueCallableGetPropertyValuePointer(e,t[n]),r=this.redCallableGetPropertyValuePointer(r,t[n]);this.redCallableLinkPointers(r,e),this.blueCallableLinkPointers(e,r)}remap(t,e){const r=y(e),i=this.blueGetTransferableValue(t);for(let t=0,a=r.length;t<a;t+=1){const a=r[t];if("symbol"!=typeof a&&h(o,a))continue;const s=l({__proto__:null},e[a]),c="configurable"in s?!!s.configurable:n,u="enumerable"in s?!!s.enumerable:n,p="writable"in s?!!s.writable:n,y="value"in s?this.blueGetTransferableValue(s.value):n,f="get"in s?this.blueGetTransferableValue(s.get):n,d="set"in s?this.blueGetTransferableValue(s.set):n;this.redCallableDefineProperty(i,a,c,u,p,y,f,d)}}lazyRemap(t,e){const r=c(t),n=[this.blueGetTransferableValue(t)];for(let s=0,l=e.length;s<l;s+=1){const l=e[s];if("symbol"!=typeof l&&h(o,l))continue;const c="symbol"==typeof l?p(u,t,[l]):p(i,r,[l]);p(a,n,[l,c])}p(this.redCallableInstallLazyDescriptors,void 0,n)}remapProto(t,e){const r=this.blueGetTransferableValue(t),n=this.blueGetTransferableValue(e);this.redCallableSetPrototypeOf(r,n)}}const{has:g}=Set.prototype,{apply:b,getOwnPropertyDescriptor:P,ownKeys:T}=Reflect,m=new Set(["Infinity","NaN","undefined","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","AggregateError","Array","ArrayBuffer","BigInt","BigInt64Array","BigUint64Array","Boolean","DataView","Error","EvalError","FinalizationRegistry","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Number","Object","Proxy","RangeError","ReferenceError","RegExp","SharedArrayBuffer","String","Symbol","SyntaxError","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","URIError","WeakRef","Atomics","JSON","Math","Reflect","escape","unescape"]),v=["AggregateError","Array","Error","EvalError","Function","Object","Proxy","RangeError","ReferenceError","SyntaxError","TypeError","URIError"];function w(t,e){for(let r=0,n=v.length;r<n;r+=1){const n=v[r],o=e[n];o&&(t.link(n),o.prototype&&t.link(n,"prototype"))}}function k(t){const e={__proto__:null},r=T(t);for(let n=0,o=r.length;n<o;n+=1){const o=r[n];b(g,m,[o])||(e[o]=P(t,o))}return e}function E(t){return b(g,m,[t])}export{t as SupportFlagsField,d as VirtualEnvironment,k as getFilteredEndowmentDescriptors,e as init,r as initSourceTextInStrictMode,E as isIntrinsicGlobalName,w as linkIntrinsics};
//# sourceMappingURL=index.min.js.map
{
"name": "@locker/near-membrane-base",
"version": "0.7.1",
"version": "0.7.2",
"license": "MIT",

@@ -8,2 +8,3 @@ "author": "Caridy Patiño <caridy@gmail.com>",

"main": "lib/index.js",
"sideEffects": false,
"type": "module",

@@ -22,3 +23,3 @@ "types": "types/index.d.ts",

},
"gitHead": "b119753b3ac2094f737a58205e8f379c9382852e"
"gitHead": "d5a8ce14e9d0cd31ef323bd3f6ee0aa685b29663"
}

@@ -1,10 +0,18 @@

import { init, ProxyTarget } from './membrane';
import { init, DistortionCallback, ProxyTarget } from './membrane';
export interface SupportFlagsObject {
magicMarker?: boolean;
}
interface VirtualEnvironmentOptions {
blueConnector: typeof init;
distortionCallback?: DistortionCallback;
redConnector: typeof init;
distortionCallback?: (originalTarget: ProxyTarget) => ProxyTarget;
support?: SupportFlagsObject;
}
export declare class VirtualEnvironment {
private blueGlobalThisPointer;
private blueGetTransferableValue;
private blueCallableLinkPointers;
private blueGetSelectedTarget;
private blueCallableGetPropertyValuePointer;
private redGlobalThisPointer;
private redCallableSetPrototypeOf;

@@ -14,4 +22,7 @@ private redCallableEvaluate;

private redCallableDefineProperty;
private redCallableLinkPointers;
private redCallableGetPropertyValuePointer;
constructor(options: VirtualEnvironmentOptions);
evaluate(sourceText: string): void;
link(...keys: PropertyKey[]): void;
remap(o: ProxyTarget, blueDescriptors: PropertyDescriptorMap): void;

@@ -18,0 +29,0 @@ lazyRemap(o: ProxyTarget, keys: PropertyKey[]): void;

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

import { VirtualEnvironment } from './environment';
export declare function linkIntrinsics(env: VirtualEnvironment, blueGlobalThis: typeof globalThis): void;
export declare function getFilteredEndowmentDescriptors(endowments: object): PropertyDescriptorMap;
export declare function isIntrinsicGlobalName(key: PropertyKey): boolean;
//# sourceMappingURL=intrinsics.d.ts.map

@@ -12,3 +12,3 @@ /**

* 1. Pointers are the way to pass reference to object and functions.
* 2. A dedicated symbol (undefinedSymbol) is needed to represent the absence of a value.
* 2. A dedicated symbol (UNDEFINED_SYMBOL) is needed to represent the absence of a value.
* 3. The realm that owns the object or function is responsible for projecting the proxy

@@ -41,9 +41,13 @@ * onto the other side (via callablePushTarget), which returns a Pointer that can be

declare type CallableHasOwnProperty = (targetPointer: Pointer, key: PropertyKey) => boolean;
declare type CallableLinkIntrinsics = (...reflectiveIntrinsicPointers: Pointer[]) => void;
declare type CallableLinkUnforgeables = (...unforgeablePointers: Pointer[]) => void;
export declare type CallableLinkPointers = (targetPointer: Pointer, foreignTargetPointer: Pointer) => void;
export declare type CallableInstallLazyDescriptors = (targetPointer: Pointer, ...keyAndEnumTuple: PropertyKey[]) => void;
export declare type CallableGetPropertyValuePointer = (targetPointer: Pointer, key: PropertyKey) => Pointer;
export declare type CallableEvaluate = (sourceText: string) => void;
export declare type GetTransferableValue = (value: any) => PrimitiveOrPointer;
export declare type GetSelectedTarget = () => any;
export declare type HooksCallback = (getSelectedTarget: GetSelectedTarget, getTransferableValue: GetTransferableValue, callableEvaluate: CallableEvaluate, callableInstallLazyDescriptor: CallableInstallLazyDescriptors, callablePushTarget: CallablePushTarget, callableApply: CallableApply, callableConstruct: CallableConstruct, callableDefineProperty: CallableDefineProperty, callableDeleteProperty: CallableDeleteProperty, callableGetOwnPropertyDescriptor: CallableGetOwnPropertyDescriptor, callableGetPrototypeOf: CallableGetPrototypeOf, callableHas: CallableHas, callableIsExtensible: CallableIsExtensible, callableOwnKeys: CallableOwnKeys, callablePreventExtensions: CallablePreventExtensions, callableSetPrototypeOf: CallableSetPrototypeOf, callableGetTargetIntegrityTraits: CallableGetTargetIntegrityTraits, callableHasOwnProperty: CallableHasOwnProperty, callableLinkIntrinsics: CallableLinkIntrinsics, callableLinkUnforgeables: CallableLinkUnforgeables, globalThisPointer: Pointer) => void;
export declare type HooksCallback = (globalThisPointer: Pointer, getSelectedTarget: GetSelectedTarget, getTransferableValue: GetTransferableValue, callableGetPropertyValuePointer: CallableGetPropertyValuePointer, callableEvaluate: CallableEvaluate, callableLinkPointers: CallableLinkPointers, callableInstallLazyDescriptor: CallableInstallLazyDescriptors, callablePushTarget: CallablePushTarget, callableApply: CallableApply, callableConstruct: CallableConstruct, callableDefineProperty: CallableDefineProperty, callableDeleteProperty: CallableDeleteProperty, callableGetOwnPropertyDescriptor: CallableGetOwnPropertyDescriptor, callableGetPrototypeOf: CallableGetPrototypeOf, callableHas: CallableHas, callableIsExtensible: CallableIsExtensible, callableOwnKeys: CallableOwnKeys, callablePreventExtensions: CallablePreventExtensions, callableSetPrototypeOf: CallableSetPrototypeOf, callableGetTargetIntegrityTraits: CallableGetTargetIntegrityTraits, callableHasOwnProperty: CallableHasOwnProperty) => void;
export declare enum SupportFlagsField {
None = 0,
MagicMarker = 1
}
export declare type DistortionCallback = (target: ProxyTarget) => ProxyTarget;

@@ -58,5 +62,5 @@ export interface InstrumentationHooks {

}
export declare function init(undefinedSymbol: symbol, color: string, trapMutations: boolean, foreignCallableHooksCallback: HooksCallback, options?: InitLocalOptions): HooksCallback;
export declare function init(color: string, trapMutations: boolean, supportFlags: SupportFlagsField | undefined, foreignCallableHooksCallback: HooksCallback, options?: InitLocalOptions): HooksCallback;
export declare const initSourceTextInStrictMode: string;
export {};
//# sourceMappingURL=membrane.d.ts.map

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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