node-sword-interface 1.0.4 → 1.0.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.
package/API.md CHANGED
@@ -35,7 +35,7 @@ This is the main class of node-sword-interface and it provides a set of static f
35
35
  * [.updateRepositoryConfig(progressCB)](#NodeSwordInterface+updateRepositoryConfig) ⇒ <code>Promise</code>
36
36
  * [.getRepoNames()](#NodeSwordInterface+getRepoNames) ⇒ <code>Array.&lt;String&gt;</code>
37
37
  * [.getRepoLanguages(repositoryName, moduleType)](#NodeSwordInterface+getRepoLanguages) ⇒ <code>Array.&lt;String&gt;</code>
38
- * [.getAllRepoModules(repositoryName, moduleType)](#NodeSwordInterface+getAllRepoModules) ⇒ <code>Array.&lt;String&gt;</code>
38
+ * [.getAllRepoModules(repositoryName, moduleType)](#NodeSwordInterface+getAllRepoModules) ⇒ [<code>Array.&lt;ModuleObject&gt;</code>](#ModuleObject)
39
39
  * [.getRepoModulesByLang(repositoryName, language, moduleType, headersFilter, strongsFilter, hebrewStrongsKeys, greekStrongsKeys)](#NodeSwordInterface+getRepoModulesByLang) ⇒ [<code>Array.&lt;ModuleObject&gt;</code>](#ModuleObject)
40
40
  * [.getUpdatedRepoModules(repositoryName, includeBeta)](#NodeSwordInterface+getUpdatedRepoModules) ⇒ [<code>Array.&lt;ModuleObject&gt;</code>](#ModuleObject)
41
41
  * [.getRepoModule(moduleCode)](#NodeSwordInterface+getRepoModule) ⇒ [<code>ModuleObject</code>](#ModuleObject)
@@ -125,11 +125,11 @@ Note that the languages are returned as language codes.
125
125
 
126
126
  <a name="NodeSwordInterface+getAllRepoModules"></a>
127
127
 
128
- ### nodeSwordInterface.getAllRepoModules(repositoryName, moduleType) ⇒ <code>Array.&lt;String&gt;</code>
128
+ ### nodeSwordInterface.getAllRepoModules(repositoryName, moduleType) ⇒ [<code>Array.&lt;ModuleObject&gt;</code>](#ModuleObject)
129
129
  Returns all modules for the given repository (default: Bible modules).
130
130
 
131
131
  **Kind**: instance method of [<code>NodeSwordInterface</code>](#NodeSwordInterface)
132
- **Returns**: <code>Array.&lt;String&gt;</code> - An array of strings with the module codes for the Bible modules of the given repository.
132
+ **Returns**: [<code>Array.&lt;ModuleObject&gt;</code>](#ModuleObject) - An array of strings with the module codes for the Bible modules of the given repository.
133
133
 
134
134
  | Param | Type | Default | Description |
135
135
  | --- | --- | --- | --- |
package/index.js CHANGED
@@ -148,7 +148,7 @@ class NodeSwordInterface {
148
148
  *
149
149
  * @param {String} repositoryName - The name of the given repository.
150
150
  * @param {String} moduleType - A filter parameter that defines the moduleType (Options: BIBLE, DICT)
151
- * @return {String[]} An array of strings with the module codes for the Bible modules of the given repository.
151
+ * @return {ModuleObject[]} An array of strings with the module codes for the Bible modules of the given repository.
152
152
  */
153
153
  getAllRepoModules(repositoryName, moduleType="BIBLE") {
154
154
  return this.nativeInterface.getAllRepoModules(repositoryName, moduleType);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-sword-interface",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "description": "Javascript (N-API) interface to SWORD library",
5
5
  "keywords": [
6
6
  "C++",
@@ -16,11 +16,13 @@
16
16
  "clean": "node-gyp clean",
17
17
  "doc": "jsdoc2md index.js > API.md",
18
18
  "pub": "rm -rf build node_modules sword sword_build test && npm publish ./",
19
- "deploy": "scripts/deploy_local.sh"
19
+ "deploy": "scripts/deploy_local.sh",
20
+ "postinstall": "node scripts/postinstall.js"
20
21
  },
21
22
  "author": "Tobias Klein",
22
23
  "license": "GPL-2.0+",
23
24
  "dependencies": {
25
+ "glob": "^8.0.3",
24
26
  "node-addon-api": "^4.2.0"
25
27
  },
26
28
  "repository": {
@@ -0,0 +1,37 @@
1
+ /* This file is part of node-sword-interface.
2
+
3
+ Copyright (C) 2019 - 2022 Tobias Klein <contact@tklein.info>
4
+
5
+ node-sword-interface is free software: you can redistribute it and/or modify
6
+ it under the terms of the GNU General Public License as published by
7
+ the Free Software Foundation, either version 2 of the License, or
8
+ (at your option) any later version.
9
+
10
+ node-sword-interface is distributed in the hope that it will be useful,
11
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13
+ See the GNU General Public License for more details.
14
+
15
+ You should have received a copy of the GNU General Public License
16
+ along with node-sword-interface. See the file COPYING.
17
+ If not, see <http://www.gnu.org/licenses/>. */
18
+
19
+ const glob = require('glob');
20
+ const path = require('path');
21
+ const fs = require('fs');
22
+
23
+ function postInstall() {
24
+ if (process.platform.indexOf("win") != -1) {
25
+ console.log("Copying build dependencies to build output folder.");
26
+
27
+ glob('build/sword-build-win32/lib/*.*', null, function (er, files) {
28
+ files.forEach((srcPath) => {
29
+ let fileName = path.basename(srcPath);
30
+ let destPath = path.join('build/Release', fileName);
31
+ fs.copyFileSync(srcPath, destPath);
32
+ });
33
+ });
34
+ }
35
+ }
36
+
37
+ postInstall();
@@ -88,8 +88,8 @@ void get_repo_module(RepositoryInterface& repoInterface)
88
88
 
89
89
  void get_updated_repo_modules(RepositoryInterface& repoInterface)
90
90
  {
91
- //ModuleStore moduleStore;
92
- //ModuleHelper moduleHelper(moduleStore);
91
+ ModuleStore moduleStore;
92
+ ModuleHelper moduleHelper(moduleStore);
93
93
 
94
94
  vector<SWModule*> updatedModules = repoInterface.getUpdatedRepoModules();
95
95
 
@@ -131,6 +131,8 @@ vector<Verse> ModuleSearch::getModuleSearchResults(string moduleName,
131
131
  }
132
132
 
133
133
  bool hasStrongs = this->_moduleHelper.moduleHasGlobalOption(module, "Strongs");
134
+ bool moduleMarkupIsBroken = this->_moduleHelper.isBrokenMarkupModule(moduleName);
135
+ bool hasInconsistentClosingEndDivs = this->_moduleHelper.isInconsistentClosingEndDivModule(moduleName);
134
136
 
135
137
  if (searchType == SearchType::strongsNumber) {
136
138
  if (!hasStrongs) {
@@ -163,7 +165,11 @@ vector<Verse> ModuleSearch::getModuleSearchResults(string moduleName,
163
165
  while (!listKey.popError()) {
164
166
  module->setKey(listKey.getElement());
165
167
 
166
- string verseText = this->_textProcessor.getCurrentVerseText(module, hasStrongs);
168
+ string verseText = this->_textProcessor.getCurrentVerseText(module,
169
+ hasStrongs,
170
+ hasInconsistentClosingEndDivs,
171
+ moduleMarkupIsBroken);
172
+
167
173
  string currentReference = module->getKey()->getShortText();
168
174
 
169
175
  if (std::find(searchResultReferences.begin(),