-
Notifications
You must be signed in to change notification settings - Fork 71
Description
Thank you for great library. We use the library in both strict and lax mode depending on how flexible we want to be with the user input. One of the things that repeatly trips users up is they paste the domain with a leading dot having removed the subdomains but accidentally left the dot. Not sure if this is something the librar is meant to accept as valid input under lax.
const parseResult = parseDomain(fromUrl(".reflectoring.io"), { validation: Validation.Lax, }); console.log(parseResult);
Current Result:
{ type: 'INVALID', hostname: '.reflectoring.io', errors: [ { type: 'LABEL_MIN_LENGTH', message: 'Label "" is too short. Label is 0 octets long but should be at least 1.', column: 1 } ] }
Expected Result:
{ type: 'LISTED', hostname: 'reflectoring.io', labels: [ 'reflectoring', 'io' ], icann: { subDomains: [], domain: 'reflectoring', topLevelDomains: [ 'io' ] }, subDomains: [], domain: 'reflectoring', topLevelDomains: [ 'io' ] }