Skip to content

Commit

Permalink
BREAKING CHANGE FileInfo.len renamed to FileName.size (denoland/deno#…
Browse files Browse the repository at this point in the history
  • Loading branch information
dubiousjim authored and caspervonb committed Jan 31, 2021
1 parent 94c1fe0 commit 4d144e1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion archive/tar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions http/file_server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down Expand Up @@ -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
});
Expand Down
2 changes: 1 addition & 1 deletion node/_fs/_fs_dirent_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 4d144e1

Please sign in to comment.