chore: fix typo in comment

This commit is contained in:
Sam Potts
2022-04-20 14:50:14 +10:00
parent 73bfb5211b
commit 04e6c43da7

View File

@ -11,9 +11,7 @@ export function generateId(prefix) {
// Format string // Format string
export function format(input, ...args) { export function format(input, ...args) {
if (is.empty(input)) { if (is.empty(input)) return input;
return input;
}
return input.toString().replace(/{(\d+)}/g, (match, i) => args[i].toString()); return input.toString().replace(/{(\d+)}/g, (match, i) => args[i].toString());
} }
@ -27,7 +25,7 @@ export function getPercentage(current, max) {
return ((current / max) * 100).toFixed(2); return ((current / max) * 100).toFixed(2);
} }
// Replace all occurances of a string in a string // Replace all occurrences of a string in a string
export const replaceAll = (input = '', find = '', replace = '') => export const replaceAll = (input = '', find = '', replace = '') =>
input.replace(new RegExp(find.toString().replace(/([.*+?^=!:${}()|[\]/\\])/g, '\\$1'), 'g'), replace.toString()); input.replace(new RegExp(find.toString().replace(/([.*+?^=!:${}()|[\]/\\])/g, '\\$1'), 'g'), replace.toString());