@adraffy/ens-norm-uts46
0.1.1 • Public • Published
- Unicode
16.0.0
(but can be built using any version)
- Generates entire family of UTS-46
ToUnicode()
functions
- ✅️ Passes 100% IDNATestV2
- ⚠️ Uses
String.normalize()
for NFC (if no implementation is provided)
- ⚠️ Not space-efficient:
~188 KB
minified
import {create_uts46} from '@adraffy/ens-norm-uts46';
// npm i @adraffy/ens-norm-uts46
// browser: https://cdn.jsdelivr.net/npm/@adraffy/ens-norm-uts46@latest/dist/index.min.js
const uts46 = create_uts46({
version: 2003,
use_STD3: true,
valid_deviations: true, // deprecated in 15.1
check_hyphens: true,
check_bidi: true,
contextJ: true,
contextO: false,
check_leading_cm: true,
punycode: true, // uses @adraffy/punycode.js
nfc: cps => cps // number[] -> number[], leave unspecified for String.normalize()
});
console.log(uts46('RAFFY.ETH'));
-
git clone
this repo then npm install
-
npm run derive
— download and parse Unicode data files
-
npm run test
— validate against IDNATestV2
-
npm run build
— create /dist/
/@adraffy/ens-norm-uts46/
//
Package Sidebar
Install
npm i @adraffy/ens-norm-uts46
Weekly Downloads