ip-utilties 1.0.6 → 1.1.0
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/package.json +1 -1
- package/src/ip.mjs +2 -2
- package/types/ip.d.mts +1 -1
package/package.json
CHANGED
package/src/ip.mjs
CHANGED
|
@@ -244,8 +244,8 @@ export function normalizeCIDR(address) {
|
|
|
244
244
|
};
|
|
245
245
|
}
|
|
246
246
|
|
|
247
|
-
export function formatCIDR(address,
|
|
248
|
-
return
|
|
247
|
+
export function formatCIDR(address, prefixLength) {
|
|
248
|
+
return prefixLength ? `${decodeIP(address)}/${prefixLength}` : address;
|
|
249
249
|
}
|
|
250
250
|
|
|
251
251
|
export function normalizeIP(address) {
|
package/types/ip.d.mts
CHANGED
|
@@ -20,7 +20,7 @@ export function normalizeCIDR(address: any): {
|
|
|
20
20
|
prefixLength: any;
|
|
21
21
|
cidr: string;
|
|
22
22
|
};
|
|
23
|
-
export function formatCIDR(address: any,
|
|
23
|
+
export function formatCIDR(address: any, prefixLength: any): any;
|
|
24
24
|
export function normalizeIP(address: any): string;
|
|
25
25
|
export function reverseArpa(address: any): string;
|
|
26
26
|
export function isLocalhost(address: any): boolean;
|