MCPcopy Create free account
hub / github.com/hashintel/hash / from

Function from

libs/@local/harpc/client/typescript/src/binary/MutableBytes.ts:76–90  ·  view source on GitHub ↗
(
  buffer: ArrayBuffer,
  options?: FromOptions,
)

Source from the content-addressed store, hash-verified

74}
75
76export const from = (
77 buffer: ArrayBuffer,
78 options?: FromOptions,
79): MutableBytes =>
80 createProto(
81 MutableBytesProto,
82 {
83 initialCapacity: buffer.byteLength,
84 growthStrategy: options?.growthStrategy ?? "doubling",
85 },
86 {
87 length: buffer.byteLength,
88 inner: buffer,
89 },
90 ) satisfies MutableBytesImpl as MutableBytes;
91
92export const capacity = (self: MutableBytes) =>
93 (self as MutableBytesImpl).inner.byteLength;

Callers 15

insertFunction · 0.50
initial_personFunction · 0.50
create_multiFunction · 0.50
summary_aggregationsFunction · 0.50
initial_draftFunction · 0.50
no_initial_draftFunction · 0.50
multiple_draftsFunction · 0.50
insertFunction · 0.50
queryFunction · 0.50
updateFunction · 0.50
properties_addFunction · 0.50

Calls 1

createProtoFunction · 0.85

Tested by 15

provideMethod · 0.40
messagesFunction · 0.40
io_errorFunction · 0.40
error_with_sourcesFunction · 0.40
context_provisionFunction · 0.40
decode_incomplete_dataFunction · 0.40
decode_malformed_jsonFunction · 0.40
partial_decodeFunction · 0.40
large_payloadFunction · 0.40