From 90d346631f8638f9b767e381665c9480be120df2 Mon Sep 17 00:00:00 2001 From: Zaid Abdulla Date: Wed, 24 Jul 2019 15:40:42 -0700 Subject: [PATCH] Typo in tools path in tsconfig.json --- tools/dump-data-model | 50 +++++++++++++++++++++---------------------- tsconfig.json | 2 +- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/tools/dump-data-model b/tools/dump-data-model index baad55b..e827e38 100755 --- a/tools/dump-data-model +++ b/tools/dump-data-model @@ -28,9 +28,7 @@ process.chdir(path.resolve(path.dirname(fs.realpathSync(__filename)), "..")); const dataModel = {}; -function recursive(object, p): void { - if (!p) p = ""; - +function recursive(object, p = ""): void { for (const key in object) { if (key[0] === "_" || !object[key]) continue; @@ -58,27 +56,29 @@ function recursive(object, p): void { } } -connect(err => { - if (err) throw err; - - return devicesCollection.findOne( - { - _id: process.argv[2] - }, - {}, - (err, device) => { - if (err) throw err; - - if (!device) throw new Error("Device not found"); - - recursive(device); - - fs.writeFile(outputFilename, JSON.stringify(dataModel, null, 2), () => { +connect() + .then(() => { + devicesCollection.findOne( + { + _id: process.argv[2] + }, + {}, + (err, device) => { if (err) throw err; - process.stdout.write(`${outputFilename} saved\n`); - process.exit(0); - }); - } - ); -}); + if (!device) throw new Error("Device not found"); + + recursive(device); + + fs.writeFile(outputFilename, JSON.stringify(dataModel, null, 2), () => { + if (err) throw err; + + process.stdout.write(`${outputFilename} saved\n`); + process.exit(0); + }); + } + ); + }) + .catch(err => { + throw err; + }); diff --git a/tsconfig.json b/tsconfig.json index c3f0f21..3fd0651 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -19,6 +19,6 @@ "./ui/**/*", "./test/**/*", "./build/**/*", - "./toos/.*.ts" + "./tools/.*.ts" ] }