diff --git a/src/core/operations/Wrap.mjs b/src/core/operations/Wrap.mjs index 303ea9e2..004246ac 100644 --- a/src/core/operations/Wrap.mjs +++ b/src/core/operations/Wrap.mjs @@ -5,7 +5,6 @@ */ import Operation from "../Operation.mjs"; -import OperationError from "../errors/OperationError.mjs"; const MAX_LINE_WIDTH = 65536; @@ -45,16 +44,6 @@ class Wrap extends Operation { run(input, args) { if (!input) return ""; // Handle empty input const lineWidth = args[0]; - - if (!Number.isInteger(lineWidth)) - throw new OperationError("Line Width must be an integer."); - - if (lineWidth < 1) - throw new OperationError("Line Width must be greater than or equal to 1."); - - if (lineWidth > MAX_LINE_WIDTH) - throw new OperationError(`Line Width must be less than or equal to ${MAX_LINE_WIDTH}.`); - const regex = new RegExp(`.{1,${lineWidth}}`, "g"); return input.match(regex).join("\n"); } diff --git a/tests/operations/tests/Wrap.mjs b/tests/operations/tests/Wrap.mjs index 2373d070..8d7c9a51 100644 --- a/tests/operations/tests/Wrap.mjs +++ b/tests/operations/tests/Wrap.mjs @@ -40,38 +40,5 @@ TestRegister.addTests([ "args": [10] }, ], - }, - { - name: "Wrap rejects negative line width", - input: "hi, how about you", - expectedOutput: "Line Width must be greater than or equal to 1.", - recipeConfig: [ - { - "op": "Wrap", - "args": [-1] - }, - ], - }, - { - name: "Wrap rejects floating-point line width", - input: "hi, how about you", - expectedOutput: "Line Width must be an integer.", - recipeConfig: [ - { - "op": "Wrap", - "args": [1.1] - }, - ], - }, - { - name: "Wrap rejects excessively large line width", - input: "hi, how about you", - expectedOutput: "Line Width must be less than or equal to 65536.", - recipeConfig: [ - { - "op": "Wrap", - "args": [1.1761717177171882e+23] - }, - ], } ]);