cloudflare/cloudflare-typescript
Publicmirrored fromhttps://github.com/cloudflare/cloudflare-typescriptAvailable
src/_shims/bun-runtime.ts
14lines · modecode
| 1 | /** |
| 2 | * Disclaimer: modules in _shims aren't intended to be imported by SDK users. |
| 3 | */ |
| 4 | import { type Shims } from './registry'; |
| 5 | import { getRuntime as getWebRuntime } from './web-runtime'; |
| 6 | import { ReadStream as FsReadStream } from 'node:fs'; |
| 7 | |
| 8 | export function getRuntime(): Shims { |
| 9 | const runtime = getWebRuntime(); |
| 10 | function isFsReadStream(value: any): value is FsReadStream { |
| 11 | return value instanceof FsReadStream; |
| 12 | } |
| 13 | return { ...runtime, isFsReadStream }; |
| 14 | } |
| 15 | |