MCPcopy
hub / github.com/chartjs/Chart.js / getScope

Function getScope

src/core/core.defaults.js:15–25  ·  view source on GitHub ↗

* @param {object} node * @param {string} key * @return {object}

(node, key)

Source from the content-addressed store, hash-verified

13 * @return {object}
14 */
15function getScope(node, key) {
16 if (!key) {
17 return node;
18 }
19 const keys = key.split('.');
20 for (let i = 0, n = keys.length; i < n; ++i) {
21 const k = keys[i];
22 node = node[k] || (node[k] = Object.create(null));
23 }
24 return node;
25}
26
27function set(root, scope, values) {
28 if (typeof scope === 'string') {

Callers 3

setFunction · 0.70
getMethod · 0.70
routeMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected