({
mode,
contentType,
fsPath,
size,
}: FileFsRefOptions)
| 44 | } |
| 45 | |
| 46 | static async fromFsPath({ |
| 47 | mode, |
| 48 | contentType, |
| 49 | fsPath, |
| 50 | size, |
| 51 | }: FileFsRefOptions): Promise<FileFsRef> { |
| 52 | let m = mode; |
| 53 | let s = size; |
| 54 | if (!m || typeof s === 'undefined') { |
| 55 | const stat = await fs.lstat(fsPath); |
| 56 | m = stat.mode; |
| 57 | s = stat.size; |
| 58 | } |
| 59 | return new FileFsRef({ mode: m, contentType, fsPath, size: s }); |
| 60 | } |
| 61 | |
| 62 | static async fromStream({ |
| 63 | mode = 0o100644, |
no outgoing calls
no test coverage detected