UNPKG

@bothive/helpers

Version:

Collection of helper functions mainly used inside bothive-core project

27 lines (26 loc) 792 B
declare function getRandomValue<Type>(list: Type[] | string): Type | string; declare function splitInParts({ batch, size }: { batch: unknown[]; size: number; }): unknown[][]; declare function splitInChunks({ batch, chunkSize }: { batch: unknown[]; chunkSize: number; }): unknown[][]; declare function calculateByteSize(payload: unknown): number; declare function sortArrayByKey({ batch, key, }: { batch: { [key: string]: unknown; }[]; key: string; }): { [key: string]: unknown; }[]; declare const _default: { getRandomValue: typeof getRandomValue; splitInParts: typeof splitInParts; splitInChunks: typeof splitInChunks; calculateByteSize: typeof calculateByteSize; sortArrayByKey: typeof sortArrayByKey; }; export default _default;