MCPcopy
hub / github.com/lutzroeder/netron / init

Method init

source/python.js:9775–9788  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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 }

Callers 1

constructorMethod · 0.45

Calls 5

has_recordMethod · 0.80
get_recordMethod · 0.80
splitMethod · 0.80
peekMethod · 0.45
decodeMethod · 0.45

Tested by

no test coverage detected