()
| 9773 | this.init(); |
| 9774 | } |
| 9775 | init() { |
| 9776 | let stream = null; |
| 9777 | if (this.has_record('.data/version')) { |
| 9778 | stream = this.get_record('.data/version'); |
| 9779 | } else if (this.has_record('version')) { |
| 9780 | stream = this.get_record('version'); |
| 9781 | } |
| 9782 | if (stream) { |
| 9783 | const decoder = new TextDecoder('utf-8'); |
| 9784 | const buffer = stream.peek(); |
| 9785 | const text = decoder.decode(buffer); |
| 9786 | this._version = Number(text.split('\n').shift().trim()); |
| 9787 | } |
| 9788 | } |
| 9789 | has_record(name) { |
| 9790 | return this._records.has(name); |
| 9791 | } |
no test coverage detected