mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-24 05:06:02 +08:00
[bytes] Add unit to BytesOptions (#16630)
* add unit to BytesOptions * update version number
This commit is contained in:
@@ -9,8 +9,9 @@ console.log(bytes.format(104857, { thousandsSeparator: ' ' }));
|
||||
console.log(bytes.format(104857, { decimalPlaces: 2 }));
|
||||
console.log(bytes.format(104857, { fixedDecimals: true }));
|
||||
console.log(bytes.format(104857, { unitSeparator: '-' }));
|
||||
console.log(bytes.format(104857, { unit: 'GB' }));
|
||||
console.log(bytes('1024kb'));
|
||||
console.log(bytes(1024));
|
||||
|
||||
console.log(bytes.parse('1024kb'));
|
||||
console.log(bytes.parse(1024));
|
||||
console.log(bytes.parse(1024));
|
||||
|
||||
5
types/bytes/index.d.ts
vendored
5
types/bytes/index.d.ts
vendored
@@ -1,4 +1,4 @@
|
||||
// Type definitions for bytes v2.4.0
|
||||
// Type definitions for bytes v2.5.0
|
||||
// Project: https://github.com/visionmedia/bytes.js
|
||||
// Definitions by: Zhiyuan Wang <https://github.com/danny8002/>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
@@ -7,7 +7,8 @@ interface BytesOptions {
|
||||
decimalPlaces?: number,
|
||||
thousandsSeparator?: string,
|
||||
unitSeparator?: string,
|
||||
fixedDecimals?: boolean
|
||||
fixedDecimals?: boolean,
|
||||
unit?: string
|
||||
}
|
||||
/**
|
||||
*Convert the given value in bytes into a string.
|
||||
|
||||
Reference in New Issue
Block a user