ip-utilties 1.0.5 → 1.0.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 +0 -15
- package/types/ip.d.mts +0 -2
package/package.json
CHANGED
package/src/ip.mjs
CHANGED
|
@@ -30,21 +30,6 @@ const ipv6 = {
|
|
|
30
30
|
base: 16
|
|
31
31
|
};
|
|
32
32
|
|
|
33
|
-
export function IPV4(...args) {
|
|
34
|
-
return _create(ipv4, ...args);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export function IPV6(...args) {
|
|
38
|
-
return _create(ipv6, ...args);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
function _create(definition, ...args) {
|
|
42
|
-
if (args.length === 1) {
|
|
43
|
-
return _encode(definition, args[0]);
|
|
44
|
-
}
|
|
45
|
-
return new definition.factory(args);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
33
|
export function encodeIP(address) {
|
|
49
34
|
const d = _definition(address);
|
|
50
35
|
return d && _encode(d, address);
|