MCPcopy
hub / github.com/bytenode/bytenode / isBufferV8Bytecode

Function isBufferV8Bytecode

lib/index.js:117–126  ·  view source on GitHub ↗
(buffer)

Source from the content-addressed store, hash-verified

115}
116
117function isBufferV8Bytecode (buffer) {
118 return (
119 isBuffer(buffer) &&
120 !buffer.subarray(0, 2).equals(ZERO_LENGTH_EXTERNAL_REFERENCE_TABLE) &&
121 buffer.subarray(2, 4).equals(MAGIC_NUMBER)
122 );
123
124 // TODO: check that code start + payload size = buffer length. See
125 // https://github.com/bytenode/bytenode/issues/210#issuecomment-1605691369
126}
127
128/**
129 * Generates v8 bytecode buffer.

Callers 1

generateScriptFunction · 0.85

Calls 1

isBufferFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…