diff options
author | codecalm <codecalm@gmail.com> | 2022-04-16 14:50:51 +0200 |
---|---|---|
committer | codecalm <codecalm@gmail.com> | 2022-04-16 14:50:51 +0200 |
commit | c291772a85d309a32896ce7d616157d93e631408 (patch) | |
tree | 19c9596f3e85df49c11f62cb099a3d7e3391926b /scripts/utils.js | |
parent | Merge branch 'master' of https://github.com/tabler/tabler-icons into v2.0 (diff) | |
download | tabler-icons-c291772a85d309a32896ce7d616157d93e631408.tar.xz |
icons-react build
Diffstat (limited to 'scripts/utils.js')
-rw-r--r-- | scripts/utils.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/scripts/utils.js b/scripts/utils.js new file mode 100644 index 00000000..86ea64aa --- /dev/null +++ b/scripts/utils.js @@ -0,0 +1,14 @@ +export const asyncForEach = async (array, callback) => { + for (let index = 0; index < array.length; index++) { + await callback(array[index], index, array) + } +} + + +export const camelize = function (str) { + str = str.replace(/-/g, ' ') + + return str.replace(/(?:^\w|[A-Z]|\b\w)/g, function (word, index) { + return word.toUpperCase() + }).replace(/\s+/g, '') +} |