Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fixing linting issues
  • Loading branch information
sw5678 committed Jul 31, 2025
commit 27e4d7e3bb1def332f9ef3ae60eba89633adcf40
6 changes: 2 additions & 4 deletions src/core/operations/WordCount.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,7 @@ class WordCount extends Operation {
for (let j = 0; j < inputArray.length; j++) {

// Trim whitespace and replace punctuation
const word = inputArray[j].replace(/[!"#\$%&\(\)\*\+,-\.\/:;<=>\?@\[\\\]\^_`\{\\}~£\|]/g, "").trim();


const word = inputArray[j].replace(/[!"#$%&()*+,-./:;<=>?@[\\\]^_`{}~£|]/g, "").trim();

// If empty string or ', then skip
if (word === "" || /[']+/.test(word)) {
Expand Down Expand Up @@ -102,7 +100,7 @@ class WordCount extends Operation {

// Process output to string
let output = "WORD,COUNT\n";
output = output + order.map(entry => `${entry},${counter[entry]}`).join('\n');
output = output + order.map(entry => `${entry},${counter[entry]}`).join("\n");

// Add total counter at the bottom
if (args[1]) {
Expand Down
Loading