mirror of https://github.com/pelias/api.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
442 B
28 lines
442 B
7 years ago
|
'use strict';
|
||
|
|
||
|
module.exports = class MockQuery {
|
||
|
constructor() {
|
||
|
this._score_functions = [];
|
||
|
this._filter_functions = [];
|
||
|
}
|
||
|
|
||
|
render(vs) {
|
||
|
return {
|
||
|
vs: vs,
|
||
|
score_functions: this._score_functions,
|
||
|
filter_functions: this._filter_functions
|
||
|
};
|
||
|
}
|
||
|
|
||
|
score(view) {
|
||
|
this._score_functions.push(view);
|
||
|
return this;
|
||
|
}
|
||
|
|
||
|
filter(view) {
|
||
|
this._filter_functions.push(view);
|
||
|
return this;
|
||
|
}
|
||
|
|
||
|
};
|