Formatting patch: Linter test fixes

This commit is contained in:
Niall 2024-08-22 18:34:05 +00:00
parent 19d0b7e915
commit b0d806cd36

View file

@ -6,6 +6,9 @@
import Operation from "../Operation.mjs"; import Operation from "../Operation.mjs";
/**
* Wrap operation
*/
class Wrap extends Operation { class Wrap extends Operation {
constructor() { constructor() {
super(); super();
@ -24,10 +27,15 @@ class Wrap extends Operation {
]; ];
} }
/**
* @param {string} input
* @param {Object[]} args
* @returns {string}
*/
run(input, args) { run(input, args) {
if (!input) return ""; // Handle empty input if (!input) return ""; // Handle empty input
const lineWidth = args[0]; const lineWidth = args[0];
const regex = new RegExp(`.{1,${lineWidth}}`, 'g'); const regex = new RegExp(`.{1,${lineWidth}}`, "g");
return input.match(regex).join("\n"); return input.match(regex).join("\n");
} }
} }