mirror of
https://github.com/diced/zipline.git
synced 2026-01-17 15:23:17 -08:00
9 lines
380 B
TypeScript
Executable File
9 lines
380 B
TypeScript
Executable File
import bytesFn, { BytesOptions } from 'bytes';
|
|
|
|
export function bytes(value: string): number;
|
|
export function bytes(value: number, options?: BytesOptions): string;
|
|
export function bytes(value: string | number, options?: BytesOptions): string | number {
|
|
if (typeof value === 'string') return bytesFn(value);
|
|
return bytesFn(Number(value), { ...options, unitSeparator: ' ' });
|
|
}
|