You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: index.d.ts
+6-8Lines changed: 6 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -12,8 +12,6 @@ export interface Options {
12
12
- If `string`: Expects a [BCP 47 language tag](https://en.wikipedia.org/wiki/IETF_language_tag) (For example: `en`, `de`, …)
13
13
- If `string[]`: Expects a list of [BCP 47 language tags](https://en.wikipedia.org/wiki/IETF_language_tag) (For example: `en`, `de`, …)
14
14
15
-
__Note:__ Localization should generally work in browsers. Node.js needs to be [built](https://github.com/nodejs/node/wiki/Intl) with `full-icu` or `system-icu`. Alternatively, the [`full-icu`](https://github.com/unicode-org/full-icu-npm) module can be used to provide support at runtime.
16
-
17
15
@default false
18
16
*/
19
17
readonlylocale?: boolean|string|readonlystring[];
@@ -25,7 +23,7 @@ export interface Options {
25
23
26
24
@example
27
25
```
28
-
import { prettyBytes } from 'pretty-bytes';
26
+
import prettyBytes from 'pretty-bytes';
29
27
30
28
prettyBytes(1337, {bits: true});
31
29
//=> '1.34 kbit'
@@ -40,7 +38,7 @@ export interface Options {
40
38
41
39
@example
42
40
```
43
-
import { prettyBytes } from 'pretty-bytes';
41
+
import prettyBytes from 'pretty-bytes';
44
42
45
43
prettyBytes(1000, {binary: true});
46
44
//=> '1000 bit'
@@ -59,7 +57,7 @@ export interface Options {
59
57
@default undefined
60
58
61
59
```
62
-
import { prettyBytes } from 'pretty-bytes';
60
+
import prettyBytes from 'pretty-bytes';
63
61
64
62
// Show the number with at least 3 fractional digits
65
63
prettyBytes(1900, {minimumFractionDigits: 3});
@@ -79,7 +77,7 @@ export interface Options {
79
77
@default undefined
80
78
81
79
```
82
-
import { prettyBytes } from 'pretty-bytes';
80
+
import prettyBytes from 'pretty-bytes';
83
81
84
82
// Show the number with at most 1 fractional digit
85
83
prettyBytes(1920, {maximumFractionDigits: 1});
@@ -99,7 +97,7 @@ Convert bytes to a human readable string: `1337` → `1.34 kB`.
- If `string`: Expects a [BCP 47 language tag](https://en.wikipedia.org/wiki/IETF_language_tag) (For example: `en`, `de`, …)
84
84
- If `string[]`: Expects a list of [BCP 47 language tags](https://en.wikipedia.org/wiki/IETF_language_tag) (For example: `en`, `de`, …)
85
85
86
-
**Note:** Localization should generally work in browsers. Node.js needs to be [built](https://github.com/nodejs/node/wiki/Intl) with `full-icu` or `system-icu`. Alternatively, the [`full-icu`](https://github.com/unicode-org/full-icu-npm) module can be used to provide support at runtime. [Node.js 13](https://nodejs.org/en/blog/release/v13.0.0/) and later ships with ICU by default.
87
-
88
86
##### minimumFractionDigits
89
87
90
88
Type: `number`\
@@ -95,7 +93,7 @@ The minimum number of fraction digits to display.
95
93
If neither `minimumFractionDigits` or `maximumFractionDigits` are set, the default behavior is to round to 3 significant digits.
96
94
97
95
```js
98
-
import{ prettyBytes }from'pretty-bytes';
96
+
importprettyBytesfrom'pretty-bytes';
99
97
100
98
// Show the number with at least 3 fractional digits
101
99
prettyBytes(1900, {minimumFractionDigits:3});
@@ -115,7 +113,7 @@ The maximum number of fraction digits to display.
115
113
If neither `minimumFractionDigits` or `maximumFractionDigits` are set, the default behavior is to round to 3 significant digits.
116
114
117
115
```js
118
-
import{ prettyBytes }from'pretty-bytes';
116
+
importprettyBytesfrom'pretty-bytes';
119
117
120
118
// Show the number with at most 1 fractional digit
0 commit comments