@@ -414,17 +414,17 @@ Describes the shape of the parse result that is returned when the given hostname
414
414
415
415
``` ts
416
416
type ParseResultInvalid = {
417
- type: ParseResultType .INVALID ;
418
- hostname: string | typeof NO_HOSTNAME ;
419
- errors: Array <ValidationError >;
417
+ type: ParseResultType .INVALID ;
418
+ hostname: string | typeof NO_HOSTNAME ;
419
+ errors: Array <ValidationError >;
420
420
};
421
421
422
422
// Example
423
423
424
424
{
425
- type : " INVALID" ,
426
- hostname : " .com" ,
427
- errors : [... ]
425
+ type : " INVALID" ,
426
+ hostname : " .com" ,
427
+ errors : [... ]
428
428
}
429
429
```
430
430
@@ -436,17 +436,17 @@ Describes the shape of a validation error as returned by [`parseDomain`](#api-js
436
436
437
437
``` ts
438
438
type ValidationError = {
439
- type: ValidationErrorType ;
440
- message: string ;
441
- column: number ;
439
+ type: ValidationErrorType ;
440
+ message: string ;
441
+ column: number ;
442
442
};
443
443
444
444
// Example
445
445
446
446
{
447
- type : " LABEL_MIN_LENGTH" ,
448
- message : ` Label "" is too short. Label is 0 octets long but should be at least 1. ` ,
449
- column : 1 ,
447
+ type : " LABEL_MIN_LENGTH" ,
448
+ message : ` Label "" is too short. Label is 0 octets long but should be at least 1. ` ,
449
+ column : 1 ,
450
450
}
451
451
```
452
452
@@ -481,17 +481,17 @@ This type describes the shape of the parse result that is returned when the give
481
481
482
482
``` ts
483
483
type ParseResultIp = {
484
- type: ParseResultType .Ip ;
485
- hostname: string ;
486
- ipVersion: 4 | 6 ;
484
+ type: ParseResultType .Ip ;
485
+ hostname: string ;
486
+ ipVersion: 4 | 6 ;
487
487
};
488
488
489
489
// Example
490
490
491
491
{
492
- type : " IP" ,
493
- hostname : " 192.168.0.1" ,
494
- ipVersion : 4
492
+ type : " IP" ,
493
+ hostname : " 192.168.0.1" ,
494
+ ipVersion : 4
495
495
}
496
496
```
497
497
@@ -516,17 +516,17 @@ This type describes the shape of the parse result that is returned when the give
516
516
517
517
``` ts
518
518
type ParseResultReserved = {
519
- type: ParseResultType .Reserved ;
520
- hostname: string ;
521
- labels: Array <string >;
519
+ type: ParseResultType .Reserved ;
520
+ hostname: string ;
521
+ labels: Array <string >;
522
522
};
523
523
524
524
// Example
525
525
526
526
{
527
- type : " RESERVED" ,
528
- hostname : " pecorino.local" ,
529
- labels : [" pecorino" , " local" ]
527
+ type : " RESERVED" ,
528
+ hostname : " pecorino.local" ,
529
+ labels : [" pecorino" , " local" ]
530
530
}
531
531
```
532
532
@@ -540,17 +540,17 @@ Describes the shape of the parse result that is returned when the given hostname
540
540
541
541
``` ts
542
542
type ParseResultNotListed = {
543
- type: ParseResultType .NotListed ;
544
- hostname: string ;
545
- labels: Array <string >;
543
+ type: ParseResultType .NotListed ;
544
+ hostname: string ;
545
+ labels: Array <string >;
546
546
};
547
547
548
548
// Example
549
549
550
550
{
551
- type : " NOT_LISTED" ,
552
- hostname : " this.is.not-listed" ,
553
- labels : [" this" , " is" , " not-listed" ]
551
+ type : " NOT_LISTED" ,
552
+ hostname : " this.is.not-listed" ,
553
+ labels : [" this" , " is" , " not-listed" ]
554
554
}
555
555
```
556
556
@@ -562,33 +562,33 @@ Describes the shape of the parse result that is returned when the given hostname
562
562
563
563
``` ts
564
564
type ParseResultListed = {
565
- type: ParseResultType .Listed ;
566
- hostname: string ;
567
- labels: Array <string >;
568
- subDomains: Array <string >;
569
- domain: string | undefined ;
570
- topLevelDomains: Array <string >;
571
- icann: {
572
- subDomains: Array <string >;
573
- domain: string | undefined ;
574
- topLevelDomains: Array <string >;
575
- };
565
+ type: ParseResultType .Listed ;
566
+ hostname: string ;
567
+ labels: Array <string >;
568
+ subDomains: Array <string >;
569
+ domain: string | undefined ;
570
+ topLevelDomains: Array <string >;
571
+ icann: {
572
+ subDomains: Array <string >;
573
+ domain: string | undefined ;
574
+ topLevelDomains: Array <string >;
575
+ };
576
576
};
577
577
578
578
// Example
579
579
580
580
{
581
- type : " LISTED" ,
582
- hostname : " parse-domain.github.io" ,
583
- labels : [" parse-domain" , " github" , " io" ]
584
- subDomains : [],
585
- domain : " parse-domain" ,
586
- topLevelDomains : [" github" , " io" ],
587
- icann : {
588
- subDomains : [" parse-domain" ],
589
- domain : " github" ,
590
- topLevelDomains : [" io" ]
591
- }
581
+ type : " LISTED" ,
582
+ hostname : " parse-domain.github.io" ,
583
+ labels : [" parse-domain" , " github" , " io" ]
584
+ subDomains : [],
585
+ domain : " parse-domain" ,
586
+ topLevelDomains : [" github" , " io" ],
587
+ icann : {
588
+ subDomains : [" parse-domain" ],
589
+ domain : " github" ,
590
+ topLevelDomains : [" io" ]
591
+ }
592
592
}
593
593
```
594
594
0 commit comments