Skip to content

Parsing error for IPv6mask :: is not expanded #87

@LuWa-at-work

Description

@LuWa-at-work

Hey im not sure if this is inteded or a bug:

// expanded Address -> works fine on IPv6 and IPv6Mask
const a = new IPv6("ffff:ffff:ffff:ffff:0:0:0:0"); // works fine
console.log(a.toString())  // "ffff:ffff:ffff:ffff:0:0:0:0"
const b = new IPv6Mask("ffff:ffff:ffff:ffff:0:0:0:0"); // works fine
console.log(b.toString())  // "ffff:ffff:ffff:ffff:0:0:0:0"

// collapsed Address -> works only for IPv6 
const c = new IPv6("ffff:ffff:ffff:ffff::"); // works fine
console.log(c.toString())  // "ffff:ffff:ffff:ffff:0:0:0:0"
const d = new IPv6Mask("ffff:ffff:ffff:ffff::");  // throws RangeError (see trace below)
console.log(d.toString()) 

Stacktrace

Hexadecatet.ts:50 Uncaught (in promise) RangeError: The number NaN cannot be converted to a BigInt because it is not an integer
    at BigInt (<anonymous>)
    at new Hexadecatet (Hexadecatet.ts:50:67)
    at Hexadecatet.fromString (Hexadecatet.ts:21:16)
    at IPNumber.ts:837:32
    at Array.map (<anonymous>)
    at new IPv6Mask (IPNumber.ts:836:47)
    at setup (PrimeVueTest.vue:26:15)
    at callWithErrorHandling (runtime-core.esm-bundler.js:173:22)
    at setupStatefulComponent (runtime-core.esm-bundler.js:7265:29)
    at setupComponent (runtime-core.esm-bundler.js:7220:11)

Version: ip-num@1.5.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions