ens-normalize.js
0-dependancy Compact ES6 Ethereum Name Service (ENS) Name Normalizer that works in the browser.
import {ens_normalize} from '@adraffy/ens-normalize';
let normalized = ens_normalize('RaFFY🚴♂️.eTh');
Format names with fully-qualified emoji:
let pretty = ens_beautify('1⃣2⃣.eth');
Normalize name fragments for substring search:
let frag1 = ens_normalize_fragment('AB--');
let frag2 = ens_normalize_fragment('\u{303}');
let frag3 = ens_normalize_fragment('οо');
Input-based tokenization:
let tokens = ens_tokenize('_R💩\u{FE0F}a\u{FE0F}\u{304}\u{AD}./');
Output-based tokenization:
let labels = ens_split('💩Raffy.eth_');
Generate a sorted array of supported emoji codepoints:
console.log(ens_emoji());
Determine if a character shouldn't be printed directly:
console.log(should_escape(0x202E));
Determine if a character is a combining mark:
console.log(is_combining_mark(0x20E3));
Build
git clone
this repo, then npm install
- Follow instructions in /derive/ to generate data files
npm run make
— compress data files from /derive/output/
- Follow instructions in /validate/ to generate validation tests
npm run test
— perform validation testsnpm run build
— create /dist/
npm run rebuild
— run all the commands abovenpm run order
— create optimal group ordering and rebuild again