diff options
| author | wabilin <[email protected]> | 2020-07-31 20:15:19 +0900 |
|---|---|---|
| committer | wabilin <[email protected]> | 2020-07-31 20:15:19 +0900 |
| commit | df2b1e4012dc50b56141bf9012d8e367a3d08fdf (patch) | |
| tree | f1876fbd2ecceaeef2e6757818987c0474bca46e /src/util.ts | |
| parent | add jsdom (diff) | |
| download | holo-schedule-df2b1e4012dc50b56141bf9012d8e367a3d08fdf.tar.xz holo-schedule-df2b1e4012dc50b56141bf9012d8e367a3d08fdf.zip | |
get datas without date
Diffstat (limited to 'src/util.ts')
| -rw-r--r-- | src/util.ts | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/util.ts b/src/util.ts new file mode 100644 index 0000000..fbe87bb --- /dev/null +++ b/src/util.ts @@ -0,0 +1,11 @@ +export function mapNodeList<E extends Element, T>( + list: NodeListOf<E>, + mapper: (ele: E) => T +): T[] { + const ary: T[] = []; + list.forEach((node) => { + ary.push(mapper(node)); + }); + + return ary; +} |