Skip to content

fix: support ip-address v10 (bigInt/fromBigInt rename) - #52

Open
andrewmkhoury wants to merge 1 commit into
ortexx:masterfrom
andrewmkhoury:fix/support-ip-address-v10
Open

fix: support ip-address v10 (bigInt/fromBigInt rename)#52
andrewmkhoury wants to merge 1 commit into
ortexx:masterfrom
andrewmkhoury:fix/support-ip-address-v10

Conversation

@andrewmkhoury

Copy link
Copy Markdown

Summary

ip-address v10 renamed Address4/Address6's bigInteger() / fromBigInteger() methods to bigInt() / fromBigInt(), and the new methods work with native BigInt values instead of numeric strings. This currently breaks ip-cidr for anyone on ip-address v10:

TypeError: this.addressEnd.bigInteger is not a function

Since ip-cidr's package.json pins "ip-address": "^9.0.5", consumers who need to move to ip-address v10 (for example to pick up a fix published in that major line) currently have no path to do so through ip-cidr.

Changes

  • Updated the four call sites in index.js that used bigInteger() / fromBigInteger() to use bigInt() / fromBigInt() instead.
  • Bumped the ip-address dependency range to ^10.1.1.
  • Rebuilt dist/ip-cidr.js via the existing npm run build script (triggered automatically by the repo's husky pre-commit hook).

No behavioral change — this only follows the upstream rename. All 36 existing tests pass unmodified against ip-address@10.1.1.

Test plan

  • npm test — 36/36 passing
  • Manually verified IPCIDR construction, contains(), toRange(), toArray(), and loop() for both IPv4 and IPv6 CIDRs against ip-address@10.1.1

ip-address v10 renamed Address4/Address6's bigInteger()/fromBigInteger()
API to bigInt()/fromBigInt() (returning/accepting a native BigInt instead
of a numeric string). This left ip-cidr broken against ip-address v10:

  TypeError: this.addressEnd.bigInteger is not a function

Update the four call sites to the new API and bump the ip-address
dependency range to ^10.1.1. All 36 existing tests pass unchanged.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant