mirror of
https://github.com/usebruno/bruno.git
synced 2024-11-07 08:34:15 +01:00
fix: refactor to be immutable
This commit is contained in:
parent
bd8432e4e0
commit
eec0e51d98
@ -60,12 +60,12 @@ const addSuffixToDuplicateName = (item, index, allItems) => {
|
|||||||
const regexVariable = new RegExp('{{.*?}}', 'g');
|
const regexVariable = new RegExp('{{.*?}}', 'g');
|
||||||
|
|
||||||
const normalizeVariables = (value) => {
|
const normalizeVariables = (value) => {
|
||||||
value = value || '';
|
const sanitizedValue = value || '';
|
||||||
const variables = value.match(regexVariable) || [];
|
const variables = sanitizedValue.match(regexVariable) || [];
|
||||||
each(variables, (variable) => {
|
each(variables, (variable) => {
|
||||||
value = value.replace(variable, variable.replace('_.', '').replaceAll(' ', ''));
|
sanitizedValue = sanitizedValue.replace(variable, variable.replace('_.', '').replaceAll(' ', ''));
|
||||||
});
|
});
|
||||||
return value;
|
return sanitizedValue;
|
||||||
};
|
};
|
||||||
|
|
||||||
const transformInsomniaRequestItem = (request, index, allRequests) => {
|
const transformInsomniaRequestItem = (request, index, allRequests) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user