Socket
Book a DemoInstallSign in
Socket

@adraffy/ens-norm-uts46

Package Overview
Dependencies
Maintainers
0
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@adraffy/ens-norm-uts46

ENS Name Normalization UTS46 Implementation

0.1.1
latest
Source
npmnpm
Version published
Weekly downloads
7
133.33%
Maintainers
0
Weekly downloads
 
Created
Source

ens-norm-uts46.js

  • 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

Example

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'));

Build

  • 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/

Keywords

ENS

FAQs

Package last updated on 13 Sep 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.