@vue/reactivity
Advanced tools
Comparing version 3.0.0-alpha.11 to 3.0.0-alpha.12
@@ -342,2 +342,5 @@ 'use strict'; | ||
const rawKey = toRaw(key); | ||
if (key !== rawKey) { | ||
track(target, "get" /* GET */, key); | ||
} | ||
track(target, "get" /* GET */, rawKey); | ||
@@ -355,2 +358,5 @@ const { has, get } = getProto(target); | ||
const rawKey = toRaw(key); | ||
if (key !== rawKey) { | ||
track(target, "has" /* HAS */, key); | ||
} | ||
track(target, "has" /* HAS */, rawKey); | ||
@@ -378,9 +384,15 @@ const has = getProto(target).has; | ||
value = toRaw(value); | ||
key = toRaw(key); | ||
const target = toRaw(this); | ||
const proto = getProto(target); | ||
const hadKey = proto.has.call(target, key); | ||
const oldValue = proto.get.call(target, key); | ||
const result = proto.set.call(target, key, value); | ||
const { has, get, set } = getProto(target); | ||
let hadKey = has.call(target, key); | ||
if (!hadKey) { | ||
key = toRaw(key); | ||
hadKey = has.call(target, key); | ||
} | ||
else { | ||
checkIdentityKeys(target, has, key); | ||
} | ||
const oldValue = get.call(target, key); | ||
const result = set.call(target, key, value); | ||
if (!hadKey) { | ||
trigger(target, "add" /* ADD */, key, value); | ||
@@ -401,2 +413,5 @@ } | ||
} | ||
else { | ||
checkIdentityKeys(target, has, key); | ||
} | ||
const oldValue = get ? get.call(target, key) : undefined; | ||
@@ -526,2 +541,13 @@ // forward the operation before queueing reactions | ||
}; | ||
function checkIdentityKeys(target, has, key) { | ||
const rawKey = toRaw(key); | ||
if (rawKey !== key && has.call(target, rawKey)) { | ||
const type = shared.toRawType(target); | ||
console.warn(`Reactive ${type} contains both the raw and reactive ` + | ||
`versions of the same object${type === `Map` ? `as keys` : ``}, ` + | ||
`which can lead to inconsistencies. ` + | ||
`Avoid differentiating between the raw and reactive versions ` + | ||
`of an object and only use the reactive version if possible.`); | ||
} | ||
} | ||
@@ -528,0 +554,0 @@ // WeakMaps that store {raw <-> observed} pairs. |
@@ -317,2 +317,5 @@ 'use strict'; | ||
const rawKey = toRaw(key); | ||
if (key !== rawKey) { | ||
track(target, "get" /* GET */, key); | ||
} | ||
track(target, "get" /* GET */, rawKey); | ||
@@ -330,2 +333,5 @@ const { has, get } = getProto(target); | ||
const rawKey = toRaw(key); | ||
if (key !== rawKey) { | ||
track(target, "has" /* HAS */, key); | ||
} | ||
track(target, "has" /* HAS */, rawKey); | ||
@@ -353,9 +359,12 @@ const has = getProto(target).has; | ||
value = toRaw(value); | ||
key = toRaw(key); | ||
const target = toRaw(this); | ||
const proto = getProto(target); | ||
const hadKey = proto.has.call(target, key); | ||
const oldValue = proto.get.call(target, key); | ||
const result = proto.set.call(target, key, value); | ||
const { has, get, set } = getProto(target); | ||
let hadKey = has.call(target, key); | ||
if (!hadKey) { | ||
key = toRaw(key); | ||
hadKey = has.call(target, key); | ||
} | ||
const oldValue = get.call(target, key); | ||
const result = set.call(target, key, value); | ||
if (!hadKey) { | ||
trigger(target, "add" /* ADD */, key, value); | ||
@@ -362,0 +371,0 @@ } |
@@ -338,2 +338,5 @@ import { EMPTY_OBJ, isArray, isSymbol, hasOwn, isObject, hasChanged, capitalize, toRawType, makeMap, isFunction, NOOP } from '@vue/shared'; | ||
const rawKey = toRaw(key); | ||
if (key !== rawKey) { | ||
track(target, "get" /* GET */, key); | ||
} | ||
track(target, "get" /* GET */, rawKey); | ||
@@ -351,2 +354,5 @@ const { has, get } = getProto(target); | ||
const rawKey = toRaw(key); | ||
if (key !== rawKey) { | ||
track(target, "has" /* HAS */, key); | ||
} | ||
track(target, "has" /* HAS */, rawKey); | ||
@@ -374,9 +380,15 @@ const has = getProto(target).has; | ||
value = toRaw(value); | ||
key = toRaw(key); | ||
const target = toRaw(this); | ||
const proto = getProto(target); | ||
const hadKey = proto.has.call(target, key); | ||
const oldValue = proto.get.call(target, key); | ||
const result = proto.set.call(target, key, value); | ||
const { has, get, set } = getProto(target); | ||
let hadKey = has.call(target, key); | ||
if (!hadKey) { | ||
key = toRaw(key); | ||
hadKey = has.call(target, key); | ||
} | ||
else if ((process.env.NODE_ENV !== 'production')) { | ||
checkIdentityKeys(target, has, key); | ||
} | ||
const oldValue = get.call(target, key); | ||
const result = set.call(target, key, value); | ||
if (!hadKey) { | ||
trigger(target, "add" /* ADD */, key, value); | ||
@@ -397,2 +409,5 @@ } | ||
} | ||
else if ((process.env.NODE_ENV !== 'production')) { | ||
checkIdentityKeys(target, has, key); | ||
} | ||
const oldValue = get ? get.call(target, key) : undefined; | ||
@@ -523,2 +538,13 @@ // forward the operation before queueing reactions | ||
}; | ||
function checkIdentityKeys(target, has, key) { | ||
const rawKey = toRaw(key); | ||
if (rawKey !== key && has.call(target, rawKey)) { | ||
const type = toRawType(target); | ||
console.warn(`Reactive ${type} contains both the raw and reactive ` + | ||
`versions of the same object${type === `Map` ? `as keys` : ``}, ` + | ||
`which can lead to inconsistencies. ` + | ||
`Avoid differentiating between the raw and reactive versions ` + | ||
`of an object and only use the reactive version if possible.`); | ||
} | ||
} | ||
@@ -525,0 +551,0 @@ // WeakMaps that store {raw <-> observed} pairs. |
@@ -376,2 +376,5 @@ // Make a map and return a function for checking if a key | ||
const rawKey = toRaw(key); | ||
if (key !== rawKey) { | ||
track(target, "get" /* GET */, key); | ||
} | ||
track(target, "get" /* GET */, rawKey); | ||
@@ -389,2 +392,5 @@ const { has, get } = getProto(target); | ||
const rawKey = toRaw(key); | ||
if (key !== rawKey) { | ||
track(target, "has" /* HAS */, key); | ||
} | ||
track(target, "has" /* HAS */, rawKey); | ||
@@ -412,9 +418,15 @@ const has = getProto(target).has; | ||
value = toRaw(value); | ||
key = toRaw(key); | ||
const target = toRaw(this); | ||
const proto = getProto(target); | ||
const hadKey = proto.has.call(target, key); | ||
const oldValue = proto.get.call(target, key); | ||
const result = proto.set.call(target, key, value); | ||
const { has, get, set } = getProto(target); | ||
let hadKey = has.call(target, key); | ||
if (!hadKey) { | ||
key = toRaw(key); | ||
hadKey = has.call(target, key); | ||
} | ||
else { | ||
checkIdentityKeys(target, has, key); | ||
} | ||
const oldValue = get.call(target, key); | ||
const result = set.call(target, key, value); | ||
if (!hadKey) { | ||
trigger(target, "add" /* ADD */, key, value); | ||
@@ -435,2 +447,5 @@ } | ||
} | ||
else { | ||
checkIdentityKeys(target, has, key); | ||
} | ||
const oldValue = get ? get.call(target, key) : undefined; | ||
@@ -560,2 +575,13 @@ // forward the operation before queueing reactions | ||
}; | ||
function checkIdentityKeys(target, has, key) { | ||
const rawKey = toRaw(key); | ||
if (rawKey !== key && has.call(target, rawKey)) { | ||
const type = toRawType(target); | ||
console.warn(`Reactive ${type} contains both the raw and reactive ` + | ||
`versions of the same object${type === `Map` ? `as keys` : ``}, ` + | ||
`which can lead to inconsistencies. ` + | ||
`Avoid differentiating between the raw and reactive versions ` + | ||
`of an object and only use the reactive version if possible.`); | ||
} | ||
} | ||
@@ -562,0 +588,0 @@ // WeakMaps that store {raw <-> observed} pairs. |
@@ -1,1 +0,1 @@ | ||
function t(t,e){const n=Object.create(null),r=t.split(",");for(let t=0;t<r.length;t++)n[r[t]]=!0;return e?t=>!!n[t.toLowerCase()]:t=>!!n[t]}const e={},n=()=>{},r=Object.prototype.hasOwnProperty,o=(t,e)=>r.call(t,e),c=Array.isArray,s=t=>"symbol"==typeof t,u=t=>null!==t&&"object"==typeof t,i=Object.prototype.toString,a=t=>(t=>i.call(t))(t).slice(8,-1),l=(t,e)=>t!==e&&(t==t||e==e),f=new WeakMap,d=[];let h;const p=Symbol(""),g=Symbol("");function v(t,n=e){(function(t){return t&&!0===t._isEffect})(t)&&(t=t.raw);const r=function(t,e){const n=function(...r){if(!n.active)return e.scheduler?void 0:t(...r);if(!d.includes(n)){w(n);try{return m(),d.push(n),h=n,t(...r)}finally{d.pop(),M(),h=d[d.length-1]}}};return n._isEffect=!0,n.active=!0,n.raw=t,n.deps=[],n.options=e,n}(t,n);return n.lazy||r(),r}function y(t){t.active&&(w(t),t.options.onStop&&t.options.onStop(),t.active=!1)}function w(t){const{deps:e}=t;if(e.length){for(let n=0;n<e.length;n++)e[n].delete(t);e.length=0}}let S=!0;const b=[];function k(){b.push(S),S=!1}function m(){b.push(S),S=!0}function M(){const t=b.pop();S=void 0===t||t}function R(t,e,n){if(!S||void 0===h)return;let r=f.get(t);void 0===r&&f.set(t,r=new Map);let o=r.get(n);void 0===o&&r.set(n,o=new Set),o.has(h)||(o.add(h),h.deps.push(o))}function E(t,e,n,r,o,s){const u=f.get(t);if(void 0===u)return;const i=new Set,a=new Set,l=t=>{void 0!==t&&t.forEach(t=>{t===h&&S||(t.options.computed?a.add(t):i.add(t))})};if("clear"===e)u.forEach(l);else if("length"===n&&c(t))u.forEach((t,e)=>{("length"===e||e>=r)&&l(t)});else{void 0!==n&&l(u.get(n));const r="add"===e||"delete"===e&&!c(t);(r||"set"===e&&t instanceof Map)&&l(u.get(c(t)?"length":p)),r&&t instanceof Map&&l(u.get(g))}const d=t=>{void 0!==t.options.scheduler?t.options.scheduler(t):t()};a.forEach(d),i.forEach(d)}let O=!0;function W(){O=!0}function _(){O=!1}const j=new Set(Object.getOwnPropertyNames(Symbol).map(t=>Symbol[t]).filter(s)),z=N(),P=N(!1,!0),x=N(!0),A=N(!0,!0),K={};function N(t=!1,e=!1){return function(n,r,i){if(c(n)&&o(K,r))return Reflect.get(K,r,i);const a=Reflect.get(n,r,i);return s(r)&&j.has(r)?a:e?(R(n,0,r),a):Pt(a)&&!c(n)?a.value:(R(n,0,r),u(a)?t?kt(a):bt(a):a)}}["includes","indexOf","lastIndexOf"].forEach(t=>{K[t]=function(...e){const n=Wt(this);for(let t=0,e=this.length;t<e;t++)R(n,0,t+"");const r=n[t](...e);return-1===r||!1===r?n[t](...e.map(Wt)):r}});const V=L(),C=L(!1,!0),F=L(!0),I=L(!0,!0);function L(t=!1,e=!1){return function(n,r,s,u){if(t&&O)return!0;const i=n[r];if(!e&&(s=Wt(s),!c(n)&&Pt(i)&&!Pt(s)))return i.value=s,!0;const a=o(n,r),f=Reflect.set(n,r,s,u);return n===Wt(u)&&(a?l(s,i)&&E(n,"set",r,s):E(n,"add",r,s)),f}}function q(t,e){const n=o(t,e),r=Reflect.deleteProperty(t,e);return r&&n&&E(t,"delete",e,void 0),r}function B(t,e){const n=Reflect.has(t,e);return R(t,0,e),n}function D(t){return R(t,0,p),Reflect.ownKeys(t)}const G={get:z,set:V,deleteProperty:q,has:B,ownKeys:D},H={get:x,set:F,has:B,ownKeys:D,deleteProperty:(t,e)=>!!O||q(t,e)},J={...G,get:P,set:C},Q={...H,get:A,set:I},T=t=>u(t)?bt(t):t,U=t=>u(t)?kt(t):t,X=t=>Reflect.getPrototypeOf(t);function Y(t,e,n){t=Wt(t);const r=Wt(e);R(t,0,r);const{has:o,get:c}=X(t);return o.call(t,e)?n(c.call(t,e)):o.call(t,r)?n(c.call(t,r)):void 0}function Z(t){const e=Wt(this),n=Wt(t);R(e,0,n);const r=X(e).has;return r.call(e,t)||r.call(e,n)}function $(t){return R(t=Wt(t),0,p),Reflect.get(X(t),"size",t)}function tt(t){t=Wt(t);const e=Wt(this),n=X(e),r=n.has.call(e,t),o=n.add.call(e,t);return r||E(e,"add",t,t),o}function et(t,e){e=Wt(e),t=Wt(t);const n=Wt(this),r=X(n),o=r.has.call(n,t),c=r.get.call(n,t),s=r.set.call(n,t,e);return o?l(e,c)&&E(n,"set",t,e):E(n,"add",t,e),s}function nt(t){const e=Wt(this),{has:n,get:r,delete:o}=X(e);let c=n.call(e,t);c||(t=Wt(t),c=n.call(e,t));r&&r.call(e,t);const s=o.call(e,t);return c&&E(e,"delete",t,void 0),s}function rt(){const t=Wt(this),e=0!==t.size,n=X(t).clear.call(t);return e&&E(t,"clear",void 0,void 0),n}function ot(t){return function(e,n){const r=this,o=Wt(r),c=t?U:T;return R(o,0,p),X(o).forEach.call(o,(function(t,n){return e.call(r,c(t),c(n),r)}),n)}}function ct(t,e){return function(...n){const r=Wt(this),o=r instanceof Map,c="entries"===t||t===Symbol.iterator&&o,s="keys"===t&&o,u=X(r)[t].apply(r,n),i=e?U:T;return R(r,0,s?g:p),{next(){const{value:t,done:e}=u.next();return e?{value:t,done:e}:{value:c?[i(t[0]),i(t[1])]:i(t),done:e}},[Symbol.iterator](){return this}}}}function st(t,e){return function(...n){return O?"delete"!==e&&this:t.apply(this,n)}}const ut={get(t){return Y(this,t,T)},get size(){return $(this)},has:Z,add:tt,set:et,delete:nt,clear:rt,forEach:ot(!1)},it={get(t){return Y(this,t,U)},get size(){return $(this)},has:Z,add:st(tt,"add"),set:st(et,"set"),delete:st(nt,"delete"),clear:st(rt,"clear"),forEach:ot(!0)};function at(t){return(e,n,r)=>Reflect.get(o(t,n)&&n in e?t:e,n,r)}["keys","values","entries",Symbol.iterator].forEach(t=>{ut[t]=ct(t,!1),it[t]=ct(t,!0)});const lt={get:at(ut)},ft={get:at(it)},dt=new WeakMap,ht=new WeakMap,pt=new WeakMap,gt=new WeakMap,vt=new WeakSet,yt=new WeakSet,wt=new Set([Set,Map,WeakMap,WeakSet]),St=t("Object,Array,Map,Set,WeakMap,WeakSet");function bt(t){return gt.has(t)?t:vt.has(t)?kt(t):Pt(t)?t:Rt(t,dt,ht,G,lt)}function kt(t){return ht.has(t)&&(t=ht.get(t)),Rt(t,pt,gt,H,ft)}function mt(t){return Rt(t,pt,gt,Q,ft)}function Mt(t){return Rt(t,dt,ht,J,lt)}function Rt(t,e,n,r,o){if(!u(t))return t;let c=e.get(t);if(void 0!==c)return c;if(n.has(t))return t;if((s=t)._isVue||s._isVNode||!St(a(s))||yt.has(s)||Object.isFrozen(s))return t;var s;const i=wt.has(t.constructor)?o:r;return c=new Proxy(t,i),e.set(t,c),n.set(c,t),c}function Et(t){return ht.has(t)||gt.has(t)}function Ot(t){return gt.has(t)}function Wt(t){return ht.get(t)||gt.get(t)||t}function _t(t){return vt.add(t),t}function jt(t){return yt.add(t),t}const zt=t=>u(t)?bt(t):t;function Pt(t){return!!t&&!0===t._isRef}function xt(t){return Kt(t)}function At(t){return Kt(t,!0)}function Kt(t,e=!1){if(Pt(t))return t;e||(t=zt(t));const n={_isRef:!0,get value(){return R(n,0,"value"),t},set value(r){t=e?r:zt(r),E(n,"set","value",void 0)}};return n}function Nt(t){return Pt(t)?t.value:t}function Vt(t){const e={};for(const n in t)e[n]=Ct(t,n);return e}function Ct(t,e){return{_isRef:!0,get value(){return t[e]},set value(n){t[e]=n}}}function Ft(t){let e,r;"function"==typeof t?(e=t,r=n):(e=t.get,r=t.set);let o,c,s=!0;const u=v(e,{lazy:!0,computed:!0,scheduler:()=>{s||(s=!0,E(c,"set","value"))}});return c={_isRef:!0,effect:u,get value(){return s&&(o=u(),s=!1),R(c,0,"value"),o},set value(t){r(t)}},c}export{p as ITERATE_KEY,Ft as computed,v as effect,m as enableTracking,Et as isReactive,Ot as isReadonly,Pt as isRef,W as lock,jt as markNonReactive,_t as markReadonly,k as pauseTracking,bt as reactive,kt as readonly,xt as ref,M as resetTracking,Mt as shallowReactive,mt as shallowReadonly,At as shallowRef,y as stop,Wt as toRaw,Vt as toRefs,R as track,E as trigger,_ as unlock,Nt as unref}; | ||
function t(t,e){const n=Object.create(null),r=t.split(",");for(let t=0;t<r.length;t++)n[r[t]]=!0;return e?t=>!!n[t.toLowerCase()]:t=>!!n[t]}const e={},n=()=>{},r=Object.prototype.hasOwnProperty,o=(t,e)=>r.call(t,e),c=Array.isArray,s=t=>"symbol"==typeof t,u=t=>null!==t&&"object"==typeof t,i=Object.prototype.toString,a=t=>(t=>i.call(t))(t).slice(8,-1),l=(t,e)=>t!==e&&(t==t||e==e),f=new WeakMap,d=[];let h;const p=Symbol(""),g=Symbol("");function v(t,n=e){(function(t){return t&&!0===t._isEffect})(t)&&(t=t.raw);const r=function(t,e){const n=function(...r){if(!n.active)return e.scheduler?void 0:t(...r);if(!d.includes(n)){w(n);try{return m(),d.push(n),h=n,t(...r)}finally{d.pop(),M(),h=d[d.length-1]}}};return n._isEffect=!0,n.active=!0,n.raw=t,n.deps=[],n.options=e,n}(t,n);return n.lazy||r(),r}function y(t){t.active&&(w(t),t.options.onStop&&t.options.onStop(),t.active=!1)}function w(t){const{deps:e}=t;if(e.length){for(let n=0;n<e.length;n++)e[n].delete(t);e.length=0}}let S=!0;const b=[];function k(){b.push(S),S=!1}function m(){b.push(S),S=!0}function M(){const t=b.pop();S=void 0===t||t}function R(t,e,n){if(!S||void 0===h)return;let r=f.get(t);void 0===r&&f.set(t,r=new Map);let o=r.get(n);void 0===o&&r.set(n,o=new Set),o.has(h)||(o.add(h),h.deps.push(o))}function E(t,e,n,r,o,s){const u=f.get(t);if(void 0===u)return;const i=new Set,a=new Set,l=t=>{void 0!==t&&t.forEach(t=>{t===h&&S||(t.options.computed?a.add(t):i.add(t))})};if("clear"===e)u.forEach(l);else if("length"===n&&c(t))u.forEach((t,e)=>{("length"===e||e>=r)&&l(t)});else{void 0!==n&&l(u.get(n));const r="add"===e||"delete"===e&&!c(t);(r||"set"===e&&t instanceof Map)&&l(u.get(c(t)?"length":p)),r&&t instanceof Map&&l(u.get(g))}const d=t=>{void 0!==t.options.scheduler?t.options.scheduler(t):t()};a.forEach(d),i.forEach(d)}let O=!0;function W(){O=!0}function _(){O=!1}const j=new Set(Object.getOwnPropertyNames(Symbol).map(t=>Symbol[t]).filter(s)),z=N(),P=N(!1,!0),x=N(!0),A=N(!0,!0),K={};function N(t=!1,e=!1){return function(n,r,i){if(c(n)&&o(K,r))return Reflect.get(K,r,i);const a=Reflect.get(n,r,i);return s(r)&&j.has(r)?a:e?(R(n,0,r),a):Pt(a)&&!c(n)?a.value:(R(n,0,r),u(a)?t?kt(a):bt(a):a)}}["includes","indexOf","lastIndexOf"].forEach(t=>{K[t]=function(...e){const n=Wt(this);for(let t=0,e=this.length;t<e;t++)R(n,0,t+"");const r=n[t](...e);return-1===r||!1===r?n[t](...e.map(Wt)):r}});const V=L(),C=L(!1,!0),F=L(!0),I=L(!0,!0);function L(t=!1,e=!1){return function(n,r,s,u){if(t&&O)return!0;const i=n[r];if(!e&&(s=Wt(s),!c(n)&&Pt(i)&&!Pt(s)))return i.value=s,!0;const a=o(n,r),f=Reflect.set(n,r,s,u);return n===Wt(u)&&(a?l(s,i)&&E(n,"set",r,s):E(n,"add",r,s)),f}}function q(t,e){const n=o(t,e),r=Reflect.deleteProperty(t,e);return r&&n&&E(t,"delete",e,void 0),r}function B(t,e){const n=Reflect.has(t,e);return R(t,0,e),n}function D(t){return R(t,0,p),Reflect.ownKeys(t)}const G={get:z,set:V,deleteProperty:q,has:B,ownKeys:D},H={get:x,set:F,has:B,ownKeys:D,deleteProperty:(t,e)=>!!O||q(t,e)},J={...G,get:P,set:C},Q={...H,get:A,set:I},T=t=>u(t)?bt(t):t,U=t=>u(t)?kt(t):t,X=t=>Reflect.getPrototypeOf(t);function Y(t,e,n){t=Wt(t);const r=Wt(e);e!==r&&R(t,0,e),R(t,0,r);const{has:o,get:c}=X(t);return o.call(t,e)?n(c.call(t,e)):o.call(t,r)?n(c.call(t,r)):void 0}function Z(t){const e=Wt(this),n=Wt(t);t!==n&&R(e,0,t),R(e,0,n);const r=X(e).has;return r.call(e,t)||r.call(e,n)}function $(t){return R(t=Wt(t),0,p),Reflect.get(X(t),"size",t)}function tt(t){t=Wt(t);const e=Wt(this),n=X(e),r=n.has.call(e,t),o=n.add.call(e,t);return r||E(e,"add",t,t),o}function et(t,e){e=Wt(e);const n=Wt(this),{has:r,get:o,set:c}=X(n);let s=r.call(n,t);s||(t=Wt(t),s=r.call(n,t));const u=o.call(n,t),i=c.call(n,t,e);return s?l(e,u)&&E(n,"set",t,e):E(n,"add",t,e),i}function nt(t){const e=Wt(this),{has:n,get:r,delete:o}=X(e);let c=n.call(e,t);c||(t=Wt(t),c=n.call(e,t));r&&r.call(e,t);const s=o.call(e,t);return c&&E(e,"delete",t,void 0),s}function rt(){const t=Wt(this),e=0!==t.size,n=X(t).clear.call(t);return e&&E(t,"clear",void 0,void 0),n}function ot(t){return function(e,n){const r=this,o=Wt(r),c=t?U:T;return R(o,0,p),X(o).forEach.call(o,(function(t,n){return e.call(r,c(t),c(n),r)}),n)}}function ct(t,e){return function(...n){const r=Wt(this),o=r instanceof Map,c="entries"===t||t===Symbol.iterator&&o,s="keys"===t&&o,u=X(r)[t].apply(r,n),i=e?U:T;return R(r,0,s?g:p),{next(){const{value:t,done:e}=u.next();return e?{value:t,done:e}:{value:c?[i(t[0]),i(t[1])]:i(t),done:e}},[Symbol.iterator](){return this}}}}function st(t,e){return function(...n){return O?"delete"!==e&&this:t.apply(this,n)}}const ut={get(t){return Y(this,t,T)},get size(){return $(this)},has:Z,add:tt,set:et,delete:nt,clear:rt,forEach:ot(!1)},it={get(t){return Y(this,t,U)},get size(){return $(this)},has:Z,add:st(tt,"add"),set:st(et,"set"),delete:st(nt,"delete"),clear:st(rt,"clear"),forEach:ot(!0)};function at(t){return(e,n,r)=>Reflect.get(o(t,n)&&n in e?t:e,n,r)}["keys","values","entries",Symbol.iterator].forEach(t=>{ut[t]=ct(t,!1),it[t]=ct(t,!0)});const lt={get:at(ut)},ft={get:at(it)},dt=new WeakMap,ht=new WeakMap,pt=new WeakMap,gt=new WeakMap,vt=new WeakSet,yt=new WeakSet,wt=new Set([Set,Map,WeakMap,WeakSet]),St=t("Object,Array,Map,Set,WeakMap,WeakSet");function bt(t){return gt.has(t)?t:vt.has(t)?kt(t):Pt(t)?t:Rt(t,dt,ht,G,lt)}function kt(t){return ht.has(t)&&(t=ht.get(t)),Rt(t,pt,gt,H,ft)}function mt(t){return Rt(t,pt,gt,Q,ft)}function Mt(t){return Rt(t,dt,ht,J,lt)}function Rt(t,e,n,r,o){if(!u(t))return t;let c=e.get(t);if(void 0!==c)return c;if(n.has(t))return t;if((s=t)._isVue||s._isVNode||!St(a(s))||yt.has(s)||Object.isFrozen(s))return t;var s;const i=wt.has(t.constructor)?o:r;return c=new Proxy(t,i),e.set(t,c),n.set(c,t),c}function Et(t){return ht.has(t)||gt.has(t)}function Ot(t){return gt.has(t)}function Wt(t){return ht.get(t)||gt.get(t)||t}function _t(t){return vt.add(t),t}function jt(t){return yt.add(t),t}const zt=t=>u(t)?bt(t):t;function Pt(t){return!!t&&!0===t._isRef}function xt(t){return Kt(t)}function At(t){return Kt(t,!0)}function Kt(t,e=!1){if(Pt(t))return t;e||(t=zt(t));const n={_isRef:!0,get value(){return R(n,0,"value"),t},set value(r){t=e?r:zt(r),E(n,"set","value",void 0)}};return n}function Nt(t){return Pt(t)?t.value:t}function Vt(t){const e={};for(const n in t)e[n]=Ct(t,n);return e}function Ct(t,e){return{_isRef:!0,get value(){return t[e]},set value(n){t[e]=n}}}function Ft(t){let e,r;"function"==typeof t?(e=t,r=n):(e=t.get,r=t.set);let o,c,s=!0;const u=v(e,{lazy:!0,computed:!0,scheduler:()=>{s||(s=!0,E(c,"set","value"))}});return c={_isRef:!0,effect:u,get value(){return s&&(o=u(),s=!1),R(c,0,"value"),o},set value(t){r(t)}},c}export{p as ITERATE_KEY,Ft as computed,v as effect,m as enableTracking,Et as isReactive,Ot as isReadonly,Pt as isRef,W as lock,jt as markNonReactive,_t as markReadonly,k as pauseTracking,bt as reactive,kt as readonly,xt as ref,M as resetTracking,Mt as shallowReactive,mt as shallowReadonly,At as shallowRef,y as stop,Wt as toRaw,Vt as toRefs,R as track,E as trigger,_ as unlock,Nt as unref}; |
@@ -379,2 +379,5 @@ var VueReactivity = (function (exports) { | ||
const rawKey = toRaw(key); | ||
if (key !== rawKey) { | ||
track(target, "get" /* GET */, key); | ||
} | ||
track(target, "get" /* GET */, rawKey); | ||
@@ -392,2 +395,5 @@ const { has, get } = getProto(target); | ||
const rawKey = toRaw(key); | ||
if (key !== rawKey) { | ||
track(target, "has" /* HAS */, key); | ||
} | ||
track(target, "has" /* HAS */, rawKey); | ||
@@ -415,9 +421,15 @@ const has = getProto(target).has; | ||
value = toRaw(value); | ||
key = toRaw(key); | ||
const target = toRaw(this); | ||
const proto = getProto(target); | ||
const hadKey = proto.has.call(target, key); | ||
const oldValue = proto.get.call(target, key); | ||
const result = proto.set.call(target, key, value); | ||
const { has, get, set } = getProto(target); | ||
let hadKey = has.call(target, key); | ||
if (!hadKey) { | ||
key = toRaw(key); | ||
hadKey = has.call(target, key); | ||
} | ||
else { | ||
checkIdentityKeys(target, has, key); | ||
} | ||
const oldValue = get.call(target, key); | ||
const result = set.call(target, key, value); | ||
if (!hadKey) { | ||
trigger(target, "add" /* ADD */, key, value); | ||
@@ -438,2 +450,5 @@ } | ||
} | ||
else { | ||
checkIdentityKeys(target, has, key); | ||
} | ||
const oldValue = get ? get.call(target, key) : undefined; | ||
@@ -563,2 +578,13 @@ // forward the operation before queueing reactions | ||
}; | ||
function checkIdentityKeys(target, has, key) { | ||
const rawKey = toRaw(key); | ||
if (rawKey !== key && has.call(target, rawKey)) { | ||
const type = toRawType(target); | ||
console.warn(`Reactive ${type} contains both the raw and reactive ` + | ||
`versions of the same object${type === `Map` ? `as keys` : ``}, ` + | ||
`which can lead to inconsistencies. ` + | ||
`Avoid differentiating between the raw and reactive versions ` + | ||
`of an object and only use the reactive version if possible.`); | ||
} | ||
} | ||
@@ -565,0 +591,0 @@ // WeakMaps that store {raw <-> observed} pairs. |
@@ -1,1 +0,1 @@ | ||
var VueReactivity=function(e){"use strict";function t(e,t){const n=Object.create(null),r=e.split(",");for(let e=0;e<r.length;e++)n[r[e]]=!0;return t?e=>!!n[e.toLowerCase()]:e=>!!n[e]}const n={},r=()=>{},o=Object.prototype.hasOwnProperty,c=(e,t)=>o.call(e,t),s=Array.isArray,u=e=>"symbol"==typeof e,a=e=>null!==e&&"object"==typeof e,i=Object.prototype.toString,l=e=>(e=>i.call(e))(e).slice(8,-1),f=(e,t)=>e!==t&&(e==e||t==t),d=new WeakMap,h=[];let p;const g=Symbol(""),v=Symbol("");function y(e,t=n){(function(e){return e&&!0===e._isEffect})(e)&&(e=e.raw);const r=function(e,t){const n=function(...r){if(!n.active)return t.scheduler?void 0:e(...r);if(!h.includes(n)){w(n);try{return S(),h.push(n),p=n,e(...r)}finally{h.pop(),b(),p=h[h.length-1]}}};return n._isEffect=!0,n.active=!0,n.raw=e,n.deps=[],n.options=t,n}(e,t);return t.lazy||r(),r}function w(e){const{deps:t}=e;if(t.length){for(let n=0;n<t.length;n++)t[n].delete(e);t.length=0}}let R=!0;const k=[];function S(){k.push(R),R=!0}function b(){const e=k.pop();R=void 0===e||e}function m(e,t,n){if(!R||void 0===p)return;let r=d.get(e);void 0===r&&d.set(e,r=new Map);let o=r.get(n);void 0===o&&r.set(n,o=new Set),o.has(p)||(o.add(p),p.deps.push(o))}function E(e,t,n,r,o,c){const u=d.get(e);if(void 0===u)return;const a=new Set,i=new Set,l=e=>{void 0!==e&&e.forEach(e=>{e===p&&R||(e.options.computed?i.add(e):a.add(e))})};if("clear"===t)u.forEach(l);else if("length"===n&&s(e))u.forEach((e,t)=>{("length"===t||t>=r)&&l(e)});else{void 0!==n&&l(u.get(n));const r="add"===t||"delete"===t&&!s(e);(r||"set"===t&&e instanceof Map)&&l(u.get(s(e)?"length":g)),r&&e instanceof Map&&l(u.get(v))}const f=e=>{void 0!==e.options.scheduler?e.options.scheduler(e):e()};i.forEach(f),a.forEach(f)}let M=!0;const O=new Set(Object.getOwnPropertyNames(Symbol).map(e=>Symbol[e]).filter(u)),W=x(),_=x(!1,!0),j=x(!0),z=x(!0,!0),P={};function x(e=!1,t=!1){return function(n,r,o){if(s(n)&&c(P,r))return Reflect.get(P,r,o);const i=Reflect.get(n,r,o);return u(r)&&O.has(r)?i:t?(m(n,0,r),i):be(i)&&!s(n)?i.value:(m(n,0,r),a(i)?e?we(i):ye(i):i)}}["includes","indexOf","lastIndexOf"].forEach(e=>{P[e]=function(...t){const n=ke(this);for(let e=0,t=this.length;e<t;e++)m(n,0,e+"");const r=n[e](...t);return-1===r||!1===r?n[e](...t.map(ke)):r}});const T=V(),A=V(!1,!0),K=V(!0),N=V(!0,!0);function V(e=!1,t=!1){return function(n,r,o,u){if(e&&M)return!0;const a=n[r];if(!t&&(o=ke(o),!s(n)&&be(a)&&!be(o)))return a.value=o,!0;const i=c(n,r),l=Reflect.set(n,r,o,u);return n===ke(u)&&(i?f(o,a)&&E(n,"set",r,o):E(n,"add",r,o)),l}}function I(e,t){const n=c(e,t),r=Reflect.deleteProperty(e,t);return r&&n&&E(e,"delete",t,void 0),r}function C(e,t){const n=Reflect.has(e,t);return m(e,0,t),n}function F(e){return m(e,0,g),Reflect.ownKeys(e)}const L={get:W,set:T,deleteProperty:I,has:C,ownKeys:F},Y={get:j,set:K,has:C,ownKeys:F,deleteProperty:(e,t)=>!!M||I(e,t)},q={...L,get:_,set:A},B={...Y,get:z,set:N},D=e=>a(e)?ye(e):e,G=e=>a(e)?we(e):e,H=e=>Reflect.getPrototypeOf(e);function J(e,t,n){e=ke(e);const r=ke(t);m(e,0,r);const{has:o,get:c}=H(e);return o.call(e,t)?n(c.call(e,t)):o.call(e,r)?n(c.call(e,r)):void 0}function Q(e){const t=ke(this),n=ke(e);m(t,0,n);const r=H(t).has;return r.call(t,e)||r.call(t,n)}function U(e){return m(e=ke(e),0,g),Reflect.get(H(e),"size",e)}function X(e){e=ke(e);const t=ke(this),n=H(t),r=n.has.call(t,e),o=n.add.call(t,e);return r||E(t,"add",e,e),o}function Z(e,t){t=ke(t),e=ke(e);const n=ke(this),r=H(n),o=r.has.call(n,e),c=r.get.call(n,e),s=r.set.call(n,e,t);return o?f(t,c)&&E(n,"set",e,t):E(n,"add",e,t),s}function $(e){const t=ke(this),{has:n,get:r,delete:o}=H(t);let c=n.call(t,e);c||(e=ke(e),c=n.call(t,e));r&&r.call(t,e);const s=o.call(t,e);return c&&E(t,"delete",e,void 0),s}function ee(){const e=ke(this),t=0!==e.size,n=H(e).clear.call(e);return t&&E(e,"clear",void 0,void 0),n}function te(e){return function(t,n){const r=this,o=ke(r),c=e?G:D;return m(o,0,g),H(o).forEach.call(o,(function(e,n){return t.call(r,c(e),c(n),r)}),n)}}function ne(e,t){return function(...n){const r=ke(this),o=r instanceof Map,c="entries"===e||e===Symbol.iterator&&o,s="keys"===e&&o,u=H(r)[e].apply(r,n),a=t?G:D;return m(r,0,s?v:g),{next(){const{value:e,done:t}=u.next();return t?{value:e,done:t}:{value:c?[a(e[0]),a(e[1])]:a(e),done:t}},[Symbol.iterator](){return this}}}}function re(e,t){return function(...n){return M?"delete"!==t&&this:e.apply(this,n)}}const oe={get(e){return J(this,e,D)},get size(){return U(this)},has:Q,add:X,set:Z,delete:$,clear:ee,forEach:te(!1)},ce={get(e){return J(this,e,G)},get size(){return U(this)},has:Q,add:re(X,"add"),set:re(Z,"set"),delete:re($,"delete"),clear:re(ee,"clear"),forEach:te(!0)};function se(e){return(t,n,r)=>Reflect.get(c(e,n)&&n in t?e:t,n,r)}["keys","values","entries",Symbol.iterator].forEach(e=>{oe[e]=ne(e,!1),ce[e]=ne(e,!0)});const ue={get:se(oe)},ae={get:se(ce)},ie=new WeakMap,le=new WeakMap,fe=new WeakMap,de=new WeakMap,he=new WeakSet,pe=new WeakSet,ge=new Set([Set,Map,WeakMap,WeakSet]),ve=t("Object,Array,Map,Set,WeakMap,WeakSet");function ye(e){return de.has(e)?e:he.has(e)?we(e):be(e)?e:Re(e,ie,le,L,ue)}function we(e){return le.has(e)&&(e=le.get(e)),Re(e,fe,de,Y,ae)}function Re(e,t,n,r,o){if(!a(e))return e;let c=t.get(e);if(void 0!==c)return c;if(n.has(e))return e;if((s=e)._isVue||s._isVNode||!ve(l(s))||pe.has(s)||Object.isFrozen(s))return e;var s;const u=ge.has(e.constructor)?o:r;return c=new Proxy(e,u),t.set(e,c),n.set(c,e),c}function ke(e){return le.get(e)||de.get(e)||e}const Se=e=>a(e)?ye(e):e;function be(e){return!!e&&!0===e._isRef}function me(e,t=!1){if(be(e))return e;t||(e=Se(e));const n={_isRef:!0,get value(){return m(n,0,"value"),e},set value(r){e=t?r:Se(r),E(n,"set","value",void 0)}};return n}function Ee(e,t){return{_isRef:!0,get value(){return e[t]},set value(n){e[t]=n}}}return e.ITERATE_KEY=g,e.computed=function(e){let t,n;"function"==typeof e?(t=e,n=r):(t=e.get,n=e.set);let o,c,s=!0;const u=y(t,{lazy:!0,computed:!0,scheduler:()=>{s||(s=!0,E(c,"set","value"))}});return c={_isRef:!0,effect:u,get value(){return s&&(o=u(),s=!1),m(c,0,"value"),o},set value(e){n(e)}},c},e.effect=y,e.enableTracking=S,e.isReactive=function(e){return le.has(e)||de.has(e)},e.isReadonly=function(e){return de.has(e)},e.isRef=be,e.lock=function(){M=!0},e.markNonReactive=function(e){return pe.add(e),e},e.markReadonly=function(e){return he.add(e),e},e.pauseTracking=function(){k.push(R),R=!1},e.reactive=ye,e.readonly=we,e.ref=function(e){return me(e)},e.resetTracking=b,e.shallowReactive=function(e){return Re(e,ie,le,q,ue)},e.shallowReadonly=function(e){return Re(e,fe,de,B,ae)},e.shallowRef=function(e){return me(e,!0)},e.stop=function(e){e.active&&(w(e),e.options.onStop&&e.options.onStop(),e.active=!1)},e.toRaw=ke,e.toRefs=function(e){const t={};for(const n in e)t[n]=Ee(e,n);return t},e.track=m,e.trigger=E,e.unlock=function(){M=!1},e.unref=function(e){return be(e)?e.value:e},e}({}); | ||
var VueReactivity=function(e){"use strict";function t(e,t){const n=Object.create(null),r=e.split(",");for(let e=0;e<r.length;e++)n[r[e]]=!0;return t?e=>!!n[e.toLowerCase()]:e=>!!n[e]}const n={},r=()=>{},o=Object.prototype.hasOwnProperty,c=(e,t)=>o.call(e,t),s=Array.isArray,u=e=>"symbol"==typeof e,a=e=>null!==e&&"object"==typeof e,i=Object.prototype.toString,l=e=>(e=>i.call(e))(e).slice(8,-1),f=(e,t)=>e!==t&&(e==e||t==t),d=new WeakMap,h=[];let p;const g=Symbol(""),v=Symbol("");function y(e,t=n){(function(e){return e&&!0===e._isEffect})(e)&&(e=e.raw);const r=function(e,t){const n=function(...r){if(!n.active)return t.scheduler?void 0:e(...r);if(!h.includes(n)){w(n);try{return S(),h.push(n),p=n,e(...r)}finally{h.pop(),b(),p=h[h.length-1]}}};return n._isEffect=!0,n.active=!0,n.raw=e,n.deps=[],n.options=t,n}(e,t);return t.lazy||r(),r}function w(e){const{deps:t}=e;if(t.length){for(let n=0;n<t.length;n++)t[n].delete(e);t.length=0}}let R=!0;const k=[];function S(){k.push(R),R=!0}function b(){const e=k.pop();R=void 0===e||e}function m(e,t,n){if(!R||void 0===p)return;let r=d.get(e);void 0===r&&d.set(e,r=new Map);let o=r.get(n);void 0===o&&r.set(n,o=new Set),o.has(p)||(o.add(p),p.deps.push(o))}function E(e,t,n,r,o,c){const u=d.get(e);if(void 0===u)return;const a=new Set,i=new Set,l=e=>{void 0!==e&&e.forEach(e=>{e===p&&R||(e.options.computed?i.add(e):a.add(e))})};if("clear"===t)u.forEach(l);else if("length"===n&&s(e))u.forEach((e,t)=>{("length"===t||t>=r)&&l(e)});else{void 0!==n&&l(u.get(n));const r="add"===t||"delete"===t&&!s(e);(r||"set"===t&&e instanceof Map)&&l(u.get(s(e)?"length":g)),r&&e instanceof Map&&l(u.get(v))}const f=e=>{void 0!==e.options.scheduler?e.options.scheduler(e):e()};i.forEach(f),a.forEach(f)}let M=!0;const O=new Set(Object.getOwnPropertyNames(Symbol).map(e=>Symbol[e]).filter(u)),W=x(),_=x(!1,!0),j=x(!0),z=x(!0,!0),P={};function x(e=!1,t=!1){return function(n,r,o){if(s(n)&&c(P,r))return Reflect.get(P,r,o);const i=Reflect.get(n,r,o);return u(r)&&O.has(r)?i:t?(m(n,0,r),i):be(i)&&!s(n)?i.value:(m(n,0,r),a(i)?e?we(i):ye(i):i)}}["includes","indexOf","lastIndexOf"].forEach(e=>{P[e]=function(...t){const n=ke(this);for(let e=0,t=this.length;e<t;e++)m(n,0,e+"");const r=n[e](...t);return-1===r||!1===r?n[e](...t.map(ke)):r}});const T=V(),A=V(!1,!0),K=V(!0),N=V(!0,!0);function V(e=!1,t=!1){return function(n,r,o,u){if(e&&M)return!0;const a=n[r];if(!t&&(o=ke(o),!s(n)&&be(a)&&!be(o)))return a.value=o,!0;const i=c(n,r),l=Reflect.set(n,r,o,u);return n===ke(u)&&(i?f(o,a)&&E(n,"set",r,o):E(n,"add",r,o)),l}}function I(e,t){const n=c(e,t),r=Reflect.deleteProperty(e,t);return r&&n&&E(e,"delete",t,void 0),r}function C(e,t){const n=Reflect.has(e,t);return m(e,0,t),n}function F(e){return m(e,0,g),Reflect.ownKeys(e)}const L={get:W,set:T,deleteProperty:I,has:C,ownKeys:F},Y={get:j,set:K,has:C,ownKeys:F,deleteProperty:(e,t)=>!!M||I(e,t)},q={...L,get:_,set:A},B={...Y,get:z,set:N},D=e=>a(e)?ye(e):e,G=e=>a(e)?we(e):e,H=e=>Reflect.getPrototypeOf(e);function J(e,t,n){e=ke(e);const r=ke(t);t!==r&&m(e,0,t),m(e,0,r);const{has:o,get:c}=H(e);return o.call(e,t)?n(c.call(e,t)):o.call(e,r)?n(c.call(e,r)):void 0}function Q(e){const t=ke(this),n=ke(e);e!==n&&m(t,0,e),m(t,0,n);const r=H(t).has;return r.call(t,e)||r.call(t,n)}function U(e){return m(e=ke(e),0,g),Reflect.get(H(e),"size",e)}function X(e){e=ke(e);const t=ke(this),n=H(t),r=n.has.call(t,e),o=n.add.call(t,e);return r||E(t,"add",e,e),o}function Z(e,t){t=ke(t);const n=ke(this),{has:r,get:o,set:c}=H(n);let s=r.call(n,e);s||(e=ke(e),s=r.call(n,e));const u=o.call(n,e),a=c.call(n,e,t);return s?f(t,u)&&E(n,"set",e,t):E(n,"add",e,t),a}function $(e){const t=ke(this),{has:n,get:r,delete:o}=H(t);let c=n.call(t,e);c||(e=ke(e),c=n.call(t,e));r&&r.call(t,e);const s=o.call(t,e);return c&&E(t,"delete",e,void 0),s}function ee(){const e=ke(this),t=0!==e.size,n=H(e).clear.call(e);return t&&E(e,"clear",void 0,void 0),n}function te(e){return function(t,n){const r=this,o=ke(r),c=e?G:D;return m(o,0,g),H(o).forEach.call(o,(function(e,n){return t.call(r,c(e),c(n),r)}),n)}}function ne(e,t){return function(...n){const r=ke(this),o=r instanceof Map,c="entries"===e||e===Symbol.iterator&&o,s="keys"===e&&o,u=H(r)[e].apply(r,n),a=t?G:D;return m(r,0,s?v:g),{next(){const{value:e,done:t}=u.next();return t?{value:e,done:t}:{value:c?[a(e[0]),a(e[1])]:a(e),done:t}},[Symbol.iterator](){return this}}}}function re(e,t){return function(...n){return M?"delete"!==t&&this:e.apply(this,n)}}const oe={get(e){return J(this,e,D)},get size(){return U(this)},has:Q,add:X,set:Z,delete:$,clear:ee,forEach:te(!1)},ce={get(e){return J(this,e,G)},get size(){return U(this)},has:Q,add:re(X,"add"),set:re(Z,"set"),delete:re($,"delete"),clear:re(ee,"clear"),forEach:te(!0)};function se(e){return(t,n,r)=>Reflect.get(c(e,n)&&n in t?e:t,n,r)}["keys","values","entries",Symbol.iterator].forEach(e=>{oe[e]=ne(e,!1),ce[e]=ne(e,!0)});const ue={get:se(oe)},ae={get:se(ce)},ie=new WeakMap,le=new WeakMap,fe=new WeakMap,de=new WeakMap,he=new WeakSet,pe=new WeakSet,ge=new Set([Set,Map,WeakMap,WeakSet]),ve=t("Object,Array,Map,Set,WeakMap,WeakSet");function ye(e){return de.has(e)?e:he.has(e)?we(e):be(e)?e:Re(e,ie,le,L,ue)}function we(e){return le.has(e)&&(e=le.get(e)),Re(e,fe,de,Y,ae)}function Re(e,t,n,r,o){if(!a(e))return e;let c=t.get(e);if(void 0!==c)return c;if(n.has(e))return e;if((s=e)._isVue||s._isVNode||!ve(l(s))||pe.has(s)||Object.isFrozen(s))return e;var s;const u=ge.has(e.constructor)?o:r;return c=new Proxy(e,u),t.set(e,c),n.set(c,e),c}function ke(e){return le.get(e)||de.get(e)||e}const Se=e=>a(e)?ye(e):e;function be(e){return!!e&&!0===e._isRef}function me(e,t=!1){if(be(e))return e;t||(e=Se(e));const n={_isRef:!0,get value(){return m(n,0,"value"),e},set value(r){e=t?r:Se(r),E(n,"set","value",void 0)}};return n}function Ee(e,t){return{_isRef:!0,get value(){return e[t]},set value(n){e[t]=n}}}return e.ITERATE_KEY=g,e.computed=function(e){let t,n;"function"==typeof e?(t=e,n=r):(t=e.get,n=e.set);let o,c,s=!0;const u=y(t,{lazy:!0,computed:!0,scheduler:()=>{s||(s=!0,E(c,"set","value"))}});return c={_isRef:!0,effect:u,get value(){return s&&(o=u(),s=!1),m(c,0,"value"),o},set value(e){n(e)}},c},e.effect=y,e.enableTracking=S,e.isReactive=function(e){return le.has(e)||de.has(e)},e.isReadonly=function(e){return de.has(e)},e.isRef=be,e.lock=function(){M=!0},e.markNonReactive=function(e){return pe.add(e),e},e.markReadonly=function(e){return he.add(e),e},e.pauseTracking=function(){k.push(R),R=!1},e.reactive=ye,e.readonly=we,e.ref=function(e){return me(e)},e.resetTracking=b,e.shallowReactive=function(e){return Re(e,ie,le,q,ue)},e.shallowReadonly=function(e){return Re(e,fe,de,B,ae)},e.shallowRef=function(e){return me(e,!0)},e.stop=function(e){e.active&&(w(e),e.options.onStop&&e.options.onStop(),e.active=!1)},e.toRaw=ke,e.toRefs=function(e){const t={};for(const n in e)t[n]=Ee(e,n);return t},e.track=m,e.trigger=E,e.unlock=function(){M=!1},e.unref=function(e){return be(e)?e.value:e},e}({}); |
{ | ||
"name": "@vue/reactivity", | ||
"version": "3.0.0-alpha.11", | ||
"version": "3.0.0-alpha.12", | ||
"description": "@vue/reactivity", | ||
@@ -37,4 +37,4 @@ "main": "index.js", | ||
"dependencies": { | ||
"@vue/shared": "3.0.0-alpha.11" | ||
"@vue/shared": "3.0.0-alpha.12" | ||
} | ||
} |
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
149621
3950
15
+ Added@vue/shared@3.0.0-alpha.12(transitive)
- Removed@vue/shared@3.0.0-alpha.11(transitive)
Updated@vue/shared@3.0.0-alpha.12