(keyFpr, type)
| 40 | } |
| 41 | |
| 42 | async add(keyFpr, type) { |
| 43 | await this.initialized; |
| 44 | if (!this.data || this.muted) { |
| 45 | return; |
| 46 | } |
| 47 | if (!(type === INSERT || type === DELETE || type === UPDATE)) { |
| 48 | throw new Error('Unknown log entry type'); |
| 49 | } |
| 50 | this.data.modified = true; |
| 51 | if (type === UPDATE) { |
| 52 | return; |
| 53 | } |
| 54 | this.data.changeLog[keyFpr] = { |
| 55 | type, |
| 56 | time: Math.floor(Date.now() / 1000) |
| 57 | }; |
| 58 | } |
| 59 | |
| 60 | async save() { |
| 61 | await this.initialized; |
no outgoing calls
no test coverage detected