validator.js icon indicating copy to clipboard operation
validator.js copied to clipboard

isFQDN: allow numbers everywhere

Open kle-pra opened this issue 3 years ago • 1 comments

Hello,

according to FQDN specs ("Only letters, numbers, or dashes can be used."), numbers can be a part of FQDN, not only in TLD (which we can now allow with allow_numeric_tld: true).

Maybe there should be a more general option, alow_numeric.

kle-pra avatar Feb 04 '22 09:02 kle-pra

Example: abc.efg.g1h. will always fail, current options don't provide this use case, but is valid

validator.isFQDN('abc.efg.g1h.', 
  { allow_trailing_dot: true, allow_underscores: true, allow_numeric_tld: true}); // false but should be true

sysmat avatar Feb 04 '22 09:02 sysmat

@kle-pra @sysmat it looks like commit https://github.com/validatorjs/validator.js/commit/8f04ca96306324abc7a7faecbd6e2307d5a59dde / PR #1939 may have fixed the issue.

Kindly confirm if that is the case, so that I can close the issue

pano9000 avatar Jan 22 '23 23:01 pano9000

Thank you, It looks OK now when cloning, building & testing file validator.min.js from master branch. The example from @sysmat also works correctly.

Is there also a possibility to npm install master branch directly from github (for example for angular project)? npm i https://github.com/validatorjs/validator.js.git doesn't seem to work correctly.

kle-pra avatar Jan 23 '23 10:01 kle-pra

it looks fine. Is there any plan for release or roadmap

sysmat avatar Jan 23 '23 10:01 sysmat

The idea is that the next release will come out somewhere in the next two weeks

WikiRik avatar Jan 23 '23 12:01 WikiRik

thanks for your replies. closing this as "fixed" then

pano9000 avatar Jan 23 '23 19:01 pano9000

@kle-pra

Is there also a possibility to npm install master branch directly from github (for example for angular project)? npm i https://github.com/validatorjs/validator.js.git doesn't seem to work correctly.

this is down to issue #2123 as some sort of workaround, you could check comment: https://github.com/validatorjs/validator.js/issues/2123#issuecomment-1340788345

pano9000 avatar Jan 23 '23 19:01 pano9000