Skip to content

Commit

Permalink
Refactor some docs
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Nov 23, 2022
1 parent 83dde81 commit dfe1ed9
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* @typedef {import('bcp-47').Options} Options
* @typedef {import('bcp-47').Warning} Warning
* @typedef {import('./lib/index.js').Options} Options
*/

export {bcp47Normalize} from './lib/index.js'
12 changes: 12 additions & 0 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,20 @@
* @typedef {import('bcp-47').Extension} Extension
*
* @typedef Options
* Configuration (optional).
* @property {boolean} [forgiving]
* Passed to `bcp-47` as `options.forgiving`.
* @property {Warning} [warning]
* Passed to `bcp-47` as `options.warning`.
*
* One additional warning is given:
*
* | code | reason |
* | :--- | :--------------------------------------------------------- |
* | 7 | Deprecated region `CURRENT`, expected one of `SUGGESTIONS` |
*
* This warning is only given if the region cannot be automatically fixed
* (when regions split into multiple regions).
*/

import {parse, stringify} from 'bcp-47'
Expand Down
9 changes: 4 additions & 5 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ to normalize and clean them.
## Install

This package is [ESM only][esm].
In Node.js (version 12.20+, 14.14+, or 16.0+), install with [npm][]:
In Node.js (version 14.14+, 16.0+), install with [npm][]:

```sh
npm install bcp-47-normalize
Expand Down Expand Up @@ -96,7 +96,7 @@ zh-hans-cn -> zh

## API

This package exports the following identifier: `bcp47Normalize`.
This package exports the identifier `bcp47Normalize`.
There is no default export.

### `bcp47Normalize(tag[, options])`
Expand Down Expand Up @@ -128,13 +128,12 @@ Normal, canonical, and pretty [BCP 47][spec] tag (`string`).
## Types

This package is fully typed with [TypeScript][].
It exports additional `Options` and `Warning` types that model their respective
interfaces.
It exports the additional types `Options` and `Warning`.

## Compatibility

This package is at least compatible with all maintained versions of Node.js.
As of now, that is Node.js 12.20+, 14.14+, and 16.0+.
As of now, that is Node.js 14.14+ and 16.0+.
It also works in Deno and modern browsers.

## Security
Expand Down

0 comments on commit dfe1ed9

Please sign in to comment.