print without breaklines

This commit is contained in:
Kiara Grouwstra 2023-02-27 20:44:54 +01:00
parent accb24c6c0
commit 938da697c1
Signed by: kiara
GPG Key ID: 47D3B7604FFCA83A
1 changed files with 2 additions and 1 deletions

View File

@ -1,4 +1,5 @@
"use strict";
import { stdout } from 'node:process';
import { List } from "@mollie/api-client";
export const mollieKeys = {
@ -8,7 +9,7 @@ export const mollieKeys = {
export async function listAll<T>(list$: Promise<List<T>>, ms: number = 1000): Promise<T[]> {
const list = await list$;
const { count, nextPage, links } = list;
console.log('.');
process.stdout.write('.');
await new Promise(resolve => setTimeout(resolve, ms));
const rest = await (nextPage ? listAll(nextPage()) : Promise.resolve([]));
return [...list, ...rest];