function _done(n, ...args): Function | void {
const start_time = Date.now();
const f = function (...args) {
if (n !== 1) {
try {
args = [JSON.stringify(args, null, n)];
} catch (error) {}
}
console.log(
`*** TOTALLY DONE! (${
(Date.now() - start_time) / 1000
}s since start) `,
...Array.from(args)
);
};
if (args.length > 0) {
f(...Array.from(args || []));
} else {
return f;
}
}
export function done(...args): Function | void {
return _done(0, ...Array.from(args));
}
export function done1(...args): Function | void {
return _done(1, ...Array.from(args));
}
export function done2(...args): Function | void {
return _done(2, ...Array.from(args));
}