feat: improve library preview image generation on publish (#4321)

Co-authored-by: Aakansha Doshi <aakansha1216@gmail.com>
This commit is contained in:
David Luzar
2021-11-26 11:46:13 +01:00
committed by GitHub
parent ca1f3aa094
commit b53d1f6f3e
8 changed files with 157 additions and 72 deletions

View File

@ -151,7 +151,10 @@ export const debounce = <T extends any[]>(
};
// https://github.com/lodash/lodash/blob/es/chunk.js
export const chunk = <T extends any>(array: T[], size: number): T[][] => {
export const chunk = <T extends any>(
array: readonly T[],
size: number,
): T[][] => {
if (!array.length || size < 1) {
return [];
}