MCPcopy Create free account
hub / github.com/node-config/node-config / parseString

Method parseString

lib/util.js:1297–1305  ·  view source on GitHub ↗

* Parse and return the specified string with the specified format. * * The format determines the parser to use. * * json = File is parsed using JSON.parse() * yaml (or yml) = Parsed with a YAML parser * toml = Parsed with a TOML parser * cson = Parsed with a CSON parser * hjs

(content, format)

Source from the content-addressed store, hash-verified

1295 * @return {object} configObject The configuration object parsed from the string
1296 */
1297 parseString(content, format) {
1298 const parser = this.parser.getParser(format);
1299
1300 if (typeof parser === 'function') {
1301 return parser(null, content);
1302 } else {
1303 //TODO: throw on missing #753
1304 }
1305 }
1306
1307 /**
1308 * Create a new object patterned after substitutionMap, where:

Callers 1

_substituteVarsMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected