diff options
author | Sebastian <sebasjm@gmail.com> | 2023-11-06 14:09:47 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2023-11-06 14:09:47 -0300 |
commit | 78b9f3e4d94af915c7f4480519e937fa5dacf620 (patch) | |
tree | 6c1be71d11c7793c2f9c16ef3521bf73ba79765b /packages/taler-util/src | |
parent | cd5cb0fc241b0cca28b11294ed16dd4630286544 (diff) | |
download | wallet-core-78b9f3e4d94af915c7f4480519e937fa5dacf620.tar.xz |
send api request param as file
Diffstat (limited to 'packages/taler-util/src')
-rw-r--r-- | packages/taler-util/src/compat.d.ts | 1 | ||||
-rw-r--r-- | packages/taler-util/src/compat.node.ts | 5 | ||||
-rw-r--r-- | packages/taler-util/src/compat.qtart.ts | 6 |
3 files changed, 11 insertions, 1 deletions
diff --git a/packages/taler-util/src/compat.d.ts b/packages/taler-util/src/compat.d.ts index 078f6147b..d7ccf19f0 100644 --- a/packages/taler-util/src/compat.d.ts +++ b/packages/taler-util/src/compat.d.ts @@ -20,3 +20,4 @@ export function readlinePrompt(prompt: string): Promise<string>; export function pathBasename(s: string): string; export function setUnhandledRejectionHandler(h: (e: any) => void): void; export function getenv(name: string): string | undefined; +export function readFile(fileName: string): string; diff --git a/packages/taler-util/src/compat.node.ts b/packages/taler-util/src/compat.node.ts index fb2db2995..2f78c9346 100644 --- a/packages/taler-util/src/compat.node.ts +++ b/packages/taler-util/src/compat.node.ts @@ -18,6 +18,7 @@ import process from "node:process"; import readline from "node:readline"; import path from "node:path"; import os from "node:os"; +import fs from "node:fs"; export function processExit(status: number): never { process.exit(status); @@ -57,3 +58,7 @@ export function setUnhandledRejectionHandler(h: (e: any) => void): void { export function getenv(name: string): string | undefined { return process.env[name]; } + +export function readFile(fileName: string): string { + return fs.readFileSync(fileName, "utf-8"); +} diff --git a/packages/taler-util/src/compat.qtart.ts b/packages/taler-util/src/compat.qtart.ts index f8b336b11..7d11cf375 100644 --- a/packages/taler-util/src/compat.qtart.ts +++ b/packages/taler-util/src/compat.qtart.ts @@ -29,7 +29,7 @@ export function processArgv(): string[] { } export function readlinePrompt(prompt: string): Promise<string> { - throw new Error("not supported"); + throw new Error("realinePrompt not yet supported in qtart"); } export function pathBasename(p: string): string { @@ -51,3 +51,7 @@ export function setUnhandledRejectionHandler(h: (e: any) => void): void { export function getenv(name: string): string | undefined { return std.getenv(name); } + +export function readFile(fileName: string): string { + throw new Error("readFile not yet supported in qtart"); +} |