UNPKG

675 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3var graphql_codegen_core_1 = require("graphql-codegen-core");
4var js_yaml_1 = require("js-yaml");
5function parseConfigFile(ymlString) {
6 if (typeof process !== 'undefined' && 'env' in process) {
7 graphql_codegen_core_1.debugLog("[CLI] Interpolation of Environmental Variables");
8 ymlString = ymlString.replace(/\$\{(.*)\}/g, function (str, variable, index) { return process.env[variable]; });
9 }
10 graphql_codegen_core_1.debugLog("[CLI] Parsing YAML file");
11 return js_yaml_1.safeLoad(ymlString);
12}
13exports.parseConfigFile = parseConfigFile;
14//# sourceMappingURL=yml.js.map
\No newline at end of file