From 94ad1f6943fb2969b04150c9558fcc45850da582 Mon Sep 17 00:00:00 2001 From: pnodet Date: Tue, 24 Sep 2024 17:33:59 +0200 Subject: [PATCH] feat: add static list methods --- src/arrays/list.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/arrays/list.ts b/src/arrays/list.ts index 4d7112b..49a9ee0 100644 --- a/src/arrays/list.ts +++ b/src/arrays/list.ts @@ -21,6 +21,18 @@ export class List extends Array { return new List(...arr); } + static fromIterable(iterable: Iterable): List { + return new List(...iterable); + } + + static toArray(list: List): S[] { + return list; + } + + toArray(): T[] { + return this; + } + append(item: T): this { this.push(item);