Skip to content

Commit

Permalink
add options.locale to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
75lb committed Jul 4, 2021
1 parent 99d8b3f commit e779a7c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ Returns an object with the spec `{ value: string, unit: string, long: string }`.
| [options.units] | <code>string</code> | Specify `'metric'`, `'iec'`, `'metric_octet'`, `'iec_octet'` or the name of a property from the custom units table in `options.customUnits`. Defaults to `metric`. |
| [options.customUnits] | <code>object</code> | An object containing one or more custom unit lookup tables. |
| [options.toStringFn] | <code>function</code> | A `toString` function to override the default. |
| [options.locale] | <code>string</code> \| <code>Array.&lt;string&gt;</code> | The locale to use for number formatting (e.g. `'de-DE'`). Defaults to your system locale. Passed directed into [Intl.NumberFormat()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat). |

<a name="module_byte-size--byteSize.defaultOptions"></a>

Expand Down
1 change: 1 addition & 0 deletions index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ class ByteSize {
* @param [options.units] {string} - Specify `'metric'`, `'iec'`, `'metric_octet'`, `'iec_octet'` or the name of a property from the custom units table in `options.customUnits`. Defaults to `metric`.
* @param [options.customUnits] {object} - An object containing one or more custom unit lookup tables.
* @param [options.toStringFn] {function} - A `toString` function to override the default.
* @param [options.locale] {string|string[]} - The locale to use for number formatting (e.g. `'de-DE'`). Defaults to your system locale. Passed directed into [Intl.NumberFormat()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat).
* @returns {object}
* @alias module:byte-size
*/
Expand Down
5 changes: 5 additions & 0 deletions jsdoc.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"source": {
"includePattern": ".+\\.(js(doc|x)?|mjs)$"
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"test": "npm run dist && npm run test:esm && npm run test:web",
"test:esm": "test-runner --view.hide-skips test.mjs",
"test:web": "web-runner test.mjs",
"docs": "jsdoc2md -t README.hbs dist/index.js > README.md",
"docs": "jsdoc2md -c jsdoc.conf -t README.hbs index.mjs > README.md",
"cover": "c8 npm test && c8 report --reporter=text-lcov | coveralls",
"dist": "rollup -c"
},
Expand Down

0 comments on commit e779a7c

Please # to comment.