Skip to content

Commit

Permalink
[Lint] Fix violations of no-useless-escape (#176)
Browse files Browse the repository at this point in the history
Makes reading strings easier. [1]

Fixes 2 ES lint violations. 36 left till #162 is done.

[1]: https://eslint.org/docs/latest/rules/no-useless-escape
  • Loading branch information
dchege711 authored Jun 16, 2024
1 parent 23bf3fa commit 24ec67a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/models/CardsMongoDB.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,11 +198,11 @@ export function search(
* `arrays dynamic_programming iterative-algorithms dynamic programming iterative algorithms`
*/
const splitTags = function(s: string): string {
const possibleTags = s.match(/[\w|\d]+(\_|-){1}[\w|\d]+/g);
const possibleTags = s.match(/[\w|\d]+(_|-){1}[\w|\d]+/g);
if (possibleTags === null) { return s; }

for (let i = 0; i < possibleTags.length; i++) {
s += " " + possibleTags[i].split(/[\_-]/g).join(" ");
s += " " + possibleTags[i].split(/[_-]/g).join(" ");
}
return s;
};
Expand Down

0 comments on commit 24ec67a

Please sign in to comment.