Skip to content

Commit

Permalink
Do not allow numbers in word-like names
Browse files Browse the repository at this point in the history
  • Loading branch information
antonmedv committed Dec 13, 2024
1 parent 4632c36 commit 87feb41
Show file tree
Hide file tree
Showing 4 changed files with 205 additions and 186 deletions.
2 changes: 1 addition & 1 deletion finder.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ function* search(input, config, rootDocument) {
}
}
function wordLike(name) {
if (/^[a-z0-9\-]{3,}$/i.test(name)) {
if (/^[a-z\-]{3,}$/i.test(name)) {
const words = name.split(/-|[A-Z]/);
for (const word of words) {
if (word.length <= 2) {
Expand Down
2 changes: 1 addition & 1 deletion finder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ function* search(
}

function wordLike(name: string): boolean {
if (/^[a-z0-9\-]{3,}$/i.test(name)) {
if (/^[a-z\-]{3,}$/i.test(name)) {
const words = name.split(/-|[A-Z]/)
for (const word of words) {
if (word.length <= 2) {
Expand Down
Loading

0 comments on commit 87feb41

Please sign in to comment.