@@ -10,7 +10,7 @@ import {
1010 parsePartialInterpretedName ,
1111} from "./interpreted-names-and-labels" ;
1212import { encodeLabelHash , labelhashLiteralLabel } from "./labelhash" ;
13- import type { InterpretedLabel , InterpretedName , Name } from "./types" ;
13+ import type { InterpretedLabel , InterpretedName , LiteralLabel , Name } from "./types" ;
1414
1515const ENCODED_LABELHASH_LABEL = / ^ \[ [ \d a - f ] { 64 } \] $ / ;
1616
@@ -20,9 +20,9 @@ const NORMALIZED_LABELS = [
2020 "test" ,
2121 "eth" ,
2222 "base" ,
23- "\u{1F525} " ,
24- "test\u{1F382} " ,
25- "caf\u00E9 " ,
23+ "🔥 " ,
24+ "test🎂 " ,
25+ "café " ,
2626 "sub" ,
2727 "a" . repeat ( 512 ) , // Long normalized
2828] . map ( asLiteralLabel ) ;
@@ -91,15 +91,13 @@ describe("interpretation", () => {
9191 } ) ;
9292
9393 it ( "correctly interprets an empty array of labels" , ( ) => {
94- expect ( literalLabelsToInterpretedName ( ( [ ] as string [ ] ) . map ( asLiteralLabel ) ) ) . toEqual ( "" ) ;
94+ expect ( literalLabelsToInterpretedName ( [ ] as LiteralLabel [ ] ) ) . toEqual ( "" ) ;
9595 } ) ;
9696 } ) ;
9797
9898 describe ( "interpretedLabelsToInterpretedName" , ( ) => {
9999 it ( "correctly interprets an empty array of labels" , ( ) => {
100- expect ( interpretedLabelsToInterpretedName ( ( [ ] as string [ ] ) . map ( asInterpretedLabel ) ) ) . toEqual (
101- "" ,
102- ) ;
100+ expect ( interpretedLabelsToInterpretedName ( [ ] as InterpretedLabel [ ] ) ) . toEqual ( "" ) ;
103101 } ) ;
104102
105103 it ( "correctly interprets a single label" , ( ) => {
@@ -111,12 +109,9 @@ describe("interpretation", () => {
111109 const interpretedLabelThatLooksLikeALabelHash = literalLabelToInterpretedLabel ( literalLabel ) ;
112110
113111 expect (
114- interpretedLabelsToInterpretedName ( [
115- asInterpretedLabel ( "a" ) ,
116- asInterpretedLabel ( "b" ) ,
117- asInterpretedLabel ( "c" ) ,
118- interpretedLabelThatLooksLikeALabelHash ,
119- ] ) ,
112+ interpretedLabelsToInterpretedName (
113+ [ "a" , "b" , "c" , interpretedLabelThatLooksLikeALabelHash ] . map ( asInterpretedLabel ) ,
114+ ) ,
120115 ) . toEqual ( `a.b.c.${ interpretedLabelThatLooksLikeALabelHash } ` ) ;
121116 } ) ;
122117 } ) ;
@@ -129,7 +124,7 @@ describe("interpretation", () => {
129124 [ "t" , [ ] , "t" ] ,
130125 [ "test" , [ ] , "test" ] ,
131126 [ "exam" , [ ] , "exam" ] ,
132- [ "\u{1F525} " , [ ] , "\u{1F525} " ] ,
127+ [ "🔥 " , [ ] , "🔥 " ] ,
133128 // concrete TLD with empty partial
134129 [ "eth." , [ "eth" ] , "" ] ,
135130 [ "base." , [ "base" ] , "" ] ,
@@ -198,8 +193,8 @@ describe("interpretation", () => {
198193 // with encoded labelhash in parent
199194 [ "sub" , `${ EXAMPLE_ENCODED_LABEL_HASH } .eth` , `sub.${ EXAMPLE_ENCODED_LABEL_HASH } .eth` ] ,
200195 // emoji labels
201- [ "\u{1F525} " , "eth" , "\u{1F525} .eth" ] ,
202- [ "wallet" , "\u{1F525} .eth" , "wallet.\u{1F525} .eth" ] ,
196+ [ "🔥 " , "eth" , "🔥 .eth" ] ,
197+ [ "wallet" , "🔥 .eth" , "wallet.🔥 .eth" ] ,
203198 ] as [ InterpretedLabel , InterpretedName | undefined , InterpretedName ] [ ] ) (
204199 "constructSubInterpretedName(%j, %j) → %j" ,
205200 ( label , parent , expected ) => {
0 commit comments