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