(key)
| 13 | var cst = require('../constants.js'); |
| 14 | |
| 15 | function 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 | |
| 31 | function serializeConfiguration(json_conf) { |
| 32 | return JSON.stringify(json_conf, null, 4) |
no test coverage detected
searching dependent graphs…