MCPcopy Index your code
hub / github.com/Unitech/pm2 / splitKey

Function splitKey

lib/Configuration.js:15–29  ·  view source on GitHub ↗
(key)

Source from the content-addressed store, hash-verified

13var cst = require('../constants.js');
14
15function splitKey(key) {
16 var values = [key];
17
18 if (key.indexOf('.') > -1)
19 values = key.match(/(?:[^."]+|"[^"]*")+/g).map(function(dt) { return dt.replace(/"/g, '') });
20 else if (key.indexOf(':') > -1)
21 values = key.match(/(?:[^:"]+|"[^"]*")+/g).map(function(dt) { return dt.replace(/"/g, '') });
22
23 var dangerousKeys = ['__proto__', 'constructor', 'prototype'];
24 if (values.some(function(v) { return dangerousKeys.indexOf(v) !== -1; })) {
25 return [];
26 }
27
28 return values;
29}
30
31function serializeConfiguration(json_conf) {
32 return JSON.stringify(json_conf, null, 4)

Callers 1

Configuration.jsFile · 0.85

Calls 1

indexOfMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…