mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-20 06:55:08 -04:00
Formatting patch: Linter test fixes
This commit is contained in:
parent
19d0b7e915
commit
b0d806cd36
1 changed files with 9 additions and 1 deletions
|
@ -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");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue