From 70f5834934d8b5d266c85cc43083889e63d4a4d1 Mon Sep 17 00:00:00 2001 From: mmcwilliams Date: Fri, 11 Oct 2019 17:55:11 -0400 Subject: [PATCH] Add a tsconfig that works (from mcopy). --- src/delay/index.ts | 17 +++++++++++++++++ tsconfig.json | 23 +++++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 src/delay/index.ts create mode 100644 tsconfig.json diff --git a/src/delay/index.ts b/src/delay/index.ts new file mode 100644 index 0000000..4521bab --- /dev/null +++ b/src/delay/index.ts @@ -0,0 +1,17 @@ +'use strict'; + +/** + * Delay in an async/await function + * + * @param {integer} ms Milliseconds to delay for + * + * @returns {Promise} Promise to resolve after timeout + **/ + +function delay (ms : number) { + return new Promise((resolve : any) => { + return setTimeout(resolve, ms); + }); +} + +module.exports.delay = delay; \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..9814b07 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "esModuleInterop": true, + "target": "ES2017", + "noImplicitAny": true, + "moduleResolution": "node", + "sourceMap": true, + "removeComments" : false, + "baseUrl" : "lib", + "outDir": "./lib/", + "rootDir" : "./src/", + "paths" : { + "log" : ["./lib/log"] + } + }, + "exclude" : [ + "./app", + "./node_modules", + "./experiments", + "./test" + ] +} \ No newline at end of file