diff options
author | Florian Dold <florian@dold.me> | 2021-06-09 15:26:18 +0200 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2021-06-09 15:26:18 +0200 |
commit | 3d2b7b2a65787858c9471bc48cc5860c07b7f7dc (patch) | |
tree | 4a7477c184de7408104b8bf254a277a5949b19de /packages/taler-wallet-core/src/headless/helpers.ts | |
parent | 5c26461247040c07c86291babf0c87631df638b5 (diff) | |
download | wallet-core-3d2b7b2a65787858c9471bc48cc5860c07b7f7dc.tar.xz |
formatting: re-run prettier
Diffstat (limited to 'packages/taler-wallet-core/src/headless/helpers.ts')
-rw-r--r-- | packages/taler-wallet-core/src/headless/helpers.ts | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/packages/taler-wallet-core/src/headless/helpers.ts b/packages/taler-wallet-core/src/headless/helpers.ts index 73196492c..7b918d5d9 100644 --- a/packages/taler-wallet-core/src/headless/helpers.ts +++ b/packages/taler-wallet-core/src/headless/helpers.ts @@ -41,18 +41,18 @@ const logger = new Logger("headless/helpers.ts"); const nodejs_fs = (function () { let fs: typeof import("fs"); - return function() { + return function () { if (!fs) { /** * need to use an expression when doing a require if we want * webpack not to find out about the requirement */ - const _r = "require" - fs = module[_r]("fs") + const _r = "require"; + fs = module[_r]("fs"); } - return fs - } -})() + return fs; + }; +})(); export interface DefaultNodeWalletArgs { /** @@ -123,9 +123,13 @@ export async function getDefaultNodeWallet( } const tmpPath = `${args.persistentStoragePath}-${makeId(5)}.tmp`; const dbContent = myBackend.exportDump(); - nodejs_fs().writeFileSync(tmpPath, JSON.stringify(dbContent, undefined, 2), { - encoding: "utf-8", - }); + nodejs_fs().writeFileSync( + tmpPath, + JSON.stringify(dbContent, undefined, 2), + { + encoding: "utf-8", + }, + ); // Atomically move the temporary file onto the DB path. nodejs_fs().renameSync(tmpPath, args.persistentStoragePath); }; @@ -157,7 +161,7 @@ export async function getDefaultNodeWallet( let workerFactory; try { // Try if we have worker threads available, fails in older node versions. - const _r = "require" + const _r = "require"; const worker_threads = module[_r]("worker_threads"); // require("worker_threads"); workerFactory = new NodeThreadCryptoWorkerFactory(); |