mirror of
https://github.com/usebruno/bruno.git
synced 2026-07-01 16:44:16 +00:00
* pr review changes * collection root object in export json * import environment updates * tests run execution order fix for collection runs * updated validations * collectionVariables -> runtimeVariables * removed husky, adjusted indentation --------- Co-authored-by: Anoop M D <anoop.md1421@gmail.com>
28 lines
521 B
JavaScript
28 lines
521 B
JavaScript
const { interpolate } = require('@usebruno/common');
|
|
|
|
const interpolateString = (
|
|
str,
|
|
{ envVariables = {}, runtimeVariables = {}, processEnvVars = {}, requestVariables = {} }
|
|
) => {
|
|
if (!str || !str.length || typeof str !== 'string') {
|
|
return str;
|
|
}
|
|
|
|
const combinedVars = {
|
|
...envVariables,
|
|
...requestVariables,
|
|
...runtimeVariables,
|
|
process: {
|
|
env: {
|
|
...processEnvVars
|
|
}
|
|
}
|
|
};
|
|
|
|
return interpolate(str, combinedVars);
|
|
};
|
|
|
|
module.exports = {
|
|
interpolateString
|
|
};
|