Skip to content

Commit

Permalink
fix: refactor to be immutable
Browse files Browse the repository at this point in the history
  • Loading branch information
jake-owen-p committed Oct 13, 2024
1 parent bd8432e commit eec0e51
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/bruno-app/src/utils/importers/insomnia-collection.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,12 @@ const addSuffixToDuplicateName = (item, index, allItems) => {
const regexVariable = new RegExp('{{.*?}}', 'g');

const normalizeVariables = (value) => {
value = value || '';
const variables = value.match(regexVariable) || [];
const sanitizedValue = value || '';
const variables = sanitizedValue.match(regexVariable) || [];
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) => {
Expand Down

0 comments on commit eec0e51

Please sign in to comment.