1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-30 10:36:35 +02:00
joplin/packages/lib/utils/ipc/utils/isTransferableObject.ts
2024-08-02 14:51:49 +01:00

13 lines
461 B
TypeScript

import { TransferableObject } from '../types';
const isTransferableObject = (o: unknown): o is TransferableObject => {
if (typeof o !== 'object') return false;
if (typeof FileSystemHandle !== 'undefined' && o instanceof FileSystemHandle) return true;
if (typeof Blob !== 'undefined' && o instanceof Blob) return true;
if (typeof ArrayBuffer !== 'undefined' && o instanceof ArrayBuffer) return true;
return false;
};
export default isTransferableObject;