summaryrefslogtreecommitdiffstats
path: root/src/util.ts
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2016-01-06 17:10:19 +0100
committerMatthias Schiffer <mschiffer@universe-factory.net>2016-01-06 17:27:45 +0100
commitc64ead08a36fccc36a42b3e74362aa423cfb62ed (patch)
tree5ada42f825b4ed0431f5c0426ab226aa0e7c2512 /src/util.ts
parent4fa246628bd9e5911ae998162f0bdc724cc739d2 (diff)
downloadrpgedit-c64ead08a36fccc36a42b3e74362aa423cfb62ed.tar
rpgedit-c64ead08a36fccc36a42b3e74362aa423cfb62ed.zip
Replace all CoffeeScript code by TypeScript
Diffstat (limited to 'src/util.ts')
-rw-r--r--src/util.ts13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/util.ts b/src/util.ts
new file mode 100644
index 0000000..2292820
--- /dev/null
+++ b/src/util.ts
@@ -0,0 +1,13 @@
+'use strict';
+
+
+export function mapPromises<T>(promises: {[key: string]: Promise<T>}): Promise<{[key: string]: T}> {
+ var p: Promise<void>[] = []
+ var ret: {[key: string]: T} = {}
+
+ _.forOwn(promises, (v, k) => {
+ p.push(v.then(r => {ret[k] = r;}));
+ });
+
+ return Promise.all(p).then(() => ret);
+}