From 04e6c43da793d94c10c1e6601439a696e72b8923 Mon Sep 17 00:00:00 2001 From: Sam Potts Date: Wed, 20 Apr 2022 14:50:14 +1000 Subject: [PATCH] chore: fix typo in comment --- src/js/utils/strings.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/js/utils/strings.js b/src/js/utils/strings.js index 3e78a8e6..acf51780 100644 --- a/src/js/utils/strings.js +++ b/src/js/utils/strings.js @@ -11,9 +11,7 @@ export function generateId(prefix) { // Format string export function format(input, ...args) { - if (is.empty(input)) { - return input; - } + if (is.empty(input)) return input; 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); } -// Replace all occurances of a string in a string +// Replace all occurrences of a string in a string export const replaceAll = (input = '', find = '', replace = '') => input.replace(new RegExp(find.toString().replace(/([.*+?^=!:${}()|[\]/\\])/g, '\\$1'), 'g'), replace.toString());