MCPcopy Create free account
hub / github.com/WJX20/claude-code / hasClipboardImage

Function hasClipboardImage

packages/image-processor-napi/src/index.ts:21–37  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

19function createDarwinNativeModule(): NativeModule {
20 return {
21 hasClipboardImage(): boolean {
22 try {
23 const result = Bun.spawnSync({
24 cmd: [
25 'osascript',
26 '-e',
27 'try\nthe clipboard as «class PNGf»\nreturn "yes"\non error\nreturn "no"\nend try',
28 ],
29 stdout: 'pipe',
30 stderr: 'pipe',
31 })
32 const output = result.stdout.toString().trim()
33 return output === 'yes'
34 } catch {
35 return false
36 }
37 },
38
39 readClipboardImage(
40 maxWidth?: number,

Callers

nothing calls this directly

Calls 1

toStringMethod · 0.65

Tested by

no test coverage detected