MCPcopy Create free account
hub / github.com/ZenNotes/zennotes / pastedImageBuffer

Function pastedImageBuffer

apps/desktop/src/main/vault.ts:2974–2980  ·  view source on GitHub ↗
(data: PastedImageInput['data'])

Source from the content-addressed store, hash-verified

2972}
2973
2974function pastedImageBuffer(data: PastedImageInput['data']): Buffer {
2975 if (data instanceof ArrayBuffer) return Buffer.from(data)
2976 if (ArrayBuffer.isView(data)) {
2977 return Buffer.from(data.buffer, data.byteOffset, data.byteLength)
2978 }
2979 throw new Error('Clipboard image data is invalid.')
2980}
2981
2982/**
2983 * Make a title safe to use as a filename on macOS, Windows, and Linux:

Callers 1

importPastedImageFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected