-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Description
For instance, if we have a key-value pair that has $ in the value, the envsub parser is not giving us an option to escape the $ value.
For instance,
const parseEnv = require("envsub/js/envsub-parser");
const envParserConfig = {
outputFile: null,
options: {
all: false,
diff: false,
protect: false,
syntax: "dollar-both",
},
cli: false,
};
const data = {
name: "this_is_a_value_\${PATH}",
};
const content = parseEnv(JSON.stringify(data), envParserConfig);
console.log(content); // "{\"name\":\"this_is_a_value_/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\"}"
Instead of the value being this_is_a_value_\${PATH} it is "{\"name\":\"this_is_a_value_/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\"}" instead.
Related runkit: https://runkit.com/embed/490p8grnbrld
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels