fix: support ip-address v10 (bigInt/fromBigInt rename) - #52
Open
andrewmkhoury wants to merge 1 commit into
Open
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ip-addressv10 renamedAddress4/Address6'sbigInteger()/fromBigInteger()methods tobigInt()/fromBigInt(), and the new methods work with nativeBigIntvalues instead of numeric strings. This currently breaksip-cidrfor anyone onip-addressv10:Since
ip-cidr'spackage.jsonpins"ip-address": "^9.0.5", consumers who need to move toip-addressv10 (for example to pick up a fix published in that major line) currently have no path to do so throughip-cidr.Changes
index.jsthat usedbigInteger()/fromBigInteger()to usebigInt()/fromBigInt()instead.ip-addressdependency range to^10.1.1.dist/ip-cidr.jsvia the existingnpm run buildscript (triggered automatically by the repo'shuskypre-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 passingIPCIDRconstruction,contains(),toRange(),toArray(), andloop()for both IPv4 and IPv6 CIDRs againstip-address@10.1.1