Skip to content

Commit

Permalink
trim words so they don't have a leading/trailing space
Browse files Browse the repository at this point in the history
  • Loading branch information
barisusakli committed Jan 31, 2024
1 parent f339273 commit c209e33
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/toRegExp.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ function toRegExp(arr, fullWord) {
if (!Array.isArray(arr)) {
arr = (arr || '').toString().split(',');
}
arr = arr.filter(Boolean);
arr = arr.map(str => str.trim()).filter(Boolean);

var str;
if (fullWord) {
Expand Down

0 comments on commit c209e33

Please sign in to comment.