diff options
author | dubiousjim <dubiousjim@gmail.com> | 2020-03-14 22:57:42 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-14 22:57:42 -0400 |
commit | 6cc40b08652d0224111dc5e902210174b5a63cee (patch) | |
tree | 6ece1c2418e09851e51b082962894bef370c9f31 /std | |
parent | 0df9823cba680d41b981e021a88aaf19e88b0e76 (diff) |
BREAKING CHANGE FileInfo.len renamed to FileName.size (#4338)
Diffstat (limited to 'std')
-rw-r--r-- | std/archive/tar.ts | 2 | ||||
-rwxr-xr-x | std/http/file_server.ts | 4 | ||||
-rw-r--r-- | std/node/_fs/_fs_dirent_test.ts | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/std/archive/tar.ts b/std/archive/tar.ts index 33a9ae097..2680bcff2 100644 --- a/std/archive/tar.ts +++ b/std/archive/tar.ts @@ -334,7 +334,7 @@ export class Tar { ); } - const fileSize = info?.len ?? opts.contentSize; + const fileSize = info?.size ?? opts.contentSize; assert(fileSize != null, "fileSize must be set"); const tarData: TarDataWithSource = { fileName, diff --git a/std/http/file_server.ts b/std/http/file_server.ts index 28eaef44d..a259acb3c 100755 --- a/std/http/file_server.ts +++ b/std/http/file_server.ts @@ -102,7 +102,7 @@ async function serveFile( ): Promise<Response> { const [file, fileInfo] = await Promise.all([open(filePath), stat(filePath)]); const headers = new Headers(); - headers.set("content-length", fileInfo.len.toString()); + headers.set("content-length", fileInfo.size.toString()); headers.set("content-type", "text/plain; charset=utf-8"); const res = { @@ -135,7 +135,7 @@ async function serveDir( } catch (e) {} listEntry.push({ mode: modeToString(fileInfo.isDirectory(), mode), - size: fileInfo.isFile() ? fileLenToString(fileInfo.len) : "", + size: fileInfo.isFile() ? fileLenToString(fileInfo.size) : "", name: fileInfo.name ?? "", url: fileUrl }); diff --git a/std/node/_fs/_fs_dirent_test.ts b/std/node/_fs/_fs_dirent_test.ts index 6fe0f4020..36091d3e1 100644 --- a/std/node/_fs/_fs_dirent_test.ts +++ b/std/node/_fs/_fs_dirent_test.ts @@ -3,7 +3,7 @@ import { assert, assertEquals, assertThrows } from "../../testing/asserts.ts"; import Dirent from "./_fs_dirent.ts"; class FileInfoMock implements Deno.FileInfo { - len = -1; + size = -1; modified = -1; accessed = -1; created = -1; |