web 3d图形渲染器
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
3.2 KiB

  1. ## Methods
  2. ### `domain.analyze(domain, [options])`
  3. Analyzes a string to verify it is a valid domain name where:
  4. - `domain` - the domain name string being verified.
  5. - `options` - optional settings:
  6. - `allowUnicode` - if `false`, Unicode characters are not allowd in domain names. Defaults to `true`.
  7. - `minDomainSegments` - the minimum number of domain segments (e.g. `x.y.z` has 3 segments) required. Defaults to `2`.
  8. - `tlds` - options to validate the top-level-domain segment (e.g. `com` in `example.com`). Can be set to one of:
  9. - `false` - disable TLD validation.
  10. - `true` - validate the TLD using the official list of [registered names](http://data.iana.org/TLD/tlds-alpha-by-domain.txt). This is the default setting.
  11. - an object with one (and only one) of:
  12. - `deny` - a `Set` with strings matching forbidden TLD values (all non-matching values are allowed).
  13. - `allow` - a `Set` with strings matching the only allowed TLD values. Can also be set to `true` which defaults to the official list of [registered names](http://data.iana.org/TLD/tlds-alpha-by-domain.txt).
  14. If the `domain` is valid, no return value. If the `domain` is invalid, an object is returned with:
  15. - `error` - a string containing the reason the domain is invalid.
  16. ### `domain.isValid(domain, [options])`
  17. Validates a string to verify it is a valid domain name where:
  18. - `domain` - the domain name string being verified.
  19. - `options` - same options as [`domain.analyze()`](#domainanalyzedomain-options).
  20. ### `email.analyze(email, [options])`
  21. Analyzes a string to verify it is a valid email address where:
  22. - `email` - the email address string being verified.
  23. - `options` - optional settings:
  24. - `allowUnicode` - if `false`, Unicode characters are not allowd in the email address local and domain parts. Defaults to `true`.
  25. - `ignoreLength` - if `true`, the standards email maximum length limit is ignored. Defaults to `true`.
  26. - `minDomainSegments` - the minimum number of domain segments (e.g. `x.y.z` has 3 segments) required in the domain part. Defaults to `2`.
  27. - `tlds` - options to validate the top-level-domain segment (e.g. `com` in `example.com`) of the domain part. Can be set to one of:
  28. - `false` - disable TLD validation.
  29. - `true` - validate the TLD using the official list of [registered names](http://data.iana.org/TLD/tlds-alpha-by-domain.txt). This is the default setting.
  30. - an object with one (and only one) of:
  31. - `deny` - a `Set` with strings matching forbidden TLD values (all non-matching values are allowed).
  32. - `allow` - a `Set` with strings matching the only allowed TLD values. Can also be set to `true` which defaults to the official list of [registered names](http://data.iana.org/TLD/tlds-alpha-by-domain.txt).
  33. If the `email` is valid, no return value. If the `email` is invalid, an object is returned with:
  34. - `error` - a string containing the reason the email is invalid.
  35. ### `email.isValid(email, [options])`
  36. Validates a string to verify it is a valid email address where:
  37. - `email` - the email address string being verified.
  38. - `options` - same options as [`email.analyze()`](#emailanalyzeemail-options).