MCPcopy Create free account
hub / github.com/denoland/std / encodeString

Function encodeString

cbor/_common_encode.ts:190–202  ·  view source on GitHub ↗
(
  input: string,
  output: Uint8Array,
  offset: number,
)

Source from the content-addressed store, hash-verified

188}
189
190function encodeString(
191 input: string,
192 output: Uint8Array,
193 offset: number,
194): number {
195 const length = new TextEncoder()
196 .encodeInto(input, output.subarray(offset)).written;
197 output.set(
198 output.subarray(offset, offset + length),
199 offset + calcHeaderSize(length),
200 );
201 return encodeHeader(0b011_00000, length, output, offset) + length;
202}
203
204function encodeArray(
205 input: CborType[],

Callers 3

encodeFunction · 0.85
encodeObjectFunction · 0.85
passStringToWasm0Function · 0.85

Calls 3

calcHeaderSizeFunction · 0.85
encodeHeaderFunction · 0.85
setMethod · 0.65

Tested by

no test coverage detected