(modelURL, model, term, projection, limit, options = {})
| 18 | |
| 19 | class SearchCollection extends Backbone.Collection { |
| 20 | initialize (modelURL, model, term, projection, limit, options = {}) { |
| 21 | this.model = model |
| 22 | this.term = term |
| 23 | this.projection = projection |
| 24 | this.limit = limit |
| 25 | this.url = `${modelURL}?project=` |
| 26 | if (this.projection != null ? this.projection.length : undefined) { |
| 27 | this.url += 'created,permissions' |
| 28 | for (const projected of Array.from(this.projection)) { this.url += ',' + projected } |
| 29 | } else { this.url += 'true' } |
| 30 | if (this.term) { this.url += `&term=${this.term}` } |
| 31 | if (this.limit !== 100) { this.url += `&limit=${this.limit}` } |
| 32 | if (options?.queryParams) { this.url += `&${options.queryParams}` } |
| 33 | } |
| 34 | |
| 35 | comparator (a, b) { |
| 36 | let score = 0 |
nothing calls this directly
no outgoing calls
no test coverage detected