Download next.js/examples/cms-agilitycms/lib/utils.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 393 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/examples/cms-agilitycms/lib/utils.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/next.js/examples/cms-agilitycms/lib/utils.ts
-
curl -L -o utils.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/examples/cms-agilitycms/lib/utils.ts
393 Bytes
| 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 }; | |