blob: 86ea64aad51e273b46295ec74adf7b5aac23e989 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
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, '')
}
|