diff --git a/index.js b/index.js index 1ba9dc1..d72322d 100644 --- a/index.js +++ b/index.js @@ -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' diff --git a/lib/index.js b/lib/index.js index fe1e71b..99608e9 100644 --- a/lib/index.js +++ b/lib/index.js @@ -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' diff --git a/readme.md b/readme.md index 74aa322..c6875ae 100644 --- a/readme.md +++ b/readme.md @@ -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 @@ -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])` @@ -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