(key: string, value: V)
| 50 | interface IndexedList<V>{[v: string]: V[]} |
| 51 | export class IndexList<V> extends Index<IndexedList<V>> { |
| 52 | insert(key: string, value: V) { |
| 53 | if(!this.index[key] || this.index[key].indexOf(value) === -1) { |
| 54 | if(!this.index[key]) this.index[key] = []; |
| 55 | if(!this.dirty[key]) this.dirty[key] = []; |
| 56 | this.index[key].push(value); |
| 57 | this.dirty[key].push(value); |
| 58 | return true; |
| 59 | } |
| 60 | return false; |
| 61 | } |
| 62 | |
| 63 | remove(key: string, value: V) { |
| 64 | if(!this.index[key]) return false; |
no outgoing calls
no test coverage detected