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

Function del

static/vuejs/vue.js:912–933  ·  view source on GitHub ↗

* Delete a property and trigger change if necessary.

(target, key)

Source from the content-addressed store, hash-verified

910 * Delete a property and trigger change if necessary.
911 */
912function del (target, key) {
913 if (Array.isArray(target) && typeof key === 'number') {
914 target.splice(key, 1);
915 return
916 }
917 var ob = (target ).__ob__;
918 if (target._isVue || (ob && ob.vmCount)) {
919 "development" !== 'production' && warn(
920 'Avoid deleting properties on a Vue instance or its root $data ' +
921 '- just set it to null.'
922 );
923 return
924 }
925 if (!hasOwn(target, key)) {
926 return
927 }
928 delete target[key];
929 if (!ob) {
930 return
931 }
932 ob.dep.notify();
933}
934
935/**
936 * 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