tovarish-relayer/lib/services/utils.js

14 lines
489 B
JavaScript
Raw Permalink Normal View History

2024-11-13 04:42:13 +03:00
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.chunk = void 0;
exports.sleep = sleep;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
BigInt.prototype.toJSON = function () {
return this.toString();
};
const chunk = (arr, size) => [...Array(Math.ceil(arr.length / size))].map((_, i) => arr.slice(size * i, size + size * i));
exports.chunk = chunk;
function sleep(ms) {
return new Promise((resolve) => setTimeout(resolve, ms));
}