Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@vue/reactivity

Package Overview
Dependencies
Maintainers
1
Versions
237
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vue/reactivity - npm Package Compare versions

Comparing version 3.0.0-rc.10 to 3.0.0-rc.11

65

dist/reactivity.cjs.js

@@ -120,7 +120,3 @@ 'use strict';

if (effectsToAdd) {
effectsToAdd.forEach(effect => {
if (effect !== activeEffect) {
effects.add(effect);
}
});
effectsToAdd.forEach(effect => effects.add(effect));
}

@@ -146,12 +142,29 @@ };

// also run for iteration key on ADD | DELETE | Map.SET
const shouldTriggerIteration = (type === "add" /* ADD */ &&
(!shared.isArray(target) || shared.isIntegerKey(key))) ||
(type === "delete" /* DELETE */ && !shared.isArray(target));
if (shouldTriggerIteration ||
(type === "set" /* SET */ && target instanceof Map)) {
add(depsMap.get(shared.isArray(target) ? 'length' : ITERATE_KEY));
switch (type) {
case "add" /* ADD */:
if (!shared.isArray(target)) {
add(depsMap.get(ITERATE_KEY));
if (shared.isMap(target)) {
add(depsMap.get(MAP_KEY_ITERATE_KEY));
}
}
else if (shared.isIntegerKey(key)) {
// new index added to array -> length changes
add(depsMap.get('length'));
}
break;
case "delete" /* DELETE */:
if (!shared.isArray(target)) {
add(depsMap.get(ITERATE_KEY));
if (shared.isMap(target)) {
add(depsMap.get(MAP_KEY_ITERATE_KEY));
}
}
break;
case "set" /* SET */:
if (shared.isMap(target)) {
add(depsMap.get(ITERATE_KEY));
}
break;
}
if (shouldTriggerIteration && target instanceof Map) {
add(depsMap.get(MAP_KEY_ITERATE_KEY));
}
}

