aboutsummaryrefslogtreecommitdiff
path: root/src/util.ts
diff options
context:
space:
mode:
authorwabilin <[email protected]>2020-07-31 20:15:19 +0900
committerwabilin <[email protected]>2020-07-31 20:15:19 +0900
commitdf2b1e4012dc50b56141bf9012d8e367a3d08fdf (patch)
treef1876fbd2ecceaeef2e6757818987c0474bca46e /src/util.ts
parentadd jsdom (diff)
downloadholo-schedule-df2b1e4012dc50b56141bf9012d8e367a3d08fdf.tar.xz
holo-schedule-df2b1e4012dc50b56141bf9012d8e367a3d08fdf.zip
get datas without date
Diffstat (limited to 'src/util.ts')
-rw-r--r--src/util.ts11
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;
+}