(key: string, content: string)
| 12 | } |
| 13 | |
| 14 | public set(key: string, content: string): boolean { |
| 15 | if (this.map.has(key) && this.map.get(key).content === content) |
| 16 | return false; |
| 17 | |
| 18 | this.map.set(key, {content, updateTime: Date.now()}); |
| 19 | this.clean(); |
| 20 | |
| 21 | return true; |
| 22 | } |
| 23 | |
| 24 | public delete(key: string) { |
| 25 | this.map.delete(key); |