MCPcopy Create free account
hub / github.com/GetStream/stream-js / isBuffer

Function isBuffer

src/utils.ts:42–51  ·  view source on GitHub ↗
(obj: unknown)

Source from the content-addressed store, hash-verified

40}
41
42function isBuffer(obj: unknown): obj is Buffer {
43 return (
44 obj != null &&
45 (obj as Buffer).constructor != null &&
46 // @ts-expect-error
47 typeof obj.constructor.isBuffer === 'function' &&
48 // @ts-expect-error
49 obj.constructor.isBuffer(obj)
50 );
51}
52
53function isFileWebAPI(uri: unknown): uri is File {
54 return typeof window !== 'undefined' && 'File' in window && uri instanceof File;

Callers 1

addFileToFormDataFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected