Skip to content

NodeBuffer

NodeBuffer = typeof globalThis extends object ? B : Uint8Array

What serialize() returns: a Node.js Buffer when the Node.js types (@types/node) are loaded, and a Uint8Array (which a Buffer is) otherwise, so that these declarations compile without them.