pretty
This commit is contained in:
parent
984cba226f
commit
76d2524b8b
12
packages/taler-util/src/http-impl.node.d.ts
vendored
12
packages/taler-util/src/http-impl.node.d.ts
vendored
@ -1,5 +1,9 @@
|
|||||||
import { HttpLibArgs } from "./http-common.js";
|
import { HttpLibArgs } from "./http-common.js";
|
||||||
import { HttpRequestLibrary, HttpRequestOptions, HttpResponse } from "./http.js";
|
import {
|
||||||
|
HttpRequestLibrary,
|
||||||
|
HttpRequestOptions,
|
||||||
|
HttpResponse,
|
||||||
|
} from "./http.js";
|
||||||
/**
|
/**
|
||||||
* Implementation of the HTTP request library interface for node.
|
* Implementation of the HTTP request library interface for node.
|
||||||
*/
|
*/
|
||||||
@ -13,5 +17,9 @@ export declare class HttpLibImpl implements HttpRequestLibrary {
|
|||||||
setThrottling(enabled: boolean): void;
|
setThrottling(enabled: boolean): void;
|
||||||
fetch(url: string, opt?: HttpRequestOptions): Promise<HttpResponse>;
|
fetch(url: string, opt?: HttpRequestOptions): Promise<HttpResponse>;
|
||||||
get(url: string, opt?: HttpRequestOptions): Promise<HttpResponse>;
|
get(url: string, opt?: HttpRequestOptions): Promise<HttpResponse>;
|
||||||
postJson(url: string, body: any, opt?: HttpRequestOptions): Promise<HttpResponse>;
|
postJson(
|
||||||
|
url: string,
|
||||||
|
body: any,
|
||||||
|
opt?: HttpRequestOptions,
|
||||||
|
): Promise<HttpResponse>;
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,8 @@ import * as common from "./http-common.js";
|
|||||||
|
|
||||||
export * from "./http-common.js";
|
export * from "./http-common.js";
|
||||||
|
|
||||||
|
export function createPlatformHttpLib(
|
||||||
export function createPlatformHttpLib(args?: common.HttpLibArgs): common.HttpRequestLibrary {
|
args?: common.HttpLibArgs,
|
||||||
|
): common.HttpRequestLibrary {
|
||||||
return new impl.HttpLibImpl(args);
|
return new impl.HttpLibImpl(args);
|
||||||
}
|
}
|
||||||
|
@ -23,8 +23,6 @@ test("iban validation", (t) => {
|
|||||||
t.assert(validateIban("NL71RABO9996666779").type === "invalid");
|
t.assert(validateIban("NL71RABO9996666779").type === "invalid");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
test("iban generation", (t) => {
|
test("iban generation", (t) => {
|
||||||
let iban1 = generateIban("DE", 10);
|
let iban1 = generateIban("DE", 10);
|
||||||
console.log("generated IBAN", iban1);
|
console.log("generated IBAN", iban1);
|
||||||
|
@ -276,7 +276,7 @@ export function generateIban(countryCode: string, length: number): string {
|
|||||||
|
|
||||||
for (let i = 0; i < length; i++) {
|
for (let i = 0; i < length; i++) {
|
||||||
const cc = ccZero + (Math.floor(Math.random() * 100) % 10);
|
const cc = ccZero + (Math.floor(Math.random() * 100) % 10);
|
||||||
appendDigit(digits, cc)
|
appendDigit(digits, cc);
|
||||||
ibanSuffix += String.fromCharCode(cc);
|
ibanSuffix += String.fromCharCode(cc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -191,7 +191,6 @@ export interface WaitingForRetryNotification {
|
|||||||
numDue: number;
|
numDue: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
export interface ExchangeAddedNotification {
|
export interface ExchangeAddedNotification {
|
||||||
type: NotificationType.ExchangeAdded;
|
type: NotificationType.ExchangeAdded;
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,8 @@
|
|||||||
|
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
import * as _qjsOsImp from "os";
|
import * as _qjsOsImp from "os";
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
import * as _qjsStdImp from "std";
|
import * as _qjsStdImp from "std";
|
||||||
|
|
||||||
|
|
||||||
export interface QjsHttpResp {
|
export interface QjsHttpResp {
|
||||||
status: number;
|
status: number;
|
||||||
data: ArrayBuffer;
|
data: ArrayBuffer;
|
||||||
@ -17,7 +15,6 @@ export interface QjsHttpOptions {
|
|||||||
headers?: string[];
|
headers?: string[];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
export interface QjsOsLib {
|
export interface QjsOsLib {
|
||||||
fetchHttp(url: string, options?: QjsHttpOptions): Promise<QjsHttpResp>;
|
fetchHttp(url: string, options?: QjsHttpOptions): Promise<QjsHttpResp>;
|
||||||
postMessageToHost(s: string): void;
|
postMessageToHost(s: string): void;
|
||||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user