print without breaklines
This commit is contained in:
parent
accb24c6c0
commit
938da697c1
|
@ -1,4 +1,5 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
|
import { stdout } from 'node:process';
|
||||||
import { List } from "@mollie/api-client";
|
import { List } from "@mollie/api-client";
|
||||||
|
|
||||||
export const mollieKeys = {
|
export const mollieKeys = {
|
||||||
|
@ -8,7 +9,7 @@ export const mollieKeys = {
|
||||||
export async function listAll<T>(list$: Promise<List<T>>, ms: number = 1000): Promise<T[]> {
|
export async function listAll<T>(list$: Promise<List<T>>, ms: number = 1000): Promise<T[]> {
|
||||||
const list = await list$;
|
const list = await list$;
|
||||||
const { count, nextPage, links } = list;
|
const { count, nextPage, links } = list;
|
||||||
console.log('.');
|
process.stdout.write('.');
|
||||||
await new Promise(resolve => setTimeout(resolve, ms));
|
await new Promise(resolve => setTimeout(resolve, ms));
|
||||||
const rest = await (nextPage ? listAll(nextPage()) : Promise.resolve([]));
|
const rest = await (nextPage ? listAll(nextPage()) : Promise.resolve([]));
|
||||||
return [...list, ...rest];
|
return [...list, ...rest];
|
||||||
|
|
Loading…
Reference in New Issue