json-bible 1.1.3 → 1.1.4

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/api/get.ts CHANGED
@@ -103,7 +103,8 @@ export default function ApiBibleHelper(key: string, customApiUrl?: string) {
103
103
  // HTTP
104
104
 
105
105
  export function fetchWrapper(url: string, headers: any, cacheTimeDays: number) {
106
- if (getCachedContent(url)) return Promise.resolve(getCachedContent(url, cacheTimeDays))
106
+ const cached = getCachedContent(url, cacheTimeDays)
107
+ if (cached) return Promise.resolve(cached)
107
108
 
108
109
  // console.info("Fetching:", url)
109
110
  return fetch(url, { headers })
package/lib/reference.ts CHANGED
@@ -127,7 +127,7 @@ function referenceStringToId(ref: string) {
127
127
  // "Genesis 1:1-3" = { book: "Genesis ", chapter: 1, verses: [1, 2, 3] }
128
128
  function splitReferenceString(ref: string) {
129
129
  // (:,.) allowed between chapter/verse - (-+) allowed between verses
130
- const regex = /(?<book>(?:\d+\.?\s?)?[\p{L}](?:[\p{L}\s']*[\p{L}])?)(?:\s(?<chapter>\d+))?(?:[:,.](?<verses>[0-9,.\-+]+))?/u
130
+ const regex = /(?<book>(?:\d+\.?\s?)?[\p{L}\p{M}](?:[\p{L}\p{M}\s']*[\p{L}\p{M}])?)(?:\s(?<chapter>\d+))?(?:[:,.](?<verses>[0-9,.\-+]+))?/u
131
131
  const match = ref.match(regex)
132
132
 
133
133
  if (!match) return { book: "", chapter: "", verses: "" }
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.3",
4
+ "version": "1.1.4",
5
5
  "main": "index.js",
6
6
  "type": "module",
7
7
  "scripts": {