From 2ac3ec2a7c49451dcfd3fb185355d79ca5da9913 Mon Sep 17 00:00:00 2001 From: n1073645 Date: Wed, 4 Dec 2019 14:52:55 +0000 Subject: [PATCH] Modifications to the IP library --- src/core/lib/IP.mjs | 4 ++-- src/core/operations/ParseX509Certificate.mjs | 6 +++--- src/core/operations/RemoveLineNumbers.mjs | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/core/lib/IP.mjs b/src/core/lib/IP.mjs index f9c54ad0..63816d82 100644 --- a/src/core/lib/IP.mjs +++ b/src/core/lib/IP.mjs @@ -64,7 +64,7 @@ export function ipv6CidrRange(cidr, includeNetworkInfo) { cidrRange = parseInt(cidr[cidr.length-1], 10); if (cidrRange < 0 || cidrRange > 127) { - return "IPv6 CIDR must be less than 128"; + throw new OperationError("IPv6 CIDR must be less than 128"); } const ip1 = new Array(8), @@ -254,7 +254,7 @@ export function ipv6ListedRange(match, includeNetworkInfo) { const cidrRange = parseInt(ipv6CidrList[i].split("/")[1], 10); if (cidrRange < 0 || cidrRange > 127) { - return "IPv6 CIDR must be less than 128"; + throw new OperationError("IPv6 CIDR must be less than 128"); } const cidrIp1 = new Array(8), diff --git a/src/core/operations/ParseX509Certificate.mjs b/src/core/operations/ParseX509Certificate.mjs index 7ee6be23..69192853 100644 --- a/src/core/operations/ParseX509Certificate.mjs +++ b/src/core/operations/ParseX509Certificate.mjs @@ -31,9 +31,9 @@ class ParseX509Certificate extends Operation { this.outputType = "string"; this.args = [ { - "name": "Input format", - "type": "option", - "value": ["PEM", "DER Hex", "Base64", "Raw"] + name: "Input format", + type: "option", + value: ["PEM", "DER Hex", "Base64", "Raw"] } ]; this.checks = new magicObject([ diff --git a/src/core/operations/RemoveLineNumbers.mjs b/src/core/operations/RemoveLineNumbers.mjs index b5ef75ce..5b512873 100644 --- a/src/core/operations/RemoveLineNumbers.mjs +++ b/src/core/operations/RemoveLineNumbers.mjs @@ -28,7 +28,7 @@ class RemoveLineNumbers extends Operation { { match: "^\\s*([0-9]+ .*?(\\n))+[0-9] .+$", flags: "", - magic: true, + magic: false, args: [] } ]);