MCPcopy Create free account
hub / github.com/TruthHun/BookStack / del

Function del

static/vuejs/vue.esm.js:906–927  ·  view source on GitHub ↗

* Delete a property and trigger change if necessary.

(target, key)

Source from the content-addressed store, hash-verified

904 * Delete a property and trigger change if necessary.
905 */
906function del (target, key) {
907 if (Array.isArray(target) && typeof key === 'number') {
908 target.splice(key, 1);
909 return
910 }
911 var ob = (target ).__ob__;
912 if (target._isVue || (ob && ob.vmCount)) {
913 process.env.NODE_ENV !== 'production' && warn(
914 'Avoid deleting properties on a Vue instance or its root $data ' +
915 '- just set it to null.'
916 );
917 return
918 }
919 if (!hasOwn(target, key)) {
920 return
921 }
922 delete target[key];
923 if (!ob) {
924 return
925 }
926 ob.dep.notify();
927}
928
929/**
930 * Collect dependencies on array elements when the array is touched, since

Callers

nothing calls this directly

Calls 2

hasOwnFunction · 0.70
warnFunction · 0.50

Tested by

no test coverage detected