Files
joplin/packages/lib/models/Search.ts
T

23 lines
662 B
TypeScript
Raw Normal View History

2021-01-22 17:41:11 +00:00
// This class doesn't appear to be used at all
import BaseModel from '../BaseModel';
export default class Search extends BaseModel {
public static tableName(): string {
2021-01-22 17:41:11 +00:00
throw new Error('Not using database');
}
public static modelType() {
2021-01-22 17:41:11 +00:00
return BaseModel.TYPE_SEARCH;
}
public static keywords(query: string) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
2021-01-22 17:41:11 +00:00
let output: any = query.trim();
output = output.split(/[\s\t\n]+/);
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
2021-01-22 17:41:11 +00:00
output = output.filter((o: any) => !!o);
return output;
}
}