Commit e343132a authored by lauraMon's avatar lauraMon

Replaces underscore with lodash for escape

parent 81a5fdac
import _ from 'underscore';
import { escape } from 'lodash';
/**
Very limited implementation of sprintf supporting only named parameters.
......@@ -17,7 +17,7 @@ export default (input, parameters, escapeParameters = true) => {
if (parameters) {
Object.keys(parameters).forEach(parameterName => {
const parameterValue = parameters[parameterName];
const escapedParameterValue = escapeParameters ? _.escape(parameterValue) : parameterValue;
const escapedParameterValue = escapeParameters ? escape(parameterValue) : parameterValue;
output = output.replace(new RegExp(`%{${parameterName}}`, 'g'), escapedParameterValue);
});
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment