Fix tslint issues in v0/lunr-tests.ts

This commit is contained in:
Sean Tan
2017-09-13 10:02:13 +08:00
parent 22cf61b868
commit e8d48ef03d
+6 -9
View File
@@ -1,10 +1,8 @@
/**
* Basic test, from http://lunrjs.com/
*/
function basic_test() {
var index = lunr(function () {
const index = lunr(function() {
this.field('title', {boost: 10});
this.field('body');
this.ref('id');
@@ -25,20 +23,19 @@ function basic_test() {
index.search('foo');
}
/**
* Pipeline test, from http://lunrjs.com/
*/
function pipeline_test() {
var index = lunr(function () {
this.pipeline.add(function (token:string, tokenIndex:number, tokens:string[]):string {
const index = lunr(function() {
this.pipeline.add(function(token: string, tokenIndex: number, tokens: string[]): string {
// text processing in here
return token;
});
this.pipeline.after(lunr.stopWordFilter, function (token:string, tokenIndex:number, tokens:string[]):string {
this.pipeline.after(lunr.stopWordFilter, function(token: string, tokenIndex: number, tokens: string[]): string {
// text processing in here
return token;
});
})
}
});
}