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.
Files changed (2) hide show
  1. package/lib/search.ts +5 -2
  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])) matches = matches.filter((book) => !hasNum(book.name))
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
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "json-bible",
3
3
  "description": "Universal JSON Bible Format",
4
- "version": "1.1.5",
4
+ "version": "1.1.6",
5
5
  "main": "index.js",
6
6
  "type": "module",
7
7
  "scripts": {