scripture-guide 1.0.65 → 1.0.68
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/package.json +8 -9
- package/scriptures-compiled.cjs +15 -15
- package/scriptures.js +617 -0
- package/scriptures-compiled.d.ts +0 -1
- package/scriptures-esm.js +0 -636
package/package.json
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "scripture-guide",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.68",
|
|
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.cjs",
|
|
6
|
-
"
|
|
7
|
-
"types": "scriptures-compiled.d.ts",
|
|
6
|
+
"types": "scriptures.d.ts",
|
|
8
7
|
"type": "module",
|
|
9
8
|
"exports": {
|
|
10
9
|
".": {
|
|
10
|
+
"import": "./scriptures.js",
|
|
11
11
|
"require": "./scriptures-compiled.cjs",
|
|
12
|
-
"
|
|
13
|
-
"types": "./scriptures-compiled.d.ts"
|
|
12
|
+
"types": "./scriptures.d.ts"
|
|
14
13
|
}
|
|
15
14
|
},
|
|
16
15
|
"scripts": {
|
|
17
16
|
"start": "node test.js",
|
|
18
17
|
"test": "node test.js",
|
|
19
|
-
"build": "babel scriptures.js --out-file scriptures-compiled.cjs
|
|
18
|
+
"build": "babel scriptures.js --out-file scriptures-compiled.cjs",
|
|
19
|
+
"prepublishOnly": "npm run build && npm version patch"
|
|
20
20
|
},
|
|
21
21
|
"author": "",
|
|
22
22
|
"license": "ISC",
|
|
@@ -42,10 +42,9 @@
|
|
|
42
42
|
"pearl of great price"
|
|
43
43
|
],
|
|
44
44
|
"files": [
|
|
45
|
-
"scriptures
|
|
46
|
-
"scriptures-esm.js",
|
|
47
|
-
"scriptures-compiled.d.ts",
|
|
45
|
+
"scriptures.js",
|
|
48
46
|
"scriptures.d.ts",
|
|
47
|
+
"scriptures-compiled.cjs",
|
|
49
48
|
"data/"
|
|
50
49
|
],
|
|
51
50
|
"devDependencies": {
|
package/scriptures-compiled.cjs
CHANGED
|
@@ -9,23 +9,23 @@ var _scriptdata = _interopRequireDefault(require("./data/scriptdata.js"));
|
|
|
9
9
|
var _scriptregex = _interopRequireDefault(require("./data/scriptregex.js"));
|
|
10
10
|
var _scriptlang = _interopRequireDefault(require("./data/scriptlang.js"));
|
|
11
11
|
var _scriptdetect = require("./data/scriptdetect.js");
|
|
12
|
-
function _interopRequireDefault(
|
|
12
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
13
13
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
14
14
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
15
|
-
function _defineProperty(
|
|
16
|
-
function _toPropertyKey(
|
|
17
|
-
function _toPrimitive(
|
|
18
|
-
function _createForOfIteratorHelper(
|
|
19
|
-
function _toConsumableArray(
|
|
15
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
16
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
17
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
18
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
19
|
+
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
20
20
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
21
|
-
function _iterableToArray(
|
|
22
|
-
function _arrayWithoutHoles(
|
|
23
|
-
function _slicedToArray(
|
|
21
|
+
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
22
|
+
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
23
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
24
24
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
25
|
-
function _unsupportedIterableToArray(
|
|
26
|
-
function _arrayLikeToArray(
|
|
25
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
26
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
27
27
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
28
|
-
function _arrayWithHoles(
|
|
28
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
29
29
|
// Browser localStorage key for language preference
|
|
30
30
|
var LANGUAGE_STORAGE_KEY = 'scriptureGuideUtils_language';
|
|
31
31
|
|
|
@@ -64,7 +64,7 @@ var getEffectiveLanguage = function getEffectiveLanguage(explicitLanguage) {
|
|
|
64
64
|
// Priority: explicit parameter > stored language > default language > 'en'
|
|
65
65
|
return explicitLanguage || getStoredLanguage() || defaultLanguage || 'en';
|
|
66
66
|
};
|
|
67
|
-
var
|
|
67
|
+
var _lookupReference = exports.ref2VerseId = exports.read = exports.parse = exports.lookup = exports.lookupReference = function lookupReference(query) {
|
|
68
68
|
var _verse_ids;
|
|
69
69
|
var language = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
70
70
|
var isValidReference = query && typeof query === 'string' && query.length > 0;
|
|
@@ -91,7 +91,7 @@ var lookupReference = exports.ref2VerseId = exports.read = exports.parse = expor
|
|
|
91
91
|
|
|
92
92
|
// Fallback to English if no results found and language was specified
|
|
93
93
|
if (!((_verse_ids = verse_ids) !== null && _verse_ids !== void 0 && _verse_ids.length) && effectiveLanguage && effectiveLanguage !== 'en') {
|
|
94
|
-
var results =
|
|
94
|
+
var results = _lookupReference(query, 'en');
|
|
95
95
|
return results;
|
|
96
96
|
}
|
|
97
97
|
return {
|
|
@@ -567,7 +567,7 @@ var detectReferences = exports.linkRefs = exports.detectScriptures = exports.det
|
|
|
567
567
|
})));
|
|
568
568
|
var books = [].concat(_toConsumableArray(dst), _toConsumableArray(src));
|
|
569
569
|
return (0, _scriptdetect.processReferenceDetection)(content, books, config.lang_extra, function (query) {
|
|
570
|
-
return
|
|
570
|
+
return _lookupReference(query, effectiveLanguage);
|
|
571
571
|
}, callBack);
|
|
572
572
|
};
|
|
573
573
|
var getLanguageConfig = function getLanguageConfig(language) {
|