File tree Expand file tree Collapse file tree 2 files changed +35
-0
lines changed
Expand file tree Collapse file tree 2 files changed +35
-0
lines changed Original file line number Diff line number Diff line change 1+ import punycode = require( 'punycode/' ) ;
2+
3+ /**
4+ * Validate a hostname. Returns true or throws a detailed error.
5+ *
6+ * @throws {SyntaxError }
7+ */
8+ declare function isIdnHostname ( hostname : string ) : true ;
9+
10+ /**
11+ * Returns the ACE hostname or throws a detailed error (it also validates the input)
12+ *
13+ * @throws {SyntaxError }
14+ */
15+ declare function idnHostname ( hostname : string ) : string ;
16+
17+ /**
18+ * Returns the uts46 mapped label (not hostname) or throws an error if the label
19+ * has dissallowed or unassigned chars.
20+ *
21+ * @throws {SyntaxError }
22+ */
23+ declare function uts46map ( label : string ) : string ;
24+
25+ declare const IdnHostname : {
26+ isIdnHostname : typeof isIdnHostname ;
27+ idnHostname : typeof idnHostname ;
28+ uts46map : typeof uts46map ;
29+ punycode : typeof punycode ;
30+ } ;
31+
32+ export = IdnHostname ;
Original file line number Diff line number Diff line change 2626 },
2727 "dependencies" : {
2828 "punycode" : " ^2.3.1"
29+ },
30+ "devDependencies" : {
31+ "@types/punycode" : " ^2.1.4"
2932 }
3033}
You can’t perform that action at this time.
0 commit comments