MCPcopy Index your code
hub / github.com/plotly/dash / copyWithDeleteImpl

Function copyWithDeleteImpl

dash/deps/react-dom@18.2.0.js:29013–29030  ·  view source on GitHub ↗
(obj, path, index)

Source from the content-addressed store, hash-verified

29011
29012 {
29013 var copyWithDeleteImpl = function (obj, path, index) {
29014 var key = path[index];
29015 var updated = isArray(obj) ? obj.slice() : assign({}, obj);
29016
29017 if (index + 1 === path.length) {
29018 if (isArray(updated)) {
29019 updated.splice(key, 1);
29020 } else {
29021 delete updated[key];
29022 }
29023
29024 return updated;
29025 } // $FlowFixMe number or string is fine here
29026
29027
29028 updated[key] = copyWithDeleteImpl(obj[key], path, index + 1);
29029 return updated;
29030 };
29031
29032 var copyWithDelete = function (obj, path) {
29033 return copyWithDeleteImpl(obj, path, 0);

Callers 1

copyWithDeleteFunction · 0.70

Calls 1

isArrayFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…