mirror of
https://github.com/gchq/CyberChef.git
synced 2025-06-18 12:15:14 -04:00
ESM: Ported SeqUtils operations
This commit is contained in:
parent
66c768fe31
commit
d327dd47b2
7 changed files with 447 additions and 0 deletions
39
src/core/operations/RemoveLineNumbers.mjs
Normal file
39
src/core/operations/RemoveLineNumbers.mjs
Normal file
|
@ -0,0 +1,39 @@
|
|||
/**
|
||||
* @author n1474335 [n1474335@gmail.com]
|
||||
* @copyright Crown Copyright 2016
|
||||
* @license Apache-2.0
|
||||
*/
|
||||
|
||||
import Operation from "../Operation";
|
||||
|
||||
/**
|
||||
* Remove line numbers operation
|
||||
*/
|
||||
class RemoveLineNumbers extends Operation {
|
||||
|
||||
/**
|
||||
* RemoveLineNumbers constructor
|
||||
*/
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
this.name = "Remove line numbers";
|
||||
this.module = "Default";
|
||||
this.description = "Removes line numbers from the output if they can be trivially detected.";
|
||||
this.inputType = "string";
|
||||
this.outputType = "string";
|
||||
this.args = [];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} input
|
||||
* @param {Object[]} args
|
||||
* @returns {string}
|
||||
*/
|
||||
run(input, args) {
|
||||
return input.replace(/^[ \t]{0,5}\d+[\s:|\-,.)\]]/gm, "");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export default RemoveLineNumbers;
|
Loading…
Add table
Add a link
Reference in a new issue