File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed
packages/utility/file-caching/src Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change 11import { Keyv } from 'keyv'
2- import { Stream } from 'stream'
2+ import { Readable } from 'stream'
33
44export type FileResponse = {
5- data : Stream
5+ data : Readable
66 mimeType ?: string
77 filename ?: string
88 size ?: bigint
@@ -16,7 +16,7 @@ export interface BaseCacheConfig {
1616}
1717
1818export interface FileCache {
19- get : ( cid : string ) => Promise < Buffer | Stream | null >
20- set : ( cid : string , data : Buffer | Stream ) => Promise < void >
19+ get : ( cid : string ) => Promise < Buffer | Readable | null >
20+ set : ( cid : string , data : Buffer | Readable ) => Promise < void >
2121 remove : ( cid : string ) => Promise < void >
2222}
Original file line number Diff line number Diff line change 11import fs from 'fs'
22import fsPromises from 'fs/promises'
33import path from 'path'
4- import { Stream } from 'stream'
4+ import { Readable } from 'stream'
55import { v4 } from 'uuid'
66
77export const writeFile = async (
88 filepath : string ,
9- data : Stream ,
9+ data : Readable ,
1010 ensureDirectoryExistance : boolean = true ,
1111) => {
1212 const tempFilePath = path . join ( path . dirname ( filepath ) , `${ v4 ( ) } .tmp` )
You can’t perform that action at this time.
0 commit comments