Thursday, May 16, 2019

ip-num version 1.2.0 has been released.

NOTE: A cyclic dependency issue was found in the 1.2.0 release and has been fixed with the 1.2.1 patch release. It is thus advised to use version 1.2.1. The content of this post still applies. 
ip-num version 1.2.0 has been released.













This release contains the following enhancements/additions:

Switched JavaScript target to es5 to ease usage in ie11.

Based on this issue, the generated JavaScript for ip-num is now es5. This is to make it easier to use in browsers that do not support es6: like internet explorer 11. Unfortunately things won’t still work right out of the box, and a polyfill for string.prototype.repeat needs to be included. Trying to get things to work in ie11 is already sucking out the fun on working on the library, so I would not be spending any more energy/time on this. Perhaps in the future I will look into getting things to work out of the box with ie11...or perhaps not.

Moved some operations to the IPRange interface.

The following methods were moved to the IPRange interface:
  • isConsecutive - Indicates whether the given IP range is an adjacent range
  • Contains - Indicates if the given IP range is contained within the range
  • Inside - inverse of Contains. It indicates if the range is contained inside the given range
  • isOverlapping - Checks if two IP ranges overlap (which will always be false with CIDR ranges)

Added method to IPRange to return the adjacent ranges.

This enables the ability to check if a range has next or previous range and the ability to return such a range. So for example:

IPv4CidrRange.fromCidr("255.255.254.0/24").hasNextRange() will return true and
IPv4CidrRange.fromCidr("255.255.254.0/24").nextRange().toCidrString() will return 255.255.255.0/24



Added ability to validate if a CIDR notation represents a valid range.

Added isValidIPv4CidrRange/isValidIPv6CidrRange validation methods that returns true or false depending on if the given ip number represents the start of the CIDR range.

For example, validating 10.0.0.0/8 should return true, since 10.0.0.0 is the start of the CIDR range depicted, but validating 10.0.4.23/8 should return false, since 10.0.4.23/8 is not the start of the range.

This new validation is a stricter form of already existing isValidIPv4CidrNotation/isValidIPv6CidrNotation which only validates that the given string is of the format [ip number]/[range].

That is basically the summary of the 1.2.0 release. Work would start soon on the 1.3.0 version, which would focus mainly on adding operations for working with sets of IP numbers to the library.