@adraffy/ens-normalize
Advanced tools
Comparing version 1.0.3 to 1.0.4
@@ -41,10 +41,10 @@ function bytes_from_base64(s) { | ||
this.pos += 2; | ||
return 0x80 + ((x0 & 0x7F) << 8) + table[pos+1]; | ||
return 0x80 + (((x0 & 0x7F) << 8) | table[pos+1]); | ||
} | ||
this.pos += 4; | ||
return 0x7F80 + (table[pos+1] << 16) + (table[pos+2] << 8) + table[pos+3]; | ||
return 0x7F80 + ((table[pos+1] << 16) | (table[pos+2] << 8) | table[pos+3]); | ||
} | ||
read_signed() { // eg. [0,1,2,3...] => [0,-1,1,-2,...] | ||
let i = this.read(); | ||
return (i & 1) ? -(i >> 1) : (i >> 1); | ||
return (i & 1) ? -((i + 1) >> 1) : (i >> 1); | ||
} | ||
@@ -99,3 +99,4 @@ } | ||
let r = new TableReader(table); | ||
while (r.more) { | ||
let i = 0; | ||
while (r.more) { | ||
x += r.read(); | ||
@@ -112,3 +113,3 @@ if (x > cp) break; | ||
y += r.read_signed(); | ||
} | ||
} | ||
} | ||
@@ -200,5 +201,5 @@ } | ||
if (mapped) return mapped; | ||
for (let i = 0; i < TABLE_W.length; i++) { | ||
for (let i = 0; i < TABLE_W.length; i++) { | ||
mapped = lookup_mapped(TABLE_W[i], i + 1, cp); | ||
if (mapped) return mapped; | ||
if (mapped) return mapped; | ||
} | ||
@@ -235,3 +236,5 @@ } | ||
} else if (cp === 0x200D) { // https://datatracker.ietf.org/doc/html/rfc5892#appendix-A.2 | ||
if (i > 0 && lookup_member(TABLE_V, v[i - 1])) { // Virama | ||
// rule 1: V + cp | ||
// V = Combining_Class "Virama" | ||
if (i > 0 && lookup_member(TABLE_V, v[i - 1])) { | ||
return String.fromCodePoint(cp); | ||
@@ -238,0 +241,0 @@ } |
{ | ||
"name": "@adraffy/ens-normalize", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "Compact ES6 Ethereum Name Service (ENS) Name Normalizer", | ||
@@ -5,0 +5,0 @@ "keywords": ["ENS", "Ethereum", "UTS-46", "IDNA2008"], |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
31198
312