File size: 393 Bytes
b91e262 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | const asyncForEach = async (array, callback) => {
for (let index = 0; index < array.length; index++) {
await callback(array[index], index, array);
}
};
const convertPascalToKebabCase = (string) => {
return string
.replace(/([a-z0-9])([A-Z])/g, "$1-$2")
.replace(/([A-Z])([A-Z])(?=[a-z])/g, "$1-$2")
.toLowerCase();
};
export { asyncForEach, convertPascalToKebabCase };
|