Linted archive

This commit is contained in:
Angelos Chalaris
2018-09-15 13:52:12 +03:00
parent 3a887a67f4
commit 2ba4b95b47
11 changed files with 77 additions and 51 deletions

View File

@ -1,5 +1,11 @@
const isSimilar = (pattern, str) =>
[...str].reduce(
(matchIndex, char) => char.toLowerCase() === (pattern[matchIndex] || '').toLowerCase() ? matchIndex + 1 : matchIndex, 0
) === pattern.length ? true : false;
[...str].reduce(
(matchIndex, char) =>
char.toLowerCase() === (pattern[matchIndex] || '').toLowerCase()
? matchIndex + 1
: matchIndex,
0
) === pattern.length
? true
: false;
module.exports = isSimilar;