MCPcopy Create free account
hub / github.com/mapbox/pbf / readString

Method readString

index.js:115–126  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

113 }
114
115 readString() {
116 const end = this.readVarint() + this.pos;
117 const pos = this.pos;
118 this.pos = end;
119
120 if (end - pos >= TEXT_DECODER_MIN_LENGTH && utf8TextDecoder) {
121 // longer strings are fast with the built-in browser TextDecoder API
122 return utf8TextDecoder.decode(this.buf.subarray(pos, end));
123 }
124 // short strings are fast with our custom implementation
125 return readUtf8(this.buf, pos, end);
126 }
127
128 readBytes() {
129 const end = this.readVarint() + this.pos,

Callers 14

pbf.test.jsFile · 0.80
readLayerFunction · 0.80
readEnvelopeFunction · 0.80
readEnvelopeFunction · 0.80
readEnvelopeFunction · 0.80
readEmbeddedTypeFunction · 0.80
readEnvelopeKvEntryFunction · 0.80
readEnvelopeKnEntryFunction · 0.80
readEnvelopeKvEntry$Function · 0.80
readEnvelopeKnEntry$Function · 0.80
readEnvelopeFunction · 0.80

Calls 2

readVarintMethod · 0.95
readUtf8Function · 0.85

Tested by 1

readLayerFunction · 0.64