feat(initial): Support readonly array in initial (#444)

This commit is contained in:
Dongho Kim 2024-08-31 10:58:09 +09:00 committed by GitHub
parent f7a1c8548a
commit 647c788016
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -21,7 +21,7 @@
* const newSingleElementArr = initial(singleElementArr);
* // newSingleElementArr will be []
*/
export function initial<T>(arr: T[]): T[] {
export function initial<T>(arr: readonly T[]): T[] {
if (arr.length <= 1) {
return [];
}