MCPcopy Create free account
hub / github.com/play-co/devkit / setValueForKey

Function setValueForKey

src/util/obj.js:68–81  ·  view source on GitHub ↗
(obj, key, value)

Source from the content-addressed store, hash-verified

66};
67
68var setValueForKey = function (obj, key, value) {
69 if (typeof key == 'number') {
70 setElement.call(obj, key, value);
71 } else {
72 // not an array
73 if (typeof value === 'undefined') {
74 // Remove key from object
75 obj[key] = void 0;
76 } else {
77 // Set value on object
78 obj[key] = value;
79 }
80 }
81};
82
83/**
84 * Tries to read a number value out of a string, if it fails to match the

Callers 1

_setValFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…