File tree Expand file tree Collapse file tree 3 files changed +9
-4
lines changed
Expand file tree Collapse file tree 3 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -61,6 +61,9 @@ module.exports = function (config) {
6161 test : / \. t s $ /
6262 }
6363 ]
64+ } ,
65+ externals : {
66+ fs : "fs"
6467 }
6568 } ,
6669 webpackMiddleware : {
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ export class InvertedIndex {
3232 public docCount : number = 0 ;
3333 public docStore : Map < InvertedIndex . DocumentIndex , InvertedIndex . DocStore > = new Map ( ) ;
3434 public totalFieldLength : number = 0 ;
35- public root : InvertedIndex . Index = new Map ( ) ;
35+ public root : InvertedIndex . Index = new Map ( ) as InvertedIndex . Index ;
3636
3737 private _store : boolean ;
3838 private _optimizeChanges : boolean ;
@@ -286,7 +286,7 @@ export class InvertedIndex {
286286 }
287287
288288 private static _deserializeIndex ( serialized : Serialization . FullTextSearch . Index ) : InvertedIndex . Index {
289- const idx : InvertedIndex . Index = new Map ( ) ;
289+ const idx : InvertedIndex . Index = new Map ( ) as InvertedIndex . Index ;
290290
291291 if ( serialized . k !== undefined ) {
292292 for ( let i = 0 ; i < serialized . k . length ; i ++ ) {
Original file line number Diff line number Diff line change @@ -222,12 +222,14 @@ export namespace V2_0 {
222222 }
223223
224224 export namespace FullTextSearch {
225+ export type DocumentIndex = number | string ;
226+
225227 export type InvertedIndex = SpareSerialized | FullSerialized ;
226228
227229 export interface Index {
228230 d ?: {
229231 df : number ;
230- dc : [ number , number ] [ ]
232+ dc : [ DocumentIndex , number ] [ ]
231233 } ;
232234 k ?: number [ ] ;
233235 v ?: Index [ ] ;
@@ -242,7 +244,7 @@ export namespace V2_0 {
242244 store : true ;
243245 optimizeChanges : boolean ;
244246 docCount : number ;
245- docStore : [ number , DocStore ] [ ] ;
247+ docStore : [ DocumentIndex , DocStore ] [ ] ;
246248 totalFieldLength : number ;
247249 root : Index ;
248250 } ;
You can’t perform that action at this time.
0 commit comments