1
0
mirror of https://github.com/bitwarden/web synced 2025-12-21 18:53:38 +00:00

Add string replacement feature flagging

This commit is contained in:
Matt Gibson
2022-01-18 10:56:39 -05:00
parent dfd62c7c3a
commit e96e3cefd1
6 changed files with 32 additions and 6 deletions

View File

@@ -30,7 +30,24 @@ function loadConfig(configName) {
}
}
function generateSubstitutions(configObj) {
let result = {};
Object.keys(configObj.compileFlags ?? {}).forEach(key => {
result = { ...result, ...generateSubstitutionsForFlag(key) };
});
return result;
}
function generateSubstitutionsForFlag(flagName) {
return {
"featureFlag: (.*)[\\s\\S]*?\\/\\/ endFeatureFlag": ""
};
}
module.exports = {
load,
log,
generateSubstitutions,
};