scripture-guide 1.0.53 → 1.0.55

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.
@@ -11,7 +11,7 @@ const findMatches = (content,books,lang_extra) => {
11
11
  const tail = lang_extra.tail ? new RegExp(lang_extra.tail,"ig") : /[^0-9]+$/;
12
12
  const preBookMatch = lang_extra.book || `(First|I|1|1st|Second|II|2|2nd|Third|III|3|3rd|Fourth|IV|4|4th)*\\s*(books* of)*\\s*`;
13
13
  const matchingBooks = findMatchingBooks(content,books);
14
- const postBookMatch = lang_extra.chapter || "([0-9:.;,~ —–]|cf|(?:–))*[0-9]+";
14
+ const postBookMatch = lang_extra.chapter || "([0-9:.;,~ —–-]|cf|(?:–))*[0-9]+";
15
15
  const fullBookMatches = matchingBooks.map(bookMatch=>{
16
16
  const patternString = preBookMatch + bookMatch ;
17
17
  const pattern = (new RegExp(patternString,"ig"));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "scripture-guide",
3
- "version": "1.0.53",
3
+ "version": "1.0.55",
4
4
  "description": "A utility for biblical and scripture reference parsing that enables structured queries based on strings of traditional scripture references (e.g. John 3:16). ",
5
5
  "main": "scriptures-compiled.js",
6
6
  "scripts": {
@@ -242,12 +242,12 @@ var handleSingleChapterBookRefs = function handleSingleChapterBookRefs(ref) {
242
242
  var singleChapterBooks = Object.keys(raw_index).filter(function (book) {
243
243
  return loadMaxChapter(book) == 1;
244
244
  });
245
- var matchingBooks = singleChapterBooks.filter(function (book) {
246
- return ref.match(new RegExp("^".concat(book, " \\d+")));
247
- });
248
- ref = matchingBooks.reduce(function (ref, book) {
249
- return ref.replace(new RegExp("^".concat(book, " (\\d+)")), "".concat(book, " 1:$1"));
250
- }, ref);
245
+ var _singleChapterBooks$f = singleChapterBooks.filter(function (book) {
246
+ return ref.match(new RegExp("^".concat(book, " \\d+")));
247
+ }),
248
+ _singleChapterBooks$f2 = _slicedToArray(_singleChapterBooks$f, 1),
249
+ matchingBook = _singleChapterBooks$f2[0];
250
+ ref = ref.replace(new RegExp("^".concat(matchingBook, " ([^:]+)$")), "".concat(matchingBook, " 1:$1"));
251
251
  return ref;
252
252
  };
253
253
  var splitReferences = function splitReferences(compoundReference) {
@@ -566,6 +566,7 @@ module.exports = {
566
566
  generate: generateReference,
567
567
  verseId2Ref: generateReference,
568
568
  detect: detectReferences,
569
+ detectScriptureReferences: detectReferences,
569
570
  detectRefs: detectReferences,
570
571
  detectScriptures: detectReferences,
571
572
  linkRefs: detectReferences
package/test/data/en.txt CHANGED
@@ -1,2 +1 @@
1
- see 1 Nephi 13:12 and 1 Nephi 13
2
- * separately under 2 Nephi 2:10–11 in part 1
1
+ Peter testified that Christ was the “lamb without blemish and without spot, who verily was foreordained before the foundation of the world” (1 Peter 1:19-20). In the words of John the Revelator, Christ was the “Lamb slain from the foundation of the world” (Revelation 13:8). Such expressions affirm that the plan of salvation was known and taught even before the creation of the earth (see D&C 132:8-11).