@@ -374,3 +387,3 @@ const run = (effect) => {

const hadKey = proto.has.call(target, value);
const result = proto.add.call(target, value);
const result = target.add(value);
if (!hadKey) {

@@ -384,3 +397,3 @@ trigger(target, "add" /* ADD */, value, value);

const target = toRaw(this);
const { has, get, set } = getProto(target);
const { has, get } = getProto(target);
let hadKey = has.call(target, key);

@@ -395,3 +408,3 @@ if (!hadKey) {

const oldValue = get.call(target, key);
const result = set.call(target, key, value);
const result = target.set(key, value);
if (!hadKey) {

@@ -407,3 +420,3 @@ trigger(target, "add" /* ADD */, key, value);

const target = toRaw(this);
const { has, get, delete: del } = getProto(target);
const { has, get } = getProto(target);
let hadKey = has.call(target, key);

@@ -419,3 +432,3 @@ if (!hadKey) {

// forward the operation before queueing reactions
const result = del.call(target, key);
const result = target.delete(key);
if (hadKey) {

@@ -429,3 +442,3 @@ trigger(target, "delete" /* DELETE */, key, undefined, oldValue);

const hadItems = target.size !== 0;
const oldTarget = target instanceof Map
const oldTarget = shared.isMap(target)
? new Map(target)

@@ -435,3 +448,3 @@ : new Set(target)

// forward the operation before queueing reactions
const result = getProto(target).clear.call(target);
const result = target.clear();
if (hadItems) {

@@ -461,5 +474,5 @@ trigger(target, "clear" /* CLEAR */, undefined, undefined, oldTarget);

const rawTarget = toRaw(target);
const isMap = rawTarget instanceof Map;
const isPair = method === 'entries' || (method === Symbol.iterator && isMap);
const isKeyOnly = method === 'keys' && isMap;
const targetIsMap = shared.isMap(rawTarget);
const isPair = method === 'entries' || (method === Symbol.iterator && targetIsMap);
const isKeyOnly = method === 'keys' && targetIsMap;
const innerIterator = target[method](...args);

@@ -782,3 +795,5 @@ const wrap = isReadonly ? toReadonly : isShallow ? toShallow : toReactive;

function toRef(object, key) {
return new ObjectRefImpl(object, key);
return isRef(object[key])
? object[key]
: new ObjectRefImpl(object, key);
}

@@ -785,0 +800,0 @@

@@ -112,7 +112,3 @@ 'use strict';

if (effectsToAdd) {
effectsToAdd.forEach(effect => {
if (effect !== activeEffect) {
effects.add(effect);
}
});
effectsToAdd.forEach(effect => effects.add(effect));
}

@@ -138,12 +134,29 @@ };

// also run for iteration key on ADD | DELETE | Map.SET
const shouldTriggerIteration = (type === "add" /* ADD */ &&
(!shared.isArray(target) || shared.isIntegerKey(key))) ||
(type === "delete" /* DELETE */ && !shared.isArray(target));
if (shouldTriggerIteration ||
(type === "set" /* SET */ && target instanceof Map)) {
add(depsMap.get(shared.isArray(target) ? 'length' : ITERATE_KEY));
switch (type) {
case "add" /* ADD */:
if (!shared.isArray(target)) {
add(depsMap.get(ITERATE_KEY));
if (shared.isMap(target)) {
add(depsMap.get(MAP_KEY_ITERATE_KEY));
}
}
else if (shared.isIntegerKey(key)) {
// new index added to array -> length changes
add(depsMap.get('length'));
}
break;
case "delete" /* DELETE */:
if (!shared.isArray(target)) {
add(depsMap.get(ITERATE_KEY));
if (shared.isMap(target)) {
add(depsMap.get(MAP_KEY_ITERATE_KEY));
}
}
break;
case "set" /* SET */:
if (shared.isMap(target)) {
add(depsMap.get(ITERATE_KEY));
}
break;
}
if (shouldTriggerIteration && target instanceof Map) {
add(depsMap.get(MAP_KEY_ITERATE_KEY));
}
}

@@ -349,3 +362,3 @@ const run = (effect) => {

const hadKey = proto.has.call(target, value);
const result = proto.add.call(target, value);
const result = target.add(value);
if (!hadKey) {

@@ -359,3 +372,3 @@ trigger(target, "add" /* ADD */, value, value);

const target = toRaw(this);
const { has, get, set } = getProto(target);
const { has, get } = getProto(target);
let hadKey = has.call(target, key);

@@ -367,3 +380,3 @@ if (!hadKey) {

const oldValue = get.call(target, key);
const result = set.call(target, key, value);
const result = target.set(key, value);
if (!hadKey) {

@@ -379,3 +392,3 @@ trigger(target, "add" /* ADD */, key, value);

const target = toRaw(this);
const { has, get, delete: del } = getProto(target);
const { has, get } = getProto(target);
let hadKey = has.call(target, key);

@@ -388,3 +401,3 @@ if (!hadKey) {

// forward the operation before queueing reactions
const result = del.call(target, key);
const result = target.delete(key);
if (hadKey) {

@@ -399,3 +412,3 @@ trigger(target, "delete" /* DELETE */, key, undefined);

// forward the operation before queueing reactions
const result = getProto(target).clear.call(target);
const result = target.clear();
if (hadItems) {

@@ -425,5 +438,5 @@ trigger(target, "clear" /* CLEAR */, undefined, undefined);

const rawTarget = toRaw(target);
const isMap = rawTarget instanceof Map;
const isPair = method === 'entries' || (method === Symbol.iterator && isMap);
const isKeyOnly = method === 'keys' && isMap;
const targetIsMap = shared.isMap(rawTarget);
const isPair = method === 'entries' || (method === Symbol.iterator && targetIsMap);
const isKeyOnly = method === 'keys' && targetIsMap;
const innerIterator = target[method](...args);

@@ -725,3 +738,5 @@ const wrap = isReadonly ? toReadonly : isShallow ? toShallow : toReactive;

function toRef(object, key) {
return new ObjectRefImpl(object, key);
return isRef(object[key])
? object[key]
: new ObjectRefImpl(object, key);
}

@@ -728,0 +743,0 @@

@@ -7,2 +7,3 @@ const EMPTY_OBJ = Object.freeze({})

const isArray = Array.isArray;
const isMap = (val) => toTypeString(val) === '[object Map]';
const isFunction = (val) => typeof val === 'function';

@@ -17,3 +18,6 @@ const isString = (val) => typeof val === 'string';

};
const isIntegerKey = (key) => isString(key) && key[0] !== '-' && '' + parseInt(key, 10) === key;
const isIntegerKey = (key) => isString(key) &&
key !== 'NaN' &&
key[0] !== '-' &&
'' + parseInt(key, 10) === key;
const cacheStringFunction = (fn) => {

@@ -155,7 +159,3 @@ const cache = Object.create(null);

if (effectsToAdd) {
effectsToAdd.forEach(effect => {
if (effect !== activeEffect) {
effects.add(effect);
}
});
effectsToAdd.forEach(effect => effects.add(effect));
}

@@ -181,12 +181,29 @@ };

// also run for iteration key on ADD | DELETE | Map.SET
const shouldTriggerIteration = (type === "add" /* ADD */ &&
(!isArray(target) || isIntegerKey(key))) ||
(type === "delete" /* DELETE */ && !isArray(target));
if (shouldTriggerIteration ||
(type === "set" /* SET */ && target instanceof Map)) {
add(depsMap.get(isArray(target) ? 'length' : ITERATE_KEY));
switch (type) {
case "add" /* ADD */:
if (!isArray(target)) {
add(depsMap.get(ITERATE_KEY));
if (isMap(target)) {
add(depsMap.get(MAP_KEY_ITERATE_KEY));
}
}
else if (isIntegerKey(key)) {
// new index added to array -> length changes
add(depsMap.get('length'));
}
break;
case "delete" /* DELETE */:
if (!isArray(target)) {
add(depsMap.get(ITERATE_KEY));
if (isMap(target)) {
add(depsMap.get(MAP_KEY_ITERATE_KEY));
}
}
break;
case "set" /* SET */:
if (isMap(target)) {
add(depsMap.get(ITERATE_KEY));
}
break;
}
if (shouldTriggerIteration && target instanceof Map) {
add(depsMap.get(MAP_KEY_ITERATE_KEY));
}
}

@@ -409,3 +426,3 @@ const run = (effect) => {

const hadKey = proto.has.call(target, value);
const result = proto.add.call(target, value);
const result = target.add(value);
if (!hadKey) {

@@ -419,3 +436,3 @@ trigger(target, "add" /* ADD */, value, value);

const target = toRaw(this);
const { has, get, set } = getProto(target);
const { has, get } = getProto(target);
let hadKey = has.call(target, key);

@@ -430,3 +447,3 @@ if (!hadKey) {

const oldValue = get.call(target, key);
const result = set.call(target, key, value);
const result = target.set(key, value);
if (!hadKey) {

@@ -442,3 +459,3 @@ trigger(target, "add" /* ADD */, key, value);

const target = toRaw(this);
const { has, get, delete: del } = getProto(target);
const { has, get } = getProto(target);
let hadKey = has.call(target, key);

@@ -454,3 +471,3 @@ if (!hadKey) {

// forward the operation before queueing reactions
const result = del.call(target, key);
const result = target.delete(key);
if (hadKey) {

@@ -464,3 +481,3 @@ trigger(target, "delete" /* DELETE */, key, undefined, oldValue);

const hadItems = target.size !== 0;
const oldTarget = target instanceof Map
const oldTarget = isMap(target)
? new Map(target)

@@ -470,3 +487,3 @@ : new Set(target)

// forward the operation before queueing reactions
const result = getProto(target).clear.call(target);
const result = target.clear();
if (hadItems) {

@@ -496,5 +513,5 @@ trigger(target, "clear" /* CLEAR */, undefined, undefined, oldTarget);

const rawTarget = toRaw(target);
const isMap = rawTarget instanceof Map;
const isPair = method === 'entries' || (method === Symbol.iterator && isMap);
const isKeyOnly = method === 'keys' && isMap;
const targetIsMap = isMap(rawTarget);
const isPair = method === 'entries' || (method === Symbol.iterator && targetIsMap);
const isKeyOnly = method === 'keys' && targetIsMap;
const innerIterator = target[method](...args);

@@ -817,3 +834,5 @@ const wrap = isReadonly ? toReadonly : isShallow ? toShallow : toReactive;

function toRef(object, key) {
return new ObjectRefImpl(object, key);
return isRef(object[key])
? object[key]
: new ObjectRefImpl(object, key);
}

@@ -820,0 +839,0 @@

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

const t={},e=()=>{},n=Object.assign,r=Object.prototype.hasOwnProperty,s=(t,e)=>r.call(t,e),i=Array.isArray,o=t=>"function"==typeof t,c=t=>"symbol"==typeof t,u=t=>null!==t&&"object"==typeof t,a=Object.prototype.toString,l=t=>(t=>a.call(t))(t).slice(8,-1),f=t=>"string"==typeof t&&"-"!==t[0]&&""+parseInt(t,10)===t,_=(t,e)=>t!==e&&(t==t||e==e),h=new WeakMap,v=[];let d;const g=Symbol(""),p=Symbol("");function y(e,n=t){(function(t){return t&&!0===t._isEffect})(e)&&(e=e.raw);const r=function(t,e){const n=function(){if(!n.active)return e.scheduler?void 0:t();if(!v.includes(n)){b(n);try{return k(),v.push(n),d=n,t()}finally{v.pop(),O(),d=v[v.length-1]}}};return n.id=R++,n._isEffect=!0,n.active=!0,n.raw=t,n.deps=[],n.options=e,n}(e,n);return n.lazy||r(),r}function w(t){t.active&&(b(t),t.options.onStop&&t.options.onStop(),t.active=!1)}let R=0;function b(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 m=[];function E(){m.push(S),S=!1}function k(){m.push(S),S=!0}function O(){const t=m.pop();S=void 0===t||t}function j(t,e,n){if(!S||void 0===d)return;let r=h.get(t);r||h.set(t,r=new Map);let s=r.get(n);s||r.set(n,s=new Set),s.has(d)||(s.add(d),d.deps.push(s))}function M(t,e,n,r,s,o){const c=h.get(t);if(!c)return;const u=new Set,a=t=>{t&&t.forEach(t=>{t!==d&&u.add(t)})};if("clear"===e)c.forEach(a);else if("length"===n&&i(t))c.forEach((t,e)=>{("length"===e||e>=r)&&a(t)});else{void 0!==n&&a(c.get(n));const r="add"===e&&(!i(t)||f(n))||"delete"===e&&!i(t);(r||"set"===e&&t instanceof Map)&&a(c.get(i(t)?"length":g)),r&&t instanceof Map&&a(c.get(p))}u.forEach(t=>{t.options.scheduler?t.options.scheduler(t):t()})}const P=new Set(Object.getOwnPropertyNames(Symbol).map(t=>Symbol[t]).filter(c)),x=I(),z=I(!1,!0),W=I(!0),A=I(!0,!0),V={};function I(t=!1,e=!1){return function(n,r,o){if("__v_isReactive"===r)return!t;if("__v_isReadonly"===r)return t;if("__v_raw"===r&&o===(t?at:ut).get(n))return n;const a=i(n);if(a&&s(V,r))return Reflect.get(V,r,o);const l=Reflect.get(n,r,o);if(c(r)?P.has(r):"__proto__"===r||"__v_isRef"===r)return l;if(t||j(n,0,r),e)return l;if(bt(l)){return!a||!f(r)?l.value:l}return u(l)?t?_t(l):lt(l):l}}["includes","indexOf","lastIndexOf"].forEach(t=>{V[t]=function(...e){const n=yt(this);for(let t=0,e=this.length;t<e;t++)j(n,0,t+"");const r=n[t](...e);return-1===r||!1===r?n[t](...e.map(yt)):r}});function K(t=!1){return function(e,n,r,o){const c=e[n];if(!t&&(r=yt(r),!i(e)&&bt(c)&&!bt(r)))return c.value=r,!0;const u=i(e)&&f(n)?Number(n)<e.length:s(e,n),a=Reflect.set(e,n,r,o);return e===yt(o)&&(u?_(r,c)&&M(e,"set",n,r):M(e,"add",n,r)),a}}const N={get:x,set:K(),deleteProperty:function(t,e){const n=s(t,e),r=Reflect.deleteProperty(t,e);return r&&n&&M(t,"delete",e,void 0),r},has:function(t,e){const n=Reflect.has(t,e);return c(e)&&P.has(e)||j(t,0,e),n},ownKeys:function(t){return j(t,0,g),Reflect.ownKeys(t)}},B={get:W,set:(t,e)=>!0,deleteProperty:(t,e)=>!0},q=n({},N,{get:z,set:K(!0)}),C=n({},B,{get:A}),D=t=>u(t)?lt(t):t,F=t=>u(t)?_t(t):t,G=t=>t,H=t=>Reflect.getPrototypeOf(t);function J(t,e,n=!1,r=!1){const s=yt(t=t.__v_raw),i=yt(e);e!==i&&!n&&j(s,0,e),!n&&j(s,0,i);const{has:o}=H(s),c=n?F:r?G:D;return o.call(s,e)?c(t.get(e)):o.call(s,i)?c(t.get(i)):void 0}function L(t,e=!1){const n=this.__v_raw,r=yt(n),s=yt(t);return t!==s&&!e&&j(r,0,t),!e&&j(r,0,s),t===s?n.has(t):n.has(t)||n.has(s)}function Q(t,e=!1){return t=t.__v_raw,!e&&j(yt(t),0,g),Reflect.get(t,"size",t)}function T(t){t=yt(t);const e=yt(this),n=H(e),r=n.has.call(e,t),s=n.add.call(e,t);return r||M(e,"add",t,t),s}function U(t,e){e=yt(e);const n=yt(this),{has:r,get:s,set:i}=H(n);let o=r.call(n,t);o||(t=yt(t),o=r.call(n,t));const c=s.call(n,t),u=i.call(n,t,e);return o?_(e,c)&&M(n,"set",t,e):M(n,"add",t,e),u}function X(t){const e=yt(this),{has:n,get:r,delete:s}=H(e);let i=n.call(e,t);i||(t=yt(t),i=n.call(e,t));r&&r.call(e,t);const o=s.call(e,t);return i&&M(e,"delete",t,void 0),o}function Y(){const t=yt(this),e=0!==t.size,n=H(t).clear.call(t);return e&&M(t,"clear",void 0,void 0),n}function Z(t,e){return function(n,r){const s=this,i=s.__v_raw,o=yt(i),c=t?F:e?G:D;return!t&&j(o,0,g),i.forEach((t,e)=>n.call(r,c(t),c(e),s))}}function $(t,e,n){return function(...r){const s=this.__v_raw,i=yt(s),o=i instanceof Map,c="entries"===t||t===Symbol.iterator&&o,u="keys"===t&&o,a=s[t](...r),l=e?F:n?G:D;return!e&&j(i,0,u?p:g),{next(){const{value:t,done:e}=a.next();return e?{value:t,done:e}:{value:c?[l(t[0]),l(t[1])]:l(t),done:e}},[Symbol.iterator](){return this}}}}function tt(t){return function(...e){return"delete"!==t&&this}}const et={get(t){return J(this,t)},get size(){return Q(this)},has:L,add:T,set:U,delete:X,clear:Y,forEach:Z(!1,!1)},nt={get(t){return J(this,t,!1,!0)},get size(){return Q(this)},has:L,add:T,set:U,delete:X,clear:Y,forEach:Z(!1,!0)},rt={get(t){return J(this,t,!0)},get size(){return Q(this,!0)},has(t){return L.call(this,t,!0)},add:tt("add"),set:tt("set"),delete:tt("delete"),clear:tt("clear"),forEach:Z(!0,!1)};function st(t,e){const n=e?nt:t?rt:et;return(e,r,i)=>"__v_isReactive"===r?!t:"__v_isReadonly"===r?t:"__v_raw"===r?e:Reflect.get(s(n,r)&&r in e?n:e,r,i)}["keys","values","entries",Symbol.iterator].forEach(t=>{et[t]=$(t,!1,!1),rt[t]=$(t,!0,!1),nt[t]=$(t,!1,!0)});const it={get:st(!1,!1)},ot={get:st(!1,!0)},ct={get:st(!0,!1)},ut=new WeakMap,at=new WeakMap;function lt(t){return t&&t.__v_isReadonly?t:vt(t,!1,N,it)}function ft(t){return vt(t,!1,q,ot)}function _t(t){return vt(t,!0,B,ct)}function ht(t){return vt(t,!0,C,ct)}function vt(t,e,n,r){if(!u(t))return t;if(t.__v_raw&&(!e||!t.__v_isReactive))return t;const s=e?at:ut,i=s.get(t);if(i)return i;const o=(c=t).__v_skip||!Object.isExtensible(c)?0:function(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}(l(c));var c;if(0===o)return t;const a=new Proxy(t,2===o?r:n);return s.set(t,a),a}function dt(t){return gt(t)?dt(t.__v_raw):!(!t||!t.__v_isReactive)}function gt(t){return!(!t||!t.__v_isReadonly)}function pt(t){return dt(t)||gt(t)}function yt(t){return t&&yt(t.__v_raw)||t}function wt(t){return((t,e,n)=>{Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value:n})})(t,"__v_skip",!0),t}const Rt=t=>u(t)?lt(t):t;function bt(t){return Boolean(t&&!0===t.__v_isRef)}function St(t){return kt(t)}function mt(t){return kt(t,!0)}class Et{constructor(t,e=!1){this._rawValue=t,this._shallow=e,this.__v_isRef=!0,this._value=e?t:Rt(t)}get value(){return j(yt(this),0,"value"),this._value}set value(t){_(yt(t),this._rawValue)&&(this._rawValue=t,this._value=this._shallow?t:Rt(t),M(yt(this),"set","value",t))}}function kt(t,e=!1){return bt(t)?t:new Et(t,e)}function Ot(t){M(t,"set","value",void 0)}function jt(t){return bt(t)?t.value:t}const Mt={get:(t,e,n)=>jt(Reflect.get(t,e,n)),set:(t,e,n,r)=>{const s=t[e];return bt(s)&&!bt(n)?(s.value=n,!0):Reflect.set(t,e,n,r)}};function Pt(t){return dt(t)?t:new Proxy(t,Mt)}class xt{constructor(t){this.__v_isRef=!0;const{get:e,set:n}=t(()=>j(this,0,"value"),()=>M(this,"set","value"));this._get=e,this._set=n}get value(){return this._get()}set value(t){this._set(t)}}function zt(t){return new xt(t)}function Wt(t){const e=i(t)?new Array(t.length):{};for(const n in t)e[n]=Vt(t,n);return e}class At{constructor(t,e){this._object=t,this._key=e,this.__v_isRef=!0}get value(){return this._object[this._key]}set value(t){this._object[this._key]=t}}function Vt(t,e){return new At(t,e)}class It{constructor(t,e,n){this._setter=e,this._dirty=!0,this.__v_isRef=!0,this.effect=y(t,{lazy:!0,scheduler:()=>{this._dirty||(this._dirty=!0,M(yt(this),"set","value"))}}),this.__v_isReadonly=n}get value(){return this._dirty&&(this._value=this.effect(),this._dirty=!1),j(yt(this),0,"value"),this._value}set value(t){this._setter(t)}}function Kt(t){let n,r;return o(t)?(n=t,r=e):(n=t.get,r=t.set),new It(n,r,o(t)||!t.set)}export{g as ITERATE_KEY,Kt as computed,zt as customRef,y as effect,k as enableTracking,pt as isProxy,dt as isReactive,gt as isReadonly,bt as isRef,wt as markRaw,E as pauseTracking,Pt as proxyRefs,lt as reactive,_t as readonly,St as ref,O as resetTracking,ft as shallowReactive,ht as shallowReadonly,mt as shallowRef,w as stop,yt as toRaw,Vt as toRef,Wt as toRefs,j as track,M as trigger,Ot as triggerRef,jt as unref};
const t={},e=()=>{},n=Object.assign,r=Object.prototype.hasOwnProperty,s=(t,e)=>r.call(t,e),i=Array.isArray,o=t=>"[object Map]"===f(t),c=t=>"function"==typeof t,u=t=>"symbol"==typeof t,a=t=>null!==t&&"object"==typeof t,l=Object.prototype.toString,f=t=>l.call(t),_=t=>"string"==typeof t&&"NaN"!==t&&"-"!==t[0]&&""+parseInt(t,10)===t,h=(t,e)=>t!==e&&(t==t||e==e),v=new WeakMap,d=[];let g;const y=Symbol(""),p=Symbol("");function w(e,n=t){(function(t){return t&&!0===t._isEffect})(e)&&(e=e.raw);const r=function(t,e){const n=function(){if(!n.active)return e.scheduler?void 0:t();if(!d.includes(n)){S(n);try{return j(),d.push(n),g=n,t()}finally{d.pop(),O(),g=d[d.length-1]}}};return n.id=R++,n._isEffect=!0,n.active=!0,n.raw=t,n.deps=[],n.options=e,n}(e,n);return n.lazy||r(),r}function b(t){t.active&&(S(t),t.options.onStop&&t.options.onStop(),t.active=!1)}let R=0;function S(t){const{deps:e}=t;if(e.length){for(let n=0;n<e.length;n++)e[n].delete(t);e.length=0}}let k=!0;const m=[];function E(){m.push(k),k=!1}function j(){m.push(k),k=!0}function O(){const t=m.pop();k=void 0===t||t}function P(t,e,n){if(!k||void 0===g)return;let r=v.get(t);r||v.set(t,r=new Map);let s=r.get(n);s||r.set(n,s=new Set),s.has(g)||(s.add(g),g.deps.push(s))}function x(t,e,n,r,s,c){const u=v.get(t);if(!u)return;const a=new Set,l=t=>{t&&t.forEach(t=>a.add(t))};if("clear"===e)u.forEach(l);else if("length"===n&&i(t))u.forEach((t,e)=>{("length"===e||e>=r)&&l(t)});else switch(void 0!==n&&l(u.get(n)),e){case"add":i(t)?_(n)&&l(u.get("length")):(l(u.get(y)),o(t)&&l(u.get(p)));break;case"delete":i(t)||(l(u.get(y)),o(t)&&l(u.get(p)));break;case"set":o(t)&&l(u.get(y))}a.forEach(t=>{t.options.scheduler?t.options.scheduler(t):t()})}const z=new Set(Object.getOwnPropertyNames(Symbol).map(t=>Symbol[t]).filter(u)),M=I(),W=I(!1,!0),A=I(!0),N=I(!0,!0),V={};function I(t=!1,e=!1){return function(n,r,o){if("__v_isReactive"===r)return!t;if("__v_isReadonly"===r)return t;if("__v_raw"===r&&o===(t?lt:at).get(n))return n;const c=i(n);if(c&&s(V,r))return Reflect.get(V,r,o);const l=Reflect.get(n,r,o);if(u(r)?z.has(r):"__proto__"===r||"__v_isRef"===r)return l;if(t||P(n,0,r),e)return l;if(kt(l)){return!c||!_(r)?l.value:l}return a(l)?t?vt(l):_t(l):l}}["includes","indexOf","lastIndexOf"].forEach(t=>{V[t]=function(...e){const n=bt(this);for(let t=0,e=this.length;t<e;t++)P(n,0,t+"");const r=n[t](...e);return-1===r||!1===r?n[t](...e.map(bt)):r}});function K(t=!1){return function(e,n,r,o){const c=e[n];if(!t&&(r=bt(r),!i(e)&&kt(c)&&!kt(r)))return c.value=r,!0;const u=i(e)&&_(n)?Number(n)<e.length:s(e,n),a=Reflect.set(e,n,r,o);return e===bt(o)&&(u?h(r,c)&&x(e,"set",n,r):x(e,"add",n,r)),a}}const B={get:M,set:K(),deleteProperty:function(t,e){const n=s(t,e),r=Reflect.deleteProperty(t,e);return r&&n&&x(t,"delete",e,void 0),r},has:function(t,e){const n=Reflect.has(t,e);return u(e)&&z.has(e)||P(t,0,e),n},ownKeys:function(t){return P(t,0,y),Reflect.ownKeys(t)}},q={get:A,set:(t,e)=>!0,deleteProperty:(t,e)=>!0},C=n({},B,{get:W,set:K(!0)}),D=n({},q,{get:N}),F=t=>a(t)?_t(t):t,G=t=>a(t)?vt(t):t,H=t=>t,J=t=>Reflect.getPrototypeOf(t);function L(t,e,n=!1,r=!1){const s=bt(t=t.__v_raw),i=bt(e);e!==i&&!n&&P(s,0,e),!n&&P(s,0,i);const{has:o}=J(s),c=n?G:r?H:F;return o.call(s,e)?c(t.get(e)):o.call(s,i)?c(t.get(i)):void 0}function Q(t,e=!1){const n=this.__v_raw,r=bt(n),s=bt(t);return t!==s&&!e&&P(r,0,t),!e&&P(r,0,s),t===s?n.has(t):n.has(t)||n.has(s)}function T(t,e=!1){return t=t.__v_raw,!e&&P(bt(t),0,y),Reflect.get(t,"size",t)}function U(t){t=bt(t);const e=bt(this),n=J(e).has.call(e,t),r=e.add(t);return n||x(e,"add",t,t),r}function X(t,e){e=bt(e);const n=bt(this),{has:r,get:s}=J(n);let i=r.call(n,t);i||(t=bt(t),i=r.call(n,t));const o=s.call(n,t),c=n.set(t,e);return i?h(e,o)&&x(n,"set",t,e):x(n,"add",t,e),c}function Y(t){const e=bt(this),{has:n,get:r}=J(e);let s=n.call(e,t);s||(t=bt(t),s=n.call(e,t));r&&r.call(e,t);const i=e.delete(t);return s&&x(e,"delete",t,void 0),i}function Z(){const t=bt(this),e=0!==t.size,n=t.clear();return e&&x(t,"clear",void 0,void 0),n}function $(t,e){return function(n,r){const s=this,i=s.__v_raw,o=bt(i),c=t?G:e?H:F;return!t&&P(o,0,y),i.forEach((t,e)=>n.call(r,c(t),c(e),s))}}function tt(t,e,n){return function(...r){const s=this.__v_raw,i=bt(s),c=o(i),u="entries"===t||t===Symbol.iterator&&c,a="keys"===t&&c,l=s[t](...r),f=e?G:n?H:F;return!e&&P(i,0,a?p:y),{next(){const{value:t,done:e}=l.next();return e?{value:t,done:e}:{value:u?[f(t[0]),f(t[1])]:f(t),done:e}},[Symbol.iterator](){return this}}}}function et(t){return function(...e){return"delete"!==t&&this}}const nt={get(t){return L(this,t)},get size(){return T(this)},has:Q,add:U,set:X,delete:Y,clear:Z,forEach:$(!1,!1)},rt={get(t){return L(this,t,!1,!0)},get size(){return T(this)},has:Q,add:U,set:X,delete:Y,clear:Z,forEach:$(!1,!0)},st={get(t){return L(this,t,!0)},get size(){return T(this,!0)},has(t){return Q.call(this,t,!0)},add:et("add"),set:et("set"),delete:et("delete"),clear:et("clear"),forEach:$(!0,!1)};function it(t,e){const n=e?rt:t?st:nt;return(e,r,i)=>"__v_isReactive"===r?!t:"__v_isReadonly"===r?t:"__v_raw"===r?e:Reflect.get(s(n,r)&&r in e?n:e,r,i)}["keys","values","entries",Symbol.iterator].forEach(t=>{nt[t]=tt(t,!1,!1),st[t]=tt(t,!0,!1),rt[t]=tt(t,!1,!0)});const ot={get:it(!1,!1)},ct={get:it(!1,!0)},ut={get:it(!0,!1)},at=new WeakMap,lt=new WeakMap;function ft(t){return t.__v_skip||!Object.isExtensible(t)?0:function(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}((t=>f(t).slice(8,-1))(t))}function _t(t){return t&&t.__v_isReadonly?t:gt(t,!1,B,ot)}function ht(t){return gt(t,!1,C,ct)}function vt(t){return gt(t,!0,q,ut)}function dt(t){return gt(t,!0,D,ut)}function gt(t,e,n,r){if(!a(t))return t;if(t.__v_raw&&(!e||!t.__v_isReactive))return t;const s=e?lt:at,i=s.get(t);if(i)return i;const o=ft(t);if(0===o)return t;const c=new Proxy(t,2===o?r:n);return s.set(t,c),c}function yt(t){return pt(t)?yt(t.__v_raw):!(!t||!t.__v_isReactive)}function pt(t){return!(!t||!t.__v_isReadonly)}function wt(t){return yt(t)||pt(t)}function bt(t){return t&&bt(t.__v_raw)||t}function Rt(t){return((t,e,n)=>{Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value:n})})(t,"__v_skip",!0),t}const St=t=>a(t)?_t(t):t;function kt(t){return Boolean(t&&!0===t.__v_isRef)}function mt(t){return Ot(t)}function Et(t){return Ot(t,!0)}class jt{constructor(t,e=!1){this._rawValue=t,this._shallow=e,this.__v_isRef=!0,this._value=e?t:St(t)}get value(){return P(bt(this),0,"value"),this._value}set value(t){h(bt(t),this._rawValue)&&(this._rawValue=t,this._value=this._shallow?t:St(t),x(bt(this),"set","value",t))}}function Ot(t,e=!1){return kt(t)?t:new jt(t,e)}function Pt(t){x(t,"set","value",void 0)}function xt(t){return kt(t)?t.value:t}const zt={get:(t,e,n)=>xt(Reflect.get(t,e,n)),set:(t,e,n,r)=>{const s=t[e];return kt(s)&&!kt(n)?(s.value=n,!0):Reflect.set(t,e,n,r)}};function Mt(t){return yt(t)?t:new Proxy(t,zt)}class Wt{constructor(t){this.__v_isRef=!0;const{get:e,set:n}=t(()=>P(this,0,"value"),()=>x(this,"set","value"));this._get=e,this._set=n}get value(){return this._get()}set value(t){this._set(t)}}function At(t){return new Wt(t)}function Nt(t){const e=i(t)?new Array(t.length):{};for(const n in t)e[n]=It(t,n);return e}class Vt{constructor(t,e){this._object=t,this._key=e,this.__v_isRef=!0}get value(){return this._object[this._key]}set value(t){this._object[this._key]=t}}function It(t,e){return kt(t[e])?t[e]:new Vt(t,e)}class Kt{constructor(t,e,n){this._setter=e,this._dirty=!0,this.__v_isRef=!0,this.effect=w(t,{lazy:!0,scheduler:()=>{this._dirty||(this._dirty=!0,x(bt(this),"set","value"))}}),this.__v_isReadonly=n}get value(){return this._dirty&&(this._value=this.effect(),this._dirty=!1),P(bt(this),0,"value"),this._value}set value(t){this._setter(t)}}function Bt(t){let n,r;return c(t)?(n=t,r=e):(n=t.get,r=t.set),new Kt(n,r,c(t)||!t.set)}export{y as ITERATE_KEY,Bt as computed,At as customRef,w as effect,j as enableTracking,wt as isProxy,yt as isReactive,pt as isReadonly,kt as isRef,Rt as markRaw,E as pauseTracking,Mt as proxyRefs,_t as reactive,vt as readonly,mt as ref,O as resetTracking,ht as shallowReactive,dt as shallowReadonly,Et as shallowRef,b as stop,bt as toRaw,It as toRef,Nt as toRefs,P as track,x as trigger,Pt as triggerRef,xt as unref};

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

import { EMPTY_OBJ, isArray, isIntegerKey, isSymbol, extend, hasOwn, isObject, hasChanged, capitalize, toRawType, def, isFunction, NOOP } from '@vue/shared';
import { EMPTY_OBJ, isArray, isMap, isIntegerKey, isSymbol, extend, hasOwn, isObject, hasChanged, capitalize, toRawType, def, isFunction, NOOP } from '@vue/shared';

@@ -116,7 +116,3 @@ const targetMap = new WeakMap();

if (effectsToAdd) {
effectsToAdd.forEach(effect => {
if (effect !== activeEffect) {
effects.add(effect);
}
});
effectsToAdd.forEach(effect => effects.add(effect));
}

@@ -142,12 +138,29 @@ };

// also run for iteration key on ADD | DELETE | Map.SET
const shouldTriggerIteration = (type === "add" /* ADD */ &&
(!isArray(target) || isIntegerKey(key))) ||
(type === "delete" /* DELETE */ && !isArray(target));
if (shouldTriggerIteration ||
(type === "set" /* SET */ && target instanceof Map)) {
add(depsMap.get(isArray(target) ? 'length' : ITERATE_KEY));
switch (type) {
case "add" /* ADD */:
if (!isArray(target)) {
add(depsMap.get(ITERATE_KEY));
if (isMap(target)) {
add(depsMap.get(MAP_KEY_ITERATE_KEY));
}
}
else if (isIntegerKey(key)) {
// new index added to array -> length changes
add(depsMap.get('length'));
}
break;
case "delete" /* DELETE */:
if (!isArray(target)) {
add(depsMap.get(ITERATE_KEY));
if (isMap(target)) {
add(depsMap.get(MAP_KEY_ITERATE_KEY));
}
}
break;
case "set" /* SET */:
if (isMap(target)) {
add(depsMap.get(ITERATE_KEY));
}
break;
}
if (shouldTriggerIteration && target instanceof Map) {
add(depsMap.get(MAP_KEY_ITERATE_KEY));
}
}

@@ -370,3 +383,3 @@ const run = (effect) => {

const hadKey = proto.has.call(target, value);
const result = proto.add.call(target, value);
const result = target.add(value);
if (!hadKey) {

@@ -380,3 +393,3 @@ trigger(target, "add" /* ADD */, value, value);

const target = toRaw(this);
const { has, get, set } = getProto(target);
const { has, get } = getProto(target);
let hadKey = has.call(target, key);

@@ -391,3 +404,3 @@ if (!hadKey) {

const oldValue = get.call(target, key);
const result = set.call(target, key, value);
const result = target.set(key, value);
if (!hadKey) {

@@ -403,3 +416,3 @@ trigger(target, "add" /* ADD */, key, value);

const target = toRaw(this);
const { has, get, delete: del } = getProto(target);
const { has, get } = getProto(target);
let hadKey = has.call(target, key);

@@ -415,3 +428,3 @@ if (!hadKey) {

// forward the operation before queueing reactions
const result = del.call(target, key);
const result = target.delete(key);
if (hadKey) {

@@ -426,3 +439,3 @@ trigger(target, "delete" /* DELETE */, key, undefined, oldValue);

const oldTarget = (process.env.NODE_ENV !== 'production')
? target instanceof Map
? isMap(target)
? new Map(target)

@@ -432,3 +445,3 @@ : new Set(target)

// forward the operation before queueing reactions
const result = getProto(target).clear.call(target);
const result = target.clear();
if (hadItems) {

@@ -458,5 +471,5 @@ trigger(target, "clear" /* CLEAR */, undefined, undefined, oldTarget);

const rawTarget = toRaw(target);
const isMap = rawTarget instanceof Map;
const isPair = method === 'entries' || (method === Symbol.iterator && isMap);
const isKeyOnly = method === 'keys' && isMap;
const targetIsMap = isMap(rawTarget);
const isPair = method === 'entries' || (method === Symbol.iterator && targetIsMap);
const isKeyOnly = method === 'keys' && targetIsMap;
const innerIterator = target[method](...args);

@@ -779,3 +792,5 @@ const wrap = isReadonly ? toReadonly : isShallow ? toShallow : toReactive;

function toRef(object, key) {
return new ObjectRefImpl(object, key);
return isRef(object[key])
? object[key]
: new ObjectRefImpl(object, key);
}

@@ -782,0 +797,0 @@

@@ -10,2 +10,3 @@ var VueReactivity = (function (exports) {

const isArray = Array.isArray;
const isMap = (val) => toTypeString(val) === '[object Map]';
const isFunction = (val) => typeof val === 'function';

@@ -20,3 +21,6 @@ const isString = (val) => typeof val === 'string';

};
const isIntegerKey = (key) => isString(key) && key[0] !== '-' && '' + parseInt(key, 10) === key;
const isIntegerKey = (key) => isString(key) &&
key !== 'NaN' &&
key[0] !== '-' &&
'' + parseInt(key, 10) === key;
const cacheStringFunction = (fn) => {

@@ -158,7 +162,3 @@ const cache = Object.create(null);

if (effectsToAdd) {
effectsToAdd.forEach(effect => {
if (effect !== activeEffect) {
effects.add(effect);
}
});
effectsToAdd.forEach(effect => effects.add(effect));
}

@@ -184,12 +184,29 @@ };

// also run for iteration key on ADD | DELETE | Map.SET
const shouldTriggerIteration = (type === "add" /* ADD */ &&
(!isArray(target) || isIntegerKey(key))) ||
(type === "delete" /* DELETE */ && !isArray(target));
if (shouldTriggerIteration ||
(type === "set" /* SET */ && target instanceof Map)) {
add(depsMap.get(isArray(target) ? 'length' : ITERATE_KEY));
switch (type) {
case "add" /* ADD */:
if (!isArray(target)) {
add(depsMap.get(ITERATE_KEY));
if (isMap(target)) {
add(depsMap.get(MAP_KEY_ITERATE_KEY));
}
}
else if (isIntegerKey(key)) {
// new index added to array -> length changes
add(depsMap.get('length'));
}
break;
case "delete" /* DELETE */:
if (!isArray(target)) {
add(depsMap.get(ITERATE_KEY));
if (isMap(target)) {
add(depsMap.get(MAP_KEY_ITERATE_KEY));
}
}
break;
case "set" /* SET */:
if (isMap(target)) {
add(depsMap.get(ITERATE_KEY));
}
break;
}
if (shouldTriggerIteration && target instanceof Map) {
add(depsMap.get(MAP_KEY_ITERATE_KEY));
}
}

@@ -412,3 +429,3 @@ const run = (effect) => {

const hadKey = proto.has.call(target, value);
const result = proto.add.call(target, value);
const result = target.add(value);
if (!hadKey) {

@@ -422,3 +439,3 @@ trigger(target, "add" /* ADD */, value, value);

const target = toRaw(this);
const { has, get, set } = getProto(target);
const { has, get } = getProto(target);
let hadKey = has.call(target, key);

@@ -433,3 +450,3 @@ if (!hadKey) {

const oldValue = get.call(target, key);
const result = set.call(target, key, value);
const result = target.set(key, value);
if (!hadKey) {

@@ -445,3 +462,3 @@ trigger(target, "add" /* ADD */, key, value);

const target = toRaw(this);
const { has, get, delete: del } = getProto(target);
const { has, get } = getProto(target);
let hadKey = has.call(target, key);

@@ -457,3 +474,3 @@ if (!hadKey) {

// forward the operation before queueing reactions
const result = del.call(target, key);
const result = target.delete(key);
if (hadKey) {

@@ -467,3 +484,3 @@ trigger(target, "delete" /* DELETE */, key, undefined, oldValue);

const hadItems = target.size !== 0;
const oldTarget = target instanceof Map
const oldTarget = isMap(target)
? new Map(target)

@@ -473,3 +490,3 @@ : new Set(target)

// forward the operation before queueing reactions
const result = getProto(target).clear.call(target);
const result = target.clear();
if (hadItems) {

@@ -499,5 +516,5 @@ trigger(target, "clear" /* CLEAR */, undefined, undefined, oldTarget);

const rawTarget = toRaw(target);
const isMap = rawTarget instanceof Map;
const isPair = method === 'entries' || (method === Symbol.iterator && isMap);
const isKeyOnly = method === 'keys' && isMap;
const targetIsMap = isMap(rawTarget);
const isPair = method === 'entries' || (method === Symbol.iterator && targetIsMap);
const isKeyOnly = method === 'keys' && targetIsMap;
const innerIterator = target[method](...args);

@@ -820,3 +837,5 @@ const wrap = isReadonly ? toReadonly : isShallow ? toShallow : toReactive;

function toRef(object, key) {
return new ObjectRefImpl(object, key);
return isRef(object[key])
? object[key]
: new ObjectRefImpl(object, key);
}

@@ -823,0 +842,0 @@

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

var VueReactivity=function(t){"use strict";const e={},n=()=>{},r=Object.assign,s=Object.prototype.hasOwnProperty,i=(t,e)=>s.call(t,e),o=Array.isArray,c=t=>"function"==typeof t,u=t=>"symbol"==typeof t,a=t=>null!==t&&"object"==typeof t,l=Object.prototype.toString,f=t=>(t=>l.call(t))(t).slice(8,-1),_=t=>"string"==typeof t&&"-"!==t[0]&&""+parseInt(t,10)===t,h=(t,e)=>t!==e&&(t==t||e==e),v=new WeakMap,d=[];let g;const y=Symbol(""),p=Symbol("");function w(t,n=e){(function(t){return t&&!0===t._isEffect})(t)&&(t=t.raw);const r=function(t,e){const n=function(){if(!n.active)return e.scheduler?void 0:t();if(!d.includes(n)){b(n);try{return E(),d.push(n),g=n,t()}finally{d.pop(),S(),g=d[d.length-1]}}};return n.id=R++,n._isEffect=!0,n.active=!0,n.raw=t,n.deps=[],n.options=e,n}(t,n);return n.lazy||r(),r}let R=0;function b(t){const{deps:e}=t;if(e.length){for(let n=0;n<e.length;n++)e[n].delete(t);e.length=0}}let k=!0;const m=[];function E(){m.push(k),k=!0}function S(){const t=m.pop();k=void 0===t||t}function O(t,e,n){if(!k||void 0===g)return;let r=v.get(t);r||v.set(t,r=new Map);let s=r.get(n);s||r.set(n,s=new Set),s.has(g)||(s.add(g),g.deps.push(s))}function j(t,e,n,r,s,i){const c=v.get(t);if(!c)return;const u=new Set,a=t=>{t&&t.forEach(t=>{t!==g&&u.add(t)})};if("clear"===e)c.forEach(a);else if("length"===n&&o(t))c.forEach((t,e)=>{("length"===e||e>=r)&&a(t)});else{void 0!==n&&a(c.get(n));const r="add"===e&&(!o(t)||_(n))||"delete"===e&&!o(t);(r||"set"===e&&t instanceof Map)&&a(c.get(o(t)?"length":y)),r&&t instanceof Map&&a(c.get(p))}u.forEach(t=>{t.options.scheduler?t.options.scheduler(t):t()})}const P=new Set(Object.getOwnPropertyNames(Symbol).map(t=>Symbol[t]).filter(u)),x=W(),M=W(!1,!0),z=W(!0),A=W(!0,!0),T={};function W(t=!1,e=!1){return function(n,r,s){if("__v_isReactive"===r)return!t;if("__v_isReadonly"===r)return t;if("__v_raw"===r&&s===(t?ut:ct).get(n))return n;const c=o(n);if(c&&i(T,r))return Reflect.get(T,r,s);const l=Reflect.get(n,r,s);if(u(r)?P.has(r):"__proto__"===r||"__v_isRef"===r)return l;if(t||O(n,0,r),e)return l;if(gt(l)){return!c||!_(r)?l.value:l}return a(l)?t?lt(l):at(l):l}}["includes","indexOf","lastIndexOf"].forEach(t=>{T[t]=function(...e){const n=vt(this);for(let t=0,e=this.length;t<e;t++)O(n,0,t+"");const r=n[t](...e);return-1===r||!1===r?n[t](...e.map(vt)):r}});function V(t=!1){return function(e,n,r,s){const c=e[n];if(!t&&(r=vt(r),!o(e)&&gt(c)&&!gt(r)))return c.value=r,!0;const u=o(e)&&_(n)?Number(n)<e.length:i(e,n),a=Reflect.set(e,n,r,s);return e===vt(s)&&(u?h(r,c)&&j(e,"set",n,r):j(e,"add",n,r)),a}}const I={get:x,set:V(),deleteProperty:function(t,e){const n=i(t,e),r=Reflect.deleteProperty(t,e);return r&&n&&j(t,"delete",e,void 0),r},has:function(t,e){const n=Reflect.has(t,e);return u(e)&&P.has(e)||O(t,0,e),n},ownKeys:function(t){return O(t,0,y),Reflect.ownKeys(t)}},K={get:z,set:(t,e)=>!0,deleteProperty:(t,e)=>!0},N=r({},I,{get:M,set:V(!0)}),B=r({},K,{get:A}),Y=t=>a(t)?at(t):t,q=t=>a(t)?lt(t):t,C=t=>t,D=t=>Reflect.getPrototypeOf(t);function F(t,e,n=!1,r=!1){const s=vt(t=t.__v_raw),i=vt(e);e!==i&&!n&&O(s,0,e),!n&&O(s,0,i);const{has:o}=D(s),c=n?q:r?C:Y;return o.call(s,e)?c(t.get(e)):o.call(s,i)?c(t.get(i)):void 0}function G(t,e=!1){const n=this.__v_raw,r=vt(n),s=vt(t);return t!==s&&!e&&O(r,0,t),!e&&O(r,0,s),t===s?n.has(t):n.has(t)||n.has(s)}function H(t,e=!1){return t=t.__v_raw,!e&&O(vt(t),0,y),Reflect.get(t,"size",t)}function J(t){t=vt(t);const e=vt(this),n=D(e),r=n.has.call(e,t),s=n.add.call(e,t);return r||j(e,"add",t,t),s}function L(t,e){e=vt(e);const n=vt(this),{has:r,get:s,set:i}=D(n);let o=r.call(n,t);o||(t=vt(t),o=r.call(n,t));const c=s.call(n,t),u=i.call(n,t,e);return o?h(e,c)&&j(n,"set",t,e):j(n,"add",t,e),u}function Q(t){const e=vt(this),{has:n,get:r,delete:s}=D(e);let i=n.call(e,t);i||(t=vt(t),i=n.call(e,t));r&&r.call(e,t);const o=s.call(e,t);return i&&j(e,"delete",t,void 0),o}function U(){const t=vt(this),e=0!==t.size,n=D(t).clear.call(t);return e&&j(t,"clear",void 0,void 0),n}function X(t,e){return function(n,r){const s=this,i=s.__v_raw,o=vt(i),c=t?q:e?C:Y;return!t&&O(o,0,y),i.forEach((t,e)=>n.call(r,c(t),c(e),s))}}function Z(t,e,n){return function(...r){const s=this.__v_raw,i=vt(s),o=i instanceof Map,c="entries"===t||t===Symbol.iterator&&o,u="keys"===t&&o,a=s[t](...r),l=e?q:n?C:Y;return!e&&O(i,0,u?p:y),{next(){const{value:t,done:e}=a.next();return e?{value:t,done:e}:{value:c?[l(t[0]),l(t[1])]:l(t),done:e}},[Symbol.iterator](){return this}}}}function $(t){return function(...e){return"delete"!==t&&this}}const tt={get(t){return F(this,t)},get size(){return H(this)},has:G,add:J,set:L,delete:Q,clear:U,forEach:X(!1,!1)},et={get(t){return F(this,t,!1,!0)},get size(){return H(this)},has:G,add:J,set:L,delete:Q,clear:U,forEach:X(!1,!0)},nt={get(t){return F(this,t,!0)},get size(){return H(this,!0)},has(t){return G.call(this,t,!0)},add:$("add"),set:$("set"),delete:$("delete"),clear:$("clear"),forEach:X(!0,!1)};function rt(t,e){const n=e?et:t?nt:tt;return(e,r,s)=>"__v_isReactive"===r?!t:"__v_isReadonly"===r?t:"__v_raw"===r?e:Reflect.get(i(n,r)&&r in e?n:e,r,s)}["keys","values","entries",Symbol.iterator].forEach(t=>{tt[t]=Z(t,!1,!1),nt[t]=Z(t,!0,!1),et[t]=Z(t,!1,!0)});const st={get:rt(!1,!1)},it={get:rt(!1,!0)},ot={get:rt(!0,!1)},ct=new WeakMap,ut=new WeakMap;function at(t){return t&&t.__v_isReadonly?t:ft(t,!1,I,st)}function lt(t){return ft(t,!0,K,ot)}function ft(t,e,n,r){if(!a(t))return t;if(t.__v_raw&&(!e||!t.__v_isReactive))return t;const s=e?ut:ct,i=s.get(t);if(i)return i;const o=(c=t).__v_skip||!Object.isExtensible(c)?0:function(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}(f(c));var c;if(0===o)return t;const u=new Proxy(t,2===o?r:n);return s.set(t,u),u}function _t(t){return ht(t)?_t(t.__v_raw):!(!t||!t.__v_isReactive)}function ht(t){return!(!t||!t.__v_isReadonly)}function vt(t){return t&&vt(t.__v_raw)||t}const dt=t=>a(t)?at(t):t;function gt(t){return Boolean(t&&!0===t.__v_isRef)}class yt{constructor(t,e=!1){this._rawValue=t,this._shallow=e,this.__v_isRef=!0,this._value=e?t:dt(t)}get value(){return O(vt(this),0,"value"),this._value}set value(t){h(vt(t),this._rawValue)&&(this._rawValue=t,this._value=this._shallow?t:dt(t),j(vt(this),"set","value",t))}}function pt(t,e=!1){return gt(t)?t:new yt(t,e)}function wt(t){return gt(t)?t.value:t}const Rt={get:(t,e,n)=>wt(Reflect.get(t,e,n)),set:(t,e,n,r)=>{const s=t[e];return gt(s)&&!gt(n)?(s.value=n,!0):Reflect.set(t,e,n,r)}};class bt{constructor(t){this.__v_isRef=!0;const{get:e,set:n}=t(()=>O(this,0,"value"),()=>j(this,"set","value"));this._get=e,this._set=n}get value(){return this._get()}set value(t){this._set(t)}}class kt{constructor(t,e){this._object=t,this._key=e,this.__v_isRef=!0}get value(){return this._object[this._key]}set value(t){this._object[this._key]=t}}function mt(t,e){return new kt(t,e)}class Et{constructor(t,e,n){this._setter=e,this._dirty=!0,this.__v_isRef=!0,this.effect=w(t,{lazy:!0,scheduler:()=>{this._dirty||(this._dirty=!0,j(vt(this),"set","value"))}}),this.__v_isReadonly=n}get value(){return this._dirty&&(this._value=this.effect(),this._dirty=!1),O(vt(this),0,"value"),this._value}set value(t){this._setter(t)}}return t.ITERATE_KEY=y,t.computed=function(t){let e,r;return c(t)?(e=t,r=n):(e=t.get,r=t.set),new Et(e,r,c(t)||!t.set)},t.customRef=function(t){return new bt(t)},t.effect=w,t.enableTracking=E,t.isProxy=function(t){return _t(t)||ht(t)},t.isReactive=_t,t.isReadonly=ht,t.isRef=gt,t.markRaw=function(t){return((t,e,n)=>{Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value:n})})(t,"__v_skip",!0),t},t.pauseTracking=function(){m.push(k),k=!1},t.proxyRefs=function(t){return _t(t)?t:new Proxy(t,Rt)},t.reactive=at,t.readonly=lt,t.ref=function(t){return pt(t)},t.resetTracking=S,t.shallowReactive=function(t){return ft(t,!1,N,it)},t.shallowReadonly=function(t){return ft(t,!0,B,ot)},t.shallowRef=function(t){return pt(t,!0)},t.stop=function(t){t.active&&(b(t),t.options.onStop&&t.options.onStop(),t.active=!1)},t.toRaw=vt,t.toRef=mt,t.toRefs=function(t){const e=o(t)?new Array(t.length):{};for(const n in t)e[n]=mt(t,n);return e},t.track=O,t.trigger=j,t.triggerRef=function(t){j(t,"set","value",void 0)},t.unref=wt,t}({});
var VueReactivity=function(t){"use strict";const e={},n=()=>{},r=Object.assign,s=Object.prototype.hasOwnProperty,i=(t,e)=>s.call(t,e),o=Array.isArray,c=t=>"[object Map]"===_(t),u=t=>"function"==typeof t,a=t=>"symbol"==typeof t,l=t=>null!==t&&"object"==typeof t,f=Object.prototype.toString,_=t=>f.call(t),h=t=>"string"==typeof t&&"NaN"!==t&&"-"!==t[0]&&""+parseInt(t,10)===t,v=(t,e)=>t!==e&&(t==t||e==e),d=new WeakMap,g=[];let y;const p=Symbol(""),w=Symbol("");function R(t,n=e){(function(t){return t&&!0===t._isEffect})(t)&&(t=t.raw);const r=function(t,e){const n=function(){if(!n.active)return e.scheduler?void 0:t();if(!g.includes(n)){k(n);try{return S(),g.push(n),y=n,t()}finally{g.pop(),j(),y=g[g.length-1]}}};return n.id=b++,n._isEffect=!0,n.active=!0,n.raw=t,n.deps=[],n.options=e,n}(t,n);return n.lazy||r(),r}let b=0;function k(t){const{deps:e}=t;if(e.length){for(let n=0;n<e.length;n++)e[n].delete(t);e.length=0}}let m=!0;const E=[];function S(){E.push(m),m=!0}function j(){const t=E.pop();m=void 0===t||t}function O(t,e,n){if(!m||void 0===y)return;let r=d.get(t);r||d.set(t,r=new Map);let s=r.get(n);s||r.set(n,s=new Set),s.has(y)||(s.add(y),y.deps.push(s))}function P(t,e,n,r,s,i){const u=d.get(t);if(!u)return;const a=new Set,l=t=>{t&&t.forEach(t=>a.add(t))};if("clear"===e)u.forEach(l);else if("length"===n&&o(t))u.forEach((t,e)=>{("length"===e||e>=r)&&l(t)});else switch(void 0!==n&&l(u.get(n)),e){case"add":o(t)?h(n)&&l(u.get("length")):(l(u.get(p)),c(t)&&l(u.get(w)));break;case"delete":o(t)||(l(u.get(p)),c(t)&&l(u.get(w)));break;case"set":c(t)&&l(u.get(p))}a.forEach(t=>{t.options.scheduler?t.options.scheduler(t):t()})}const x=new Set(Object.getOwnPropertyNames(Symbol).map(t=>Symbol[t]).filter(a)),z=N(),M=N(!1,!0),A=N(!0),T=N(!0,!0),W={};function N(t=!1,e=!1){return function(n,r,s){if("__v_isReactive"===r)return!t;if("__v_isReadonly"===r)return t;if("__v_raw"===r&&s===(t?at:ut).get(n))return n;const c=o(n);if(c&&i(W,r))return Reflect.get(W,r,s);const u=Reflect.get(n,r,s);if(a(r)?x.has(r):"__proto__"===r||"__v_isRef"===r)return u;if(t||O(n,0,r),e)return u;if(pt(u)){return!c||!h(r)?u.value:u}return l(u)?t?_t(u):ft(u):u}}["includes","indexOf","lastIndexOf"].forEach(t=>{W[t]=function(...e){const n=gt(this);for(let t=0,e=this.length;t<e;t++)O(n,0,t+"");const r=n[t](...e);return-1===r||!1===r?n[t](...e.map(gt)):r}});function V(t=!1){return function(e,n,r,s){const c=e[n];if(!t&&(r=gt(r),!o(e)&&pt(c)&&!pt(r)))return c.value=r,!0;const u=o(e)&&h(n)?Number(n)<e.length:i(e,n),a=Reflect.set(e,n,r,s);return e===gt(s)&&(u?v(r,c)&&P(e,"set",n,r):P(e,"add",n,r)),a}}const I={get:z,set:V(),deleteProperty:function(t,e){const n=i(t,e),r=Reflect.deleteProperty(t,e);return r&&n&&P(t,"delete",e,void 0),r},has:function(t,e){const n=Reflect.has(t,e);return a(e)&&x.has(e)||O(t,0,e),n},ownKeys:function(t){return O(t,0,p),Reflect.ownKeys(t)}},K={get:A,set:(t,e)=>!0,deleteProperty:(t,e)=>!0},B=r({},I,{get:M,set:V(!0)}),Y=r({},K,{get:T}),q=t=>l(t)?ft(t):t,C=t=>l(t)?_t(t):t,D=t=>t,F=t=>Reflect.getPrototypeOf(t);function G(t,e,n=!1,r=!1){const s=gt(t=t.__v_raw),i=gt(e);e!==i&&!n&&O(s,0,e),!n&&O(s,0,i);const{has:o}=F(s),c=n?C:r?D:q;return o.call(s,e)?c(t.get(e)):o.call(s,i)?c(t.get(i)):void 0}function H(t,e=!1){const n=this.__v_raw,r=gt(n),s=gt(t);return t!==s&&!e&&O(r,0,t),!e&&O(r,0,s),t===s?n.has(t):n.has(t)||n.has(s)}function J(t,e=!1){return t=t.__v_raw,!e&&O(gt(t),0,p),Reflect.get(t,"size",t)}function L(t){t=gt(t);const e=gt(this),n=F(e).has.call(e,t),r=e.add(t);return n||P(e,"add",t,t),r}function Q(t,e){e=gt(e);const n=gt(this),{has:r,get:s}=F(n);let i=r.call(n,t);i||(t=gt(t),i=r.call(n,t));const o=s.call(n,t),c=n.set(t,e);return i?v(e,o)&&P(n,"set",t,e):P(n,"add",t,e),c}function U(t){const e=gt(this),{has:n,get:r}=F(e);let s=n.call(e,t);s||(t=gt(t),s=n.call(e,t));r&&r.call(e,t);const i=e.delete(t);return s&&P(e,"delete",t,void 0),i}function X(){const t=gt(this),e=0!==t.size,n=t.clear();return e&&P(t,"clear",void 0,void 0),n}function Z(t,e){return function(n,r){const s=this,i=s.__v_raw,o=gt(i),c=t?C:e?D:q;return!t&&O(o,0,p),i.forEach((t,e)=>n.call(r,c(t),c(e),s))}}function $(t,e,n){return function(...r){const s=this.__v_raw,i=gt(s),o=c(i),u="entries"===t||t===Symbol.iterator&&o,a="keys"===t&&o,l=s[t](...r),f=e?C:n?D:q;return!e&&O(i,0,a?w:p),{next(){const{value:t,done:e}=l.next();return e?{value:t,done:e}:{value:u?[f(t[0]),f(t[1])]:f(t),done:e}},[Symbol.iterator](){return this}}}}function tt(t){return function(...e){return"delete"!==t&&this}}const et={get(t){return G(this,t)},get size(){return J(this)},has:H,add:L,set:Q,delete:U,clear:X,forEach:Z(!1,!1)},nt={get(t){return G(this,t,!1,!0)},get size(){return J(this)},has:H,add:L,set:Q,delete:U,clear:X,forEach:Z(!1,!0)},rt={get(t){return G(this,t,!0)},get size(){return J(this,!0)},has(t){return H.call(this,t,!0)},add:tt("add"),set:tt("set"),delete:tt("delete"),clear:tt("clear"),forEach:Z(!0,!1)};function st(t,e){const n=e?nt:t?rt:et;return(e,r,s)=>"__v_isReactive"===r?!t:"__v_isReadonly"===r?t:"__v_raw"===r?e:Reflect.get(i(n,r)&&r in e?n:e,r,s)}["keys","values","entries",Symbol.iterator].forEach(t=>{et[t]=$(t,!1,!1),rt[t]=$(t,!0,!1),nt[t]=$(t,!1,!0)});const it={get:st(!1,!1)},ot={get:st(!1,!0)},ct={get:st(!0,!1)},ut=new WeakMap,at=new WeakMap;function lt(t){return t.__v_skip||!Object.isExtensible(t)?0:function(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}((t=>_(t).slice(8,-1))(t))}function ft(t){return t&&t.__v_isReadonly?t:ht(t,!1,I,it)}function _t(t){return ht(t,!0,K,ct)}function ht(t,e,n,r){if(!l(t))return t;if(t.__v_raw&&(!e||!t.__v_isReactive))return t;const s=e?at:ut,i=s.get(t);if(i)return i;const o=lt(t);if(0===o)return t;const c=new Proxy(t,2===o?r:n);return s.set(t,c),c}function vt(t){return dt(t)?vt(t.__v_raw):!(!t||!t.__v_isReactive)}function dt(t){return!(!t||!t.__v_isReadonly)}function gt(t){return t&&gt(t.__v_raw)||t}const yt=t=>l(t)?ft(t):t;function pt(t){return Boolean(t&&!0===t.__v_isRef)}class wt{constructor(t,e=!1){this._rawValue=t,this._shallow=e,this.__v_isRef=!0,this._value=e?t:yt(t)}get value(){return O(gt(this),0,"value"),this._value}set value(t){v(gt(t),this._rawValue)&&(this._rawValue=t,this._value=this._shallow?t:yt(t),P(gt(this),"set","value",t))}}function Rt(t,e=!1){return pt(t)?t:new wt(t,e)}function bt(t){return pt(t)?t.value:t}const kt={get:(t,e,n)=>bt(Reflect.get(t,e,n)),set:(t,e,n,r)=>{const s=t[e];return pt(s)&&!pt(n)?(s.value=n,!0):Reflect.set(t,e,n,r)}};class mt{constructor(t){this.__v_isRef=!0;const{get:e,set:n}=t(()=>O(this,0,"value"),()=>P(this,"set","value"));this._get=e,this._set=n}get value(){return this._get()}set value(t){this._set(t)}}class Et{constructor(t,e){this._object=t,this._key=e,this.__v_isRef=!0}get value(){return this._object[this._key]}set value(t){this._object[this._key]=t}}function St(t,e){return pt(t[e])?t[e]:new Et(t,e)}class jt{constructor(t,e,n){this._setter=e,this._dirty=!0,this.__v_isRef=!0,this.effect=R(t,{lazy:!0,scheduler:()=>{this._dirty||(this._dirty=!0,P(gt(this),"set","value"))}}),this.__v_isReadonly=n}get value(){return this._dirty&&(this._value=this.effect(),this._dirty=!1),O(gt(this),0,"value"),this._value}set value(t){this._setter(t)}}return t.ITERATE_KEY=p,t.computed=function(t){let e,r;return u(t)?(e=t,r=n):(e=t.get,r=t.set),new jt(e,r,u(t)||!t.set)},t.customRef=function(t){return new mt(t)},t.effect=R,t.enableTracking=S,t.isProxy=function(t){return vt(t)||dt(t)},t.isReactive=vt,t.isReadonly=dt,t.isRef=pt,t.markRaw=function(t){return((t,e,n)=>{Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value:n})})(t,"__v_skip",!0),t},t.pauseTracking=function(){E.push(m),m=!1},t.proxyRefs=function(t){return vt(t)?t:new Proxy(t,kt)},t.reactive=ft,t.readonly=_t,t.ref=function(t){return Rt(t)},t.resetTracking=j,t.shallowReactive=function(t){return ht(t,!1,B,ot)},t.shallowReadonly=function(t){return ht(t,!0,Y,ct)},t.shallowRef=function(t){return Rt(t,!0)},t.stop=function(t){t.active&&(k(t),t.options.onStop&&t.options.onStop(),t.active=!1)},t.toRaw=gt,t.toRef=St,t.toRefs=function(t){const e=o(t)?new Array(t.length):{};for(const n in t)e[n]=St(t,n);return e},t.track=O,t.trigger=P,t.triggerRef=function(t){P(t,"set","value",void 0)},t.unref=bt,t}({});
{
"name": "@vue/reactivity",
"version": "3.0.0-rc.10",
"version": "3.0.0-rc.11",
"description": "@vue/reactivity",

@@ -39,4 +39,4 @@ "main": "index.js",

"dependencies": {
"@vue/shared": "3.0.0-rc.10"
"@vue/shared": "3.0.0-rc.11"
}
}
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