summaryrefslogtreecommitdiffstats
path: root/src/util.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/util.ts')
-rw-r--r--src/util.ts9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/util.ts b/src/util.ts
index 6ab90ce..ad2b482 100644
--- a/src/util.ts
+++ b/src/util.ts
@@ -11,3 +11,12 @@ export function mapPromises<T>(promises: {[key: string]: Promise<T>}): Promise<{
return Promise.all(p).then(() => ret);
}
+
+export function numberArrayToMap(arr: number[]): {[key: number]: boolean} {
+ var ret: {[key: number]: boolean} = {};
+
+ for (let v of arr)
+ ret[v] = true;
+
+ return ret;
+}