isInNet.d.ts 991 B

123456789101112131415161718192021222324
  1. /**
  2. * True iff the IP address of the host matches the specified IP address pattern.
  3. *
  4. * Pattern and mask specification is done the same way as for SOCKS configuration.
  5. *
  6. * Examples:
  7. *
  8. * ``` js
  9. * isInNet(host, "198.95.249.79", "255.255.255.255")
  10. * // is true iff the IP address of host matches exactly 198.95.249.79.
  11. *
  12. * isInNet(host, "198.95.0.0", "255.255.0.0")
  13. * // is true iff the IP address of the host matches 198.95.*.*.
  14. * ```
  15. *
  16. * @param {String} host a DNS hostname, or IP address. If a hostname is passed,
  17. * it will be resoved into an IP address by this function.
  18. * @param {String} pattern an IP address pattern in the dot-separated format mask.
  19. * @param {String} mask for the IP address pattern informing which parts of the
  20. * IP address should be matched against. 0 means ignore, 255 means match.
  21. * @return {Boolean}
  22. */
  23. export default function isInNet(host: string, pattern: string, mask: string): Promise<boolean>;
  24. //# sourceMappingURL=isInNet.d.ts.map