mvw-search-index 2.2.14 → 2.2.17
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/README.md +4 -4
- package/js/index.d.ts +1 -1
- package/js/index.js +12 -13
- package/js/index.js.map +1 -1
- package/package-lock.json +3330 -2334
- package/package.json +12 -13
package/README.md
CHANGED
|
@@ -80,10 +80,10 @@ You can run `npm run serve` from this repository to run the sample site containe
|
|
|
80
80
|
This contains a very basic static website with a search form on the landing page `index.html`.
|
|
81
81
|
|
|
82
82
|
## Releases
|
|
83
|
-
|
|
84
|
-
- 2.2.10 updates dependencies
|
|
85
|
-
- 2.2.9 gets rid of vinyl and provides a demo application
|
|
86
|
-
- 2.1.4 - 2.1.12: dependency update
|
|
83
|
+
- 2.2.16: updates dependencies
|
|
84
|
+
- 2.2.10: updates dependencies
|
|
85
|
+
- 2.2.9: gets rid of vinyl and provides a demo application
|
|
86
|
+
- 2.1.4: - 2.1.12: dependency update
|
|
87
87
|
- 2.1.3: added support of glob on API
|
|
88
88
|
- 2.1.1: added CLI
|
|
89
89
|
- 2.1.0: renamed `referencedFile` to `href`; allowing to parse HTML files directly
|
package/js/index.d.ts
CHANGED
|
@@ -27,7 +27,7 @@ export declare class SearchIndex {
|
|
|
27
27
|
private constructor();
|
|
28
28
|
static createFromInfo(files: IFileInformation[]): ISearchIndexResult;
|
|
29
29
|
static createFromHtml(files: ReadFileWithContents[], bodySelector?: string): ISearchIndexResult;
|
|
30
|
-
static createFromGlob(
|
|
30
|
+
static createFromGlob(pattern: string, bodySelector: string, cb: (index: ISearchIndexResult) => void): void;
|
|
31
31
|
private getResult;
|
|
32
32
|
}
|
|
33
33
|
export {};
|
package/js/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SearchIndex = void 0;
|
|
4
4
|
var cheerio = require("cheerio");
|
|
5
|
-
var
|
|
5
|
+
var glob_1 = require("glob");
|
|
6
6
|
var fs = require("fs");
|
|
7
7
|
var lunr = require("lunr");
|
|
8
8
|
var SearchIndex = /** @class */ (function () {
|
|
@@ -42,18 +42,17 @@ var SearchIndex = /** @class */ (function () {
|
|
|
42
42
|
});
|
|
43
43
|
return SearchIndex.createFromInfo(infos);
|
|
44
44
|
};
|
|
45
|
-
SearchIndex.createFromGlob = function (
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}
|
|
45
|
+
SearchIndex.createFromGlob = function (pattern, bodySelector, cb) {
|
|
46
|
+
(0, glob_1.glob)(pattern, {
|
|
47
|
+
dotRelative: false
|
|
48
|
+
}).then(function (files) {
|
|
49
|
+
var readFiles = files.map(function (file) { return ({
|
|
50
|
+
relative: file,
|
|
51
|
+
contents: fs.readFileSync(file)
|
|
52
|
+
}); });
|
|
53
|
+
cb(SearchIndex.createFromHtml(readFiles, bodySelector));
|
|
54
|
+
}).catch(function (err) {
|
|
55
|
+
throw err;
|
|
57
56
|
});
|
|
58
57
|
};
|
|
59
58
|
SearchIndex.prototype.getResult = function () {
|
package/js/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../ts/index.ts"],"names":[],"mappings":";;;AAAA,iCAAmC;AACnC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../ts/index.ts"],"names":[],"mappings":";;;AAAA,iCAAmC;AACnC,6BAA0B;AAC1B,uBAAyB;AAEzB,IAAM,IAAI,GAAQ,OAAO,CAAC,MAAM,CAAC,CAAC;AA2BlC;IAIE,qBAAoB,KAAyB;QAA7C,iBAiBC;QAhBC,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;QAChB,IAAM,OAAO,GAAiB,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;QACjD,OAAO,C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