json-bible 1.1.5 → 1.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/search.ts +5 -2
- package/package.json +1 -1
package/lib/search.ts
CHANGED
|
@@ -90,9 +90,12 @@ export function _bookSearch(bible: Bible, searchValue: string) {
|
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
-
// remove books with numbers if no number at search start (John)
|
|
93
|
+
// remove books with numbers if no number at search start (John) - when there are matches
|
|
94
94
|
const hasNum = (str: string) => /\d/.test(str)
|
|
95
|
-
if (!hasNum(name[0])
|
|
95
|
+
if (!hasNum(name[0]) && name.length > 1) {
|
|
96
|
+
const noNumberMatches = matches.filter((book) => !hasNum(book.name))
|
|
97
|
+
if (noNumberMatches.length) matches = noNumberMatches
|
|
98
|
+
}
|
|
96
99
|
|
|
97
100
|
return matches
|
|
98
101
|
}
|