ip-utilties 1.4.5 → 1.4.6
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 +6 -9
package/package.json
CHANGED
package/src/ip.mjs
CHANGED
|
@@ -223,21 +223,18 @@ export function normalizeCIDR(address) {
|
|
|
223
223
|
let [prefix, prefixLength] = address.split(/\//);
|
|
224
224
|
let longPrefix;
|
|
225
225
|
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
if (isLinkLocal(address)) {
|
|
229
|
-
prefix = "fe80::";
|
|
230
|
-
longPrefix = prefix;
|
|
231
|
-
prefixLength = 64;
|
|
232
|
-
} else if (isUniqueLocal(address)) {
|
|
226
|
+
if (isUniqueLocal(address) || isLinkLocal(address)) {
|
|
233
227
|
prefixLength = 64;
|
|
234
228
|
const n = _prefix(ipv6, address, prefixLength);
|
|
235
229
|
prefix = _decode(ipv6, n, prefixLength);
|
|
236
|
-
if(!prefix.endsWith(
|
|
237
|
-
|
|
230
|
+
if (!prefix.endsWith("::")) {
|
|
231
|
+
// TODO
|
|
232
|
+
prefix += "::";
|
|
238
233
|
}
|
|
239
234
|
longPrefix = prefix;
|
|
240
235
|
} else {
|
|
236
|
+
prefixLength = prefixLength === undefined ? 0 : parseInt(prefixLength);
|
|
237
|
+
|
|
241
238
|
const family = /*_family(prefix); */ isIPv6(prefix) ? ipv6 : ipv4;
|
|
242
239
|
let n;
|
|
243
240
|
|