* 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)
| 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: |