@yoryoboy/clickup-sdk
Version:
A modular TypeScript SDK for interacting with the ClickUp API
22 lines (21 loc) • 634 B
JavaScript
/**
* Utility function to split an array into chunks of specified size
* @param array - The array to split
* @param chunkSize - Size of each chunk
* @returns Array of chunks
*/
export function chunkArray(array, chunkSize) {
const chunks = [];
for (let i = 0; i < array.length; i += chunkSize) {
chunks.push(array.slice(i, i + chunkSize));
}
return chunks;
}
/**
* Utility function to delay execution for a specified time
* @param ms - Milliseconds to delay
* @returns Promise that resolves after the delay
*/
export function delay(ms) {
return new Promise((resolve) => setTimeout(resolve, ms));
}