@ztimson/utils 0.28.6 → 0.28.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/misc.d.ts CHANGED
@@ -59,6 +59,13 @@ export declare function fn<T>(args: object, fn: string, async?: boolean): T;
59
59
  * @returns {string} Gravatar URL
60
60
  */
61
61
  export declare function gravatar(email: string, def?: string): string;
62
+ /**
63
+ * Check if IP address falls within CIDR range
64
+ * @param {string} ip IPV4 to check (192.168.0.12)
65
+ * @param {string} cidr IP range to check against (example: 192.168.0.0/24)
66
+ * @returns {boolean} Whether IP address is within range
67
+ */
68
+ export declare function matchesCidr(ip: string, cidr: string): boolean;
62
69
  /**
63
70
  * Convert IPv6 to v4 because who uses that, NAT4Life
64
71
  * @param {string} ip IPv6 address, e.g. 2001:0db8:85a3:0000:0000:8a2e:0370:7334
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ztimson/utils",
3
- "version": "0.28.6",
3
+ "version": "0.28.8",
4
4
  "description": "Utility library",
5
5
  "author": "Zak Timson",
6
6
  "license": "MIT",