Comparing version 1.10.2 to 1.10.3
@@ -0,1 +1,2 @@ | ||
type AnyFunction = (...args: any[]) => any; | ||
type AsRef = { | ||
@@ -7,6 +8,6 @@ $$valtioRef: true; | ||
type Listener = (op: Op, nextVersion: number) => void; | ||
type AnyFunction = (...args: any[]) => any; | ||
type Snapshot<T> = T extends AnyFunction ? T : T extends AsRef ? T : T extends Promise<any> ? Awaited<T> : { | ||
type SnapshotIgnore = Date | Map<any, any> | Set<any> | WeakMap<any, any> | WeakSet<any> | AsRef | Error | RegExp | AnyFunction; | ||
type Snapshot<T> = T extends SnapshotIgnore ? T : T extends Promise<unknown> ? Awaited<T> : T extends object ? { | ||
readonly [K in keyof T]: Snapshot<T[K]>; | ||
}; | ||
} : T; | ||
/** | ||
@@ -13,0 +14,0 @@ * This is not a public API. |
@@ -191,8 +191,8 @@ import { markToTrack, getUntracked } from 'proxy-compare'; | ||
); | ||
const hasValue = "value" in desc; | ||
delete desc.value; | ||
Object.defineProperty(baseObject, key, desc); | ||
if (hasValue) { | ||
if ("value" in desc) { | ||
proxyObject[key] = initialObject[key]; | ||
delete desc.value; | ||
delete desc.writable; | ||
} | ||
Object.defineProperty(baseObject, key, desc); | ||
}); | ||
@@ -199,0 +199,0 @@ return proxyObject; |
{ | ||
"name": "valtio", | ||
"private": false, | ||
"version": "1.10.2", | ||
"version": "1.10.3", | ||
"description": "💊 Valtio makes proxy-state simple for React and Vanilla", | ||
@@ -6,0 +6,0 @@ "main": "./index.js", |
@@ -238,3 +238,3 @@ <img src="logo.svg" alt="valtio"> | ||
You can use [Redux DevTools Extension](https://github.com/zalmoxisus/redux-devtools-extension) for plain objects and arrays. | ||
You can use [Redux DevTools Extension](https://github.com/reduxjs/redux-devtools) for plain objects and arrays. | ||
@@ -241,0 +241,0 @@ ```jsx |
@@ -207,8 +207,8 @@ System.register(['proxy-compare'], (function (exports) { | ||
); | ||
const hasValue = "value" in desc; | ||
delete desc.value; | ||
Object.defineProperty(baseObject, key, desc); | ||
if (hasValue) { | ||
if ("value" in desc) { | ||
proxyObject[key] = initialObject[key]; | ||
delete desc.value; | ||
delete desc.writable; | ||
} | ||
Object.defineProperty(baseObject, key, desc); | ||
}); | ||
@@ -215,0 +215,0 @@ return proxyObject; |
@@ -1,1 +0,1 @@ | ||
System.register(["proxy-compare"],function(D){"use strict";var W,K;return{setters:[function(j){W=j.markToTrack,K=j.getUntracked}],execute:function(){D({getVersion:_,proxy:U,ref:L,snapshot:B,subscribe:q});const j=c=>typeof c=="object"&&c!==null,l=new WeakMap,m=new WeakSet,T=(c=Object.is,f=(t,v)=>new Proxy(t,v),P=t=>j(t)&&!m.has(t)&&(Array.isArray(t)||!(Symbol.iterator in t))&&!(t instanceof WeakMap)&&!(t instanceof WeakSet)&&!(t instanceof Error)&&!(t instanceof Number)&&!(t instanceof Date)&&!(t instanceof String)&&!(t instanceof RegExp)&&!(t instanceof ArrayBuffer),k=t=>{switch(t.status){case"fulfilled":return t.value;case"rejected":throw t.reason;default:throw t}},u=new WeakMap,g=(t,v,b=k)=>{const s=u.get(t);if((s==null?void 0:s[0])===v)return s[1];const a=Array.isArray(t)?[]:Object.create(Object.getPrototypeOf(t));return W(a,!0),u.set(t,[v,a]),Reflect.ownKeys(t).forEach(O=>{if(Object.getOwnPropertyDescriptor(a,O))return;const d=Reflect.get(t,O),w={value:d,enumerable:!0,configurable:!0};if(m.has(d))W(d,!1);else if(d instanceof Promise)delete w.value,w.get=()=>b(d);else if(l.has(d)){const[i,x]=l.get(d);w.value=g(i,x(),b)}Object.defineProperty(a,O,w)}),a},h=new WeakMap,y=[1,1],E=t=>{if(!j(t))throw new Error("object required");const v=h.get(t);if(v)return v;let b=y[0];const s=new Set,a=(n,r=++y[0])=>{b!==r&&(b=r,s.forEach(e=>e(n,r)))};let O=y[1];const d=(n=++y[1])=>(O!==n&&!s.size&&(O=n,i.forEach(([r])=>{const e=r[1](n);e>b&&(b=e)})),b),w=n=>(r,e)=>{const o=[...r];o[1]=[n,...o[1]],a(o,e)},i=new Map,x=(n,r)=>{if(s.size){const e=r[3](w(n));i.set(n,[r,e])}else i.set(n,[r])},V=n=>{var r;const e=i.get(n);e&&(i.delete(n),(r=e[1])==null||r.call(e))},N=n=>(s.add(n),s.size===1&&i.forEach(([r,e],o)=>{const z=r[3](w(o));i.set(o,[r,z])}),()=>{s.delete(n),s.size===0&&i.forEach(([r,e],o)=>{e&&(e(),i.set(o,[r]))})}),S=Array.isArray(t)?[]:Object.create(Object.getPrototypeOf(t)),R=f(S,{deleteProperty(n,r){const e=Reflect.get(n,r);V(r);const o=Reflect.deleteProperty(n,r);return o&&a(["delete",[r],e]),o},set(n,r,e,o){const z=Reflect.has(n,r),M=Reflect.get(n,r,o);if(z&&(c(M,e)||h.has(e)&&c(M,h.get(e))))return!0;V(r),j(e)&&(e=K(e)||e);let A=e;if(e instanceof Promise)e.then(p=>{e.status="fulfilled",e.value=p,a(["resolve",[r],p])}).catch(p=>{e.status="rejected",e.reason=p,a(["reject",[r],p])});else{!l.has(e)&&P(e)&&(A=E(e));const p=!m.has(A)&&l.get(A);p&&x(r,p)}return Reflect.set(n,r,A,o),a(["set",[r],e,M]),!0}});h.set(t,R);const C=[S,d,g,N];return l.set(R,C),Reflect.ownKeys(t).forEach(n=>{const r=Object.getOwnPropertyDescriptor(t,n),e="value"in r;delete r.value,Object.defineProperty(S,n,r),e&&(R[n]=t[n])}),R})=>[E,l,m,c,f,P,k,u,g,h,y],[F]=T();function U(c={}){return F(c)}function _(c){const f=l.get(c);return f==null?void 0:f[1]()}function q(c,f,P){const k=l.get(c);let u;const g=[],h=k[3];let y=!1;const E=h(t=>{if(g.push(t),P){f(g.splice(0));return}u||(u=Promise.resolve().then(()=>{u=void 0,y&&f(g.splice(0))}))});return y=!0,()=>{y=!1,E()}}function B(c,f){const P=l.get(c),[k,u,g]=P;return g(k,u(),f)}function L(c){return m.add(c),c}const G=D("unstable_buildProxyFunction",T)}}}); | ||
System.register(["proxy-compare"],function(D){"use strict";var x,K;return{setters:[function(v){x=v.markToTrack,K=v.getUntracked}],execute:function(){D({getVersion:_,proxy:U,ref:L,snapshot:B,subscribe:q});const v=c=>typeof c=="object"&&c!==null,f=new WeakMap,m=new WeakSet,T=(c=Object.is,l=(t,w)=>new Proxy(t,w),O=t=>v(t)&&!m.has(t)&&(Array.isArray(t)||!(Symbol.iterator in t))&&!(t instanceof WeakMap)&&!(t instanceof WeakSet)&&!(t instanceof Error)&&!(t instanceof Number)&&!(t instanceof Date)&&!(t instanceof String)&&!(t instanceof RegExp)&&!(t instanceof ArrayBuffer),P=t=>{switch(t.status){case"fulfilled":return t.value;case"rejected":throw t.reason;default:throw t}},u=new WeakMap,g=(t,w,b=P)=>{const s=u.get(t);if((s==null?void 0:s[0])===w)return s[1];const a=Array.isArray(t)?[]:Object.create(Object.getPrototypeOf(t));return x(a,!0),u.set(t,[w,a]),Reflect.ownKeys(t).forEach(k=>{if(Object.getOwnPropertyDescriptor(a,k))return;const y=Reflect.get(t,k),j={value:y,enumerable:!0,configurable:!0};if(m.has(y))x(y,!1);else if(y instanceof Promise)delete j.value,j.get=()=>b(y);else if(f.has(y)){const[i,W]=f.get(y);j.value=g(i,W(),b)}Object.defineProperty(a,k,j)}),a},h=new WeakMap,d=[1,1],E=t=>{if(!v(t))throw new Error("object required");const w=h.get(t);if(w)return w;let b=d[0];const s=new Set,a=(n,e=++d[0])=>{b!==e&&(b=e,s.forEach(r=>r(n,e)))};let k=d[1];const y=(n=++d[1])=>(k!==n&&!s.size&&(k=n,i.forEach(([e])=>{const r=e[1](n);r>b&&(b=r)})),b),j=n=>(e,r)=>{const o=[...e];o[1]=[n,...o[1]],a(o,r)},i=new Map,W=(n,e)=>{if(s.size){const r=e[3](j(n));i.set(n,[e,r])}else i.set(n,[e])},V=n=>{var e;const r=i.get(n);r&&(i.delete(n),(e=r[1])==null||e.call(r))},N=n=>(s.add(n),s.size===1&&i.forEach(([e,r],o)=>{const M=e[3](j(o));i.set(o,[e,M])}),()=>{s.delete(n),s.size===0&&i.forEach(([e,r],o)=>{r&&(r(),i.set(o,[e]))})}),z=Array.isArray(t)?[]:Object.create(Object.getPrototypeOf(t)),R=l(z,{deleteProperty(n,e){const r=Reflect.get(n,e);V(e);const o=Reflect.deleteProperty(n,e);return o&&a(["delete",[e],r]),o},set(n,e,r,o){const M=Reflect.has(n,e),S=Reflect.get(n,e,o);if(M&&(c(S,r)||h.has(r)&&c(S,h.get(r))))return!0;V(e),v(r)&&(r=K(r)||r);let A=r;if(r instanceof Promise)r.then(p=>{r.status="fulfilled",r.value=p,a(["resolve",[e],p])}).catch(p=>{r.status="rejected",r.reason=p,a(["reject",[e],p])});else{!f.has(r)&&O(r)&&(A=E(r));const p=!m.has(A)&&f.get(A);p&&W(e,p)}return Reflect.set(n,e,A,o),a(["set",[e],r,S]),!0}});h.set(t,R);const C=[z,y,g,N];return f.set(R,C),Reflect.ownKeys(t).forEach(n=>{const e=Object.getOwnPropertyDescriptor(t,n);"value"in e&&(R[n]=t[n],delete e.value,delete e.writable),Object.defineProperty(z,n,e)}),R})=>[E,f,m,c,l,O,P,u,g,h,d],[F]=T();function U(c={}){return F(c)}function _(c){const l=f.get(c);return l==null?void 0:l[1]()}function q(c,l,O){const P=f.get(c);let u;const g=[],h=P[3];let d=!1;const E=h(t=>{if(g.push(t),O){l(g.splice(0));return}u||(u=Promise.resolve().then(()=>{u=void 0,d&&l(g.splice(0))}))});return d=!0,()=>{d=!1,E()}}function B(c,l){const O=f.get(c),[P,u,g]=O;return g(P,u(),l)}function L(c){return m.add(c),c}const G=D("unstable_buildProxyFunction",T)}}}); |
@@ -0,1 +1,2 @@ | ||
type AnyFunction = (...args: any[]) => any; | ||
type AsRef = { | ||
@@ -24,6 +25,6 @@ $$valtioRef: true; | ||
type Listener = (op: Op, nextVersion: number) => void; | ||
type AnyFunction = (...args: any[]) => any; | ||
type Snapshot<T> = T extends AnyFunction ? T : T extends AsRef ? T : T extends Promise<any> ? Awaited<T> : { | ||
type SnapshotIgnore = Date | Map<any, any> | Set<any> | WeakMap<any, any> | WeakSet<any> | AsRef | Error | RegExp | AnyFunction; | ||
type Snapshot<T> = T extends SnapshotIgnore ? T : T extends Promise<unknown> ? Awaited<T> : T extends object ? { | ||
readonly [K in keyof T]: Snapshot<T[K]>; | ||
}; | ||
} : T; | ||
/** | ||
@@ -30,0 +31,0 @@ * This is not a public API. |
@@ -0,1 +1,2 @@ | ||
type AnyFunction = (...args: any[]) => any; | ||
type AsRef = { | ||
@@ -24,6 +25,6 @@ $$valtioRef: true; | ||
type Listener = (op: Op, nextVersion: number) => void; | ||
type AnyFunction = (...args: any[]) => any; | ||
type Snapshot<T> = T extends AnyFunction ? T : T extends AsRef ? T : T extends Promise<any> ? Awaited<T> : { | ||
type SnapshotIgnore = Date | Map<any, any> | Set<any> | WeakMap<any, any> | WeakSet<any> | AsRef | Error | RegExp | AnyFunction; | ||
type Snapshot<T> = T extends SnapshotIgnore ? T : T extends Promise<unknown> ? Awaited<T> : T extends object ? { | ||
readonly [K in keyof T]: Snapshot<T[K]>; | ||
}; | ||
} : T; | ||
/** | ||
@@ -30,0 +31,0 @@ * This is not a public API. |
@@ -241,8 +241,8 @@ (function (global, factory) { | ||
var desc = Object.getOwnPropertyDescriptor(initialObject, key); | ||
var hasValue = ('value' in desc); | ||
delete desc.value; | ||
Object.defineProperty(baseObject, key, desc); | ||
if (hasValue) { | ||
if ('value' in desc) { | ||
proxyObject[key] = initialObject[key]; | ||
delete desc.value; | ||
delete desc.writable; | ||
} | ||
Object.defineProperty(baseObject, key, desc); | ||
}); | ||
@@ -249,0 +249,0 @@ return proxyObject; |
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("proxy-compare")):"function"==typeof define&&define.amd?define(["exports","proxy-compare"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).valtioVanilla={},e.proxyCompare)}(this,(function(e,t){"use strict";var n=function(e){return"object"==typeof e&&null!==e},r=new WeakMap,o=new WeakSet,i=function(e,i,a,c,f,u,s,l,v){return void 0===e&&(e=Object.is),void 0===i&&(i=function(e,t){return new Proxy(e,t)}),void 0===a&&(a=function(e){return n(e)&&!o.has(e)&&(Array.isArray(e)||!(Symbol.iterator in e))&&!(e instanceof WeakMap)&&!(e instanceof WeakSet)&&!(e instanceof Error)&&!(e instanceof Number)&&!(e instanceof Date)&&!(e instanceof String)&&!(e instanceof RegExp)&&!(e instanceof ArrayBuffer)}),void 0===c&&(c=function(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:throw e}}),void 0===f&&(f=new WeakMap),void 0===u&&(u=function(e){function t(t,n,r){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(e,n,i){void 0===i&&(i=c);var a=f.get(e);if((null==a?void 0:a[0])===n)return a[1];var s=Array.isArray(e)?[]:Object.create(Object.getPrototypeOf(e));return t.markToTrack(s,!0),f.set(e,[n,s]),Reflect.ownKeys(e).forEach((function(n){if(!Object.getOwnPropertyDescriptor(s,n)){var a=Reflect.get(e,n),c={value:a,enumerable:!0,configurable:!0};if(o.has(a))t.markToTrack(a,!1);else if(a instanceof Promise)delete c.value,c.get=function(){return i(a)};else if(r.has(a)){var f=r.get(a),l=f[0],v=f[1];c.value=u(l,v(),i)}Object.defineProperty(s,n,c)}})),s}))),void 0===s&&(s=new WeakMap),void 0===l&&(l=[1,1]),void 0===v&&(v=function(c){if(!n(c))throw new Error("object required");var f=s.get(c);if(f)return f;var d=l[0],p=new Set,y=function(e,t){void 0===t&&(t=++l[0]),d!==t&&(d=t,p.forEach((function(n){return n(e,t)})))},g=l[1],h=function(e){return function(t,n){var r=[].concat(t);r[1]=[e].concat(r[1]),y(r,n)}},b=new Map,w=function(e){var t,n=b.get(e);n&&(b.delete(e),null==(t=n[1])||t.call(n))},j=Array.isArray(c)?[]:Object.create(Object.getPrototypeOf(c)),m=i(j,{deleteProperty:function(e,t){var n=Reflect.get(e,t);w(t);var r=Reflect.deleteProperty(e,t);return r&&y(["delete",[t],n]),r},set:function(i,c,f,u){var l=Reflect.has(i,c),d=Reflect.get(i,c,u);if(l&&(e(d,f)||s.has(f)&&e(d,s.get(f))))return!0;w(c),n(f)&&(f=t.getUntracked(f)||f);var g=f;if(f instanceof Promise)f.then((function(e){f.status="fulfilled",f.value=e,y(["resolve",[c],e])})).catch((function(e){f.status="rejected",f.reason=e,y(["reject",[c],e])}));else{!r.has(f)&&a(f)&&(g=v(f));var j=!o.has(g)&&r.get(g);j&&function(e,t){if(p.size){var n=t[3](h(e));b.set(e,[t,n])}else b.set(e,[t])}(c,j)}return Reflect.set(i,c,g,u),y(["set",[c],f,d]),!0}});s.set(c,m);var O=[j,function(e){return void 0===e&&(e=++l[1]),g===e||p.size||(g=e,b.forEach((function(t){var n=t[0][1](e);n>d&&(d=n)}))),d},u,function(e){p.add(e),1===p.size&&b.forEach((function(e,t){var n=e[0];e[1];var r=n[3](h(t));b.set(t,[n,r])}));return function(){p.delete(e),0===p.size&&b.forEach((function(e,t){var n=e[0],r=e[1];r&&(r(),b.set(t,[n]))}))}}];return r.set(m,O),Reflect.ownKeys(c).forEach((function(e){var t=Object.getOwnPropertyDescriptor(c,e),n="value"in t;delete t.value,Object.defineProperty(j,e,t),n&&(m[e]=c[e])})),m}),[v,r,o,e,i,a,c,f,u,s,l]},a=i()[0];var c=i;e.getVersion=function(e){var t=r.get(e);return null==t?void 0:t[1]()},e.proxy=function(e){return void 0===e&&(e={}),a(e)},e.ref=function(e){return o.add(e),e},e.snapshot=function(e,t){var n=r.get(e),o=n[0],i=n[1];return(0,n[2])(o,i(),t)},e.subscribe=function(e,t,n){var o,i=r.get(e),a=[],c=i[3],f=!1,u=c((function(e){a.push(e),n?t(a.splice(0)):o||(o=Promise.resolve().then((function(){o=void 0,f&&t(a.splice(0))})))}));return f=!0,function(){f=!1,u()}},e.unstable_buildProxyFunction=c})); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("proxy-compare")):"function"==typeof define&&define.amd?define(["exports","proxy-compare"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).valtioVanilla={},e.proxyCompare)}(this,(function(e,t){"use strict";var n=function(e){return"object"==typeof e&&null!==e},r=new WeakMap,o=new WeakSet,i=function(e,i,a,c,f,u,s,l,v){return void 0===e&&(e=Object.is),void 0===i&&(i=function(e,t){return new Proxy(e,t)}),void 0===a&&(a=function(e){return n(e)&&!o.has(e)&&(Array.isArray(e)||!(Symbol.iterator in e))&&!(e instanceof WeakMap)&&!(e instanceof WeakSet)&&!(e instanceof Error)&&!(e instanceof Number)&&!(e instanceof Date)&&!(e instanceof String)&&!(e instanceof RegExp)&&!(e instanceof ArrayBuffer)}),void 0===c&&(c=function(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:throw e}}),void 0===f&&(f=new WeakMap),void 0===u&&(u=function(e){function t(t,n,r){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(e,n,i){void 0===i&&(i=c);var a=f.get(e);if((null==a?void 0:a[0])===n)return a[1];var s=Array.isArray(e)?[]:Object.create(Object.getPrototypeOf(e));return t.markToTrack(s,!0),f.set(e,[n,s]),Reflect.ownKeys(e).forEach((function(n){if(!Object.getOwnPropertyDescriptor(s,n)){var a=Reflect.get(e,n),c={value:a,enumerable:!0,configurable:!0};if(o.has(a))t.markToTrack(a,!1);else if(a instanceof Promise)delete c.value,c.get=function(){return i(a)};else if(r.has(a)){var f=r.get(a),l=f[0],v=f[1];c.value=u(l,v(),i)}Object.defineProperty(s,n,c)}})),s}))),void 0===s&&(s=new WeakMap),void 0===l&&(l=[1,1]),void 0===v&&(v=function(c){if(!n(c))throw new Error("object required");var f=s.get(c);if(f)return f;var d=l[0],p=new Set,y=function(e,t){void 0===t&&(t=++l[0]),d!==t&&(d=t,p.forEach((function(n){return n(e,t)})))},g=l[1],h=function(e){return function(t,n){var r=[].concat(t);r[1]=[e].concat(r[1]),y(r,n)}},b=new Map,w=function(e){var t,n=b.get(e);n&&(b.delete(e),null==(t=n[1])||t.call(n))},j=Array.isArray(c)?[]:Object.create(Object.getPrototypeOf(c)),m=i(j,{deleteProperty:function(e,t){var n=Reflect.get(e,t);w(t);var r=Reflect.deleteProperty(e,t);return r&&y(["delete",[t],n]),r},set:function(i,c,f,u){var l=Reflect.has(i,c),d=Reflect.get(i,c,u);if(l&&(e(d,f)||s.has(f)&&e(d,s.get(f))))return!0;w(c),n(f)&&(f=t.getUntracked(f)||f);var g=f;if(f instanceof Promise)f.then((function(e){f.status="fulfilled",f.value=e,y(["resolve",[c],e])})).catch((function(e){f.status="rejected",f.reason=e,y(["reject",[c],e])}));else{!r.has(f)&&a(f)&&(g=v(f));var j=!o.has(g)&&r.get(g);j&&function(e,t){if(p.size){var n=t[3](h(e));b.set(e,[t,n])}else b.set(e,[t])}(c,j)}return Reflect.set(i,c,g,u),y(["set",[c],f,d]),!0}});s.set(c,m);var O=[j,function(e){return void 0===e&&(e=++l[1]),g===e||p.size||(g=e,b.forEach((function(t){var n=t[0][1](e);n>d&&(d=n)}))),d},u,function(e){p.add(e),1===p.size&&b.forEach((function(e,t){var n=e[0];e[1];var r=n[3](h(t));b.set(t,[n,r])}));return function(){p.delete(e),0===p.size&&b.forEach((function(e,t){var n=e[0],r=e[1];r&&(r(),b.set(t,[n]))}))}}];return r.set(m,O),Reflect.ownKeys(c).forEach((function(e){var t=Object.getOwnPropertyDescriptor(c,e);"value"in t&&(m[e]=c[e],delete t.value,delete t.writable),Object.defineProperty(j,e,t)})),m}),[v,r,o,e,i,a,c,f,u,s,l]},a=i()[0];var c=i;e.getVersion=function(e){var t=r.get(e);return null==t?void 0:t[1]()},e.proxy=function(e){return void 0===e&&(e={}),a(e)},e.ref=function(e){return o.add(e),e},e.snapshot=function(e,t){var n=r.get(e),o=n[0],i=n[1];return(0,n[2])(o,i(),t)},e.subscribe=function(e,t,n){var o,i=r.get(e),a=[],c=i[3],f=!1,u=c((function(e){a.push(e),n?t(a.splice(0)):o||(o=Promise.resolve().then((function(){o=void 0,f&&t(a.splice(0))})))}));return f=!0,function(){f=!1,u()}},e.unstable_buildProxyFunction=c})); |
@@ -0,1 +1,2 @@ | ||
type AnyFunction = (...args: any[]) => any; | ||
type AsRef = { | ||
@@ -7,6 +8,6 @@ $$valtioRef: true; | ||
type Listener = (op: Op, nextVersion: number) => void; | ||
type AnyFunction = (...args: any[]) => any; | ||
type Snapshot<T> = T extends AnyFunction ? T : T extends AsRef ? T : T extends Promise<any> ? Awaited<T> : { | ||
type SnapshotIgnore = Date | Map<any, any> | Set<any> | WeakMap<any, any> | WeakSet<any> | AsRef | Error | RegExp | AnyFunction; | ||
type Snapshot<T> = T extends SnapshotIgnore ? T : T extends Promise<unknown> ? Awaited<T> : T extends object ? { | ||
readonly [K in keyof T]: Snapshot<T[K]>; | ||
}; | ||
} : T; | ||
/** | ||
@@ -13,0 +14,0 @@ * This is not a public API. |
@@ -239,8 +239,8 @@ 'use strict'; | ||
var desc = Object.getOwnPropertyDescriptor(initialObject, key); | ||
var hasValue = ('value' in desc); | ||
delete desc.value; | ||
Object.defineProperty(baseObject, key, desc); | ||
if (hasValue) { | ||
if ('value' in desc) { | ||
proxyObject[key] = initialObject[key]; | ||
delete desc.value; | ||
delete desc.writable; | ||
} | ||
Object.defineProperty(baseObject, key, desc); | ||
}); | ||
@@ -247,0 +247,0 @@ return proxyObject; |
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
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
314639
7433