MCPcopy Index your code
hub / github.com/TruthHun/BookStack / set

Function set

static/vuejs/vue.runtime.esm.js:872–897  ·  view source on GitHub ↗

* Set a property on an object. Adds the new property and * triggers change notification if the property doesn't * already exist.

(target, key, val)

Source from the content-addressed store, hash-verified

870 * already exist.
871 */
872function set (target, key, val) {
873 if (Array.isArray(target) && typeof key === 'number') {
874 target.length = Math.max(target.length, key);
875 target.splice(key, 1, val);
876 return val
877 }
878 if (hasOwn(target, key)) {
879 target[key] = val;
880 return val
881 }
882 var ob = (target ).__ob__;
883 if (target._isVue || (ob && ob.vmCount)) {
884 process.env.NODE_ENV !== 'production' && warn(
885 'Avoid adding reactive properties to a Vue instance or its root $data ' +
886 'at runtime - declare it upfront in the data option.'
887 );
888 return val
889 }
890 if (!ob) {
891 target[key] = val;
892 return val
893 }
894 defineReactive$$1(ob.value, key, val);
895 ob.dep.notify();
896 return val
897}
898
899/**
900 * Delete a property and trigger change if necessary.

Callers 1

mergeDataFunction · 0.70

Calls 3

hasOwnFunction · 0.70
defineReactive$$1Function · 0.70
warnFunction · 0.50

Tested by

no test coverage detected