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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ip-utilties",
3
- "version": "1.0.6",
3
+ "version": "1.1.0",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "provenance": true
package/src/ip.mjs CHANGED
@@ -244,8 +244,8 @@ export function normalizeCIDR(address) {
244
244
  };
245
245
  }
246
246
 
247
- export function formatCIDR(address, subnet) {
248
- return subnet ? `${address}/${subnet.prefixLength}` : address;
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, subnet: any): 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;