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