blob: fbe87bb9114779255807755530ac9160cbb89285 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
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;
}
|