MCPcopy Create free account
hub / github.com/abue-ammar/tinycast / write

Method write

Scripts/raycast-runtime/src/buffer.js:193–202  ·  view source on GitHub ↗
(text, offset = 0, length, encoding)

Source from the content-addressed store, hash-verified

191 }
192
193 write(text, offset = 0, length, encoding) {
194 if (typeof length === "string") {
195 encoding = length;
196 length = undefined;
197 }
198 const bytes = encode(text, encoding);
199 const count = Math.min(length ?? bytes.length, this.length - offset);
200 this.set(bytes.subarray(0, count), offset);
201 return count;
202 }
203
204 slice(start, end) {
205 return wrap(this.subarray(start, end));

Callers

nothing calls this directly

Calls 3

encodeFunction · 0.70
setMethod · 0.65
subarrayMethod · 0.45

Tested by

no test coverage detected