backwards compat with nodejs<0.11

This commit is contained in:
Florian Dold 2020-02-24 23:10:36 +05:30
parent 57e0b85468
commit e1168fbec0
No known key found for this signature in database
GPG Key ID: D2E4F00F29D02A4B
2 changed files with 8 additions and 2 deletions

View File

@ -1,6 +1,6 @@
{
"name": "taler-wallet",
"version": "0.6.10",
"version": "0.6.11",
"description": "",
"main": "dist/node/index.js",
"repository": {

View File

@ -29,6 +29,12 @@ import { decodeCrock } from "../crypto/talerCrypto";
import { OperationFailedAndReportedError } from "../operations/errors";
import { Bank } from "./bank";
import { classifyTalerUri, TalerUriType } from "../util/taleruri";
import util = require("util");
// Backwards compatibility with nodejs<0.11, where TextEncoder and TextDecoder
// are not globals yet.
(global as any).TextEncoder = util.TextEncoder;
(global as any).TextDecoder = util.TextDecoder;
const logger = new Logger("taler-wallet-cli.ts");
@ -418,7 +424,7 @@ testCli
.requiredOption("bank", ["-b", "--bank"], clk.STRING, {
default: "https://bank.test.taler.net/",
})
.requiredOption("withdrawAmount", ["-a", "--amount"], clk.STRING, {
.requiredOption("withdrawAmount", ["-w", "--amount"], clk.STRING, {
default: "TESTKUDOS:10",
})
.requiredOption("spendAmount", ["-s", "--spend-amount"], clk.STRING, {