Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[archive] add Tar and Untar classes #388

Merged
merged 17 commits into from
May 14, 2019
Merged
Prev Previous commit
Next Next commit
Apply prettier
  • Loading branch information
arcatdmz committed May 11, 2019
commit 842354b992402e3780e07fb31829f9a46d1ef7e5
6 changes: 3 additions & 3 deletions archive/tar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ export class Tar {
fileName = fileName.substr(i + 1);
break;
}
i --;
i--;
}
if (i < 0 || fileName.length > 100 || fileNamePrefix.length > 155) {
throw new Error(
Expand Down Expand Up @@ -434,7 +434,7 @@ export class Untar {
throw new Error("checksum error");
}

const magic = decoder.decode(header.ustar)
const magic = decoder.decode(header.ustar);
if (magic !== ustar) {
throw new Error(`unsupported archive format: ${magic}`);
}
Expand All @@ -444,7 +444,7 @@ export class Untar {
fileName: decoder.decode(trim(header.fileName))
};
const fileNamePrefix = trim(header.fileNamePrefix);
if(fileNamePrefix.byteLength > 0) {
if (fileNamePrefix.byteLength > 0) {
meta.fileName = decoder.decode(fileNamePrefix) + "/" + meta.fileName;
}
["fileMode", "mtime", "uid", "gid"].forEach(
Expand Down