@acodeninja/persist 3.1.0-next.2 → 3.1.0

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@acodeninja/persist",
3
- "version": "3.1.0-next.2",
3
+ "version": "3.1.0",
4
4
  "description": "A JSON based data modelling and persistence module with alternate storage mechanisms.",
5
5
  "type": "module",
6
6
  "scripts": {
package/src/Connection.js CHANGED
@@ -483,10 +483,10 @@ export default class Connection {
483
483
  * Retrieve a search index to query at your leisure.
484
484
  *
485
485
  * @param {Model.constructor} modelConstructor
486
- * @return {SearchIndex}
486
+ * @return {Promise<SearchIndex>}
487
487
  */
488
- async getSearchIndex(modelConstructor) {
489
- return await this.#storage.getSearchIndex(modelConstructor)
488
+ getSearchIndex(modelConstructor) {
489
+ return this.#storage.getSearchIndex(modelConstructor)
490
490
  .then(index => new SearchIndex(modelConstructor, index));
491
491
  }
492
492
 
@@ -504,13 +504,13 @@ export default class Connection {
504
504
  }
505
505
 
506
506
  /**
507
- * Retrieve a index to query at your leisure.
507
+ * Retrieve an index to query at your leisure.
508
508
  *
509
509
  * @param {Model.constructor} modelConstructor
510
- * @return {FindIndex}
510
+ * @return {Promise<FindIndex>}
511
511
  */
512
- async getIndex(modelConstructor) {
513
- return await this.#storage.getIndex(modelConstructor)
512
+ getIndex(modelConstructor) {
513
+ return this.#storage.getIndex(modelConstructor)
514
514
  .then(index => new FindIndex(modelConstructor, index));
515
515
  }
516
516
 
@@ -13,7 +13,7 @@ export class SearchResult {
13
13
  }
14
14
 
15
15
  /**
16
- * A full-text search index wrapper using Lunr.js for a given model.
16
+ * A full-text search index wrapper using Fuse.js for a given model.
17
17
  * Supports indexing and querying model data.
18
18
  *
19
19
  * @class SearchIndex
@@ -39,7 +39,7 @@ export default class SearchIndex {
39
39
  }
40
40
 
41
41
  /**
42
- * Performs a search query on the compiled Lunr index.
42
+ * Performs a search query on the compiled index.
43
43
  *
44
44
  * @param {string} query - The search string.
45
45
  * @return {Array<SearchResult>} An array of search results with model instances and scores.
@@ -51,18 +51,18 @@ export default class SearchIndex {
51
51
  }
52
52
 
53
53
  /**
54
- * Lazily compiles and returns the Lunr index instance.
54
+ * Lazily compiles and returns the index instance.
55
55
  *
56
- * @return {Fuse} The compiled Lunr index.
56
+ * @return {Fuse} The compiled index.
57
57
  */
58
58
  get searchIndex() {
59
59
  return this.#compiledIndex ?? this.#compileIndex();
60
60
  }
61
61
 
62
62
  /**
63
- * Compiles the Lunr index using the model's search properties.
63
+ * Compiles the index using the model's search properties.
64
64
  *
65
- * @return {Fuse} The compiled Lunr index.
65
+ * @return {Fuse} The compiled index.
66
66
  * @private
67
67
  */
68
68
  #compileIndex() {