@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/index.cjs +10 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +10 -0
- package/dist/index.mjs.map +1 -1
- package/dist/misc.d.ts +7 -0
- package/package.json +1 -1
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
|