codexparser 0.0.62 → 0.0.63

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/.babelrc CHANGED
@@ -1,7 +1,5 @@
1
1
  {
2
2
  "presets": [
3
- "@babel/preset-env",
4
- "@babel/preset-react"
5
- ],
6
- "plugins": []
3
+ "@babel/preset-env"
4
+ ]
7
5
  }
package/package.json CHANGED
@@ -1,19 +1,19 @@
1
1
  {
2
2
  "name": "codexparser",
3
- "version": "0.0.62",
3
+ "version": "0.0.63",
4
4
  "description": "This is a Javascript Bible parser and text scanner. It will search through texts and collate all scripture references into an array and parse them into objects, and it will parse passages into objects by book, chapter, verse, and testament. ",
5
5
  "main": "index.js",
6
6
  "scripts": {
7
7
  "test": "echo \"Error: no test specified\" && exit 1",
8
8
  "webpack": "webpack --mode=production",
9
- "build": "browserify src/CodexParser.js -t | uglifyjs > dist/CodexParser.js"
9
+ "build": "browserify ./src/CodexParser.js -o ./dist/bundle.js"
10
10
  },
11
11
  "author": "Jeremy Menicucci",
12
12
  "license": "ISC",
13
13
  "devDependencies": {
14
14
  "@babel/cli": "^7.23.9",
15
- "@babel/core": "^7.24.0",
16
- "@babel/preset-env": "^7.24.0",
15
+ "@babel/core": "^7.24.9",
16
+ "@babel/preset-env": "^7.24.8",
17
17
  "@babel/preset-react": "^7.23.3",
18
18
  "axios": "^1.7.2",
19
19
  "babel-loader": "^9.1.3",
@@ -21,6 +21,7 @@
21
21
  "fs": "^0.0.1-security",
22
22
  "glob": "^10.4.1",
23
23
  "path": "^0.12.7",
24
+ "terser-webpack-plugin": "^5.3.10",
24
25
  "uglify-es": "^3.3.9",
25
26
  "uglifyify": "^5.0.0",
26
27
  "webpack": "^5.90.3",
package/regex-tester.js CHANGED
@@ -20,7 +20,7 @@ Leviticus 16:6 He 5.3 He 7.27
20
20
 
21
21
  Hos 10:1-3, 8 and 1 John 2:23
22
22
 
23
- exod15.18. 2 Cor 12:23 Malachi 3:32 Hebrews 9:20; 10:29; 13:20 2 Kings 4:8,17-37`
23
+ exod15.18. 2 Cor 12:23 Malachi 3:32 Hebrews 9:20; 10:29; 13:20 2 Kings 4:8,17-37 Psalm 113-118`
24
24
 
25
25
  const philemon = "Phlm 1 Phlm 1:2 Philemon 1:3 Phil 2:3 Phile 7"
26
26
 
@@ -1,7 +1,7 @@
1
1
  const bible = require("./bible")
2
2
  const { bookRegex, chapterRegex, verseRegex, scripturesRegex } = require("./regex")
3
3
  const abbrevations = require("./abbr")
4
- const toc = require("./toc")
4
+ //const toc = require("./toc")
5
5
  const crawler = require("bible-passage-reference-parser/js/en_bcv_parser").bcv_parser
6
6
  const util = require("util")
7
7
 
@@ -19,7 +19,7 @@ class CodexParser {
19
19
  this.verseRegex = verseRegex
20
20
  this.scripturesRegex = scripturesRegex
21
21
  this.abbrevations = abbrevations
22
- this.toc = toc
22
+ //this.toc = toc
23
23
  this.crawler = new crawler()
24
24
  }
25
25
 
@@ -281,6 +281,7 @@ class CodexParser {
281
281
  for (let i = 0; i < this.found.length; i++) {
282
282
  let verse, chapter
283
283
  const hasChapterRange = this.found[i].match(/(?<=-\s?)\b\d+[.:].+\b/)
284
+ console.log(hasChapterRange)
284
285
  const book = this.found[i].match(this.bookRegex)
285
286
  if (book === null) continue
286
287
  chapter = this.found[i].replace(book[0], "").match(this.chapterRegex)
package/src/abbr.js CHANGED
@@ -204,6 +204,7 @@ const abbrevations = {
204
204
  Eph: "Ephesians",
205
205
  Ephes: "Ephesians",
206
206
  Php: "Philippians",
207
+ Phil: "Philippians",
207
208
  Pp: "Philippians",
208
209
  Col: "Colossians",
209
210
  Co: "Colossians",
package/src/toc.js CHANGED
@@ -1,3 +1,2 @@
1
- const fs = require("fs")
2
1
  const bible = JSON.parse(fs.readFileSync(__dirname + "/../bibles/updated_kjv.json", "utf8"))
3
2
  module.exports.bible = bible
@@ -8,5 +8,5 @@ const string = "Malachi 3:32"
8
8
  const parser = new BibleParser()
9
9
  parser.options({ invalid_passage_strategy: "include", invalid_sequence_strategy: "include" })
10
10
  console.log(parser)
11
- const result = parser.parse(string)
11
+ const result = parser.parse("Psalms 113-118")
12
12
  dump(result.getPassages())
package/webpack.config.js CHANGED
@@ -1,9 +1,15 @@
1
1
  const path = require("path")
2
+ const TerserPlugin = require("terser-webpack-plugin")
2
3
 
3
4
  module.exports = {
5
+ mode: "production",
4
6
  entry: {
5
7
  main: "./src/CodexParser.js",
6
8
  },
9
+ optimization: {
10
+ minimize: true,
11
+ minimizer: [new TerserPlugin()],
12
+ },
7
13
  output: {
8
14
  filename: "CodexParser.js",
9
15
  path: path.resolve(__dirname, "dist"),
@@ -14,6 +20,7 @@ module.exports = {
14
20
  },
15
21
  globalObject: "typeof self !== 'undefined' ? self : this",
16
22
  },
23
+ target: "web",
17
24
  module: {
18
25
  rules: [
19
26
  {
@@ -21,6 +28,9 @@ module.exports = {
21
28
  exclude: /node_modules/,
22
29
  use: {
23
30
  loader: "babel-loader",
31
+ options: {
32
+ presets: ["@babel/preset-env"],
33
+ },
24
34
  },
25
35
  },
26
36
  ],