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
Throw error when file name longer than 100 bytes
  • Loading branch information
arcatdmz committed May 11, 2019
commit 0ba17226cb5a7a335a31a16e895e4c459da581ac
6 changes: 6 additions & 0 deletions archive/tar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,12 @@ export class Tar {
* @param opts options
*/
async append(fileName: string, opts: TarOptions): Promise<void> {
if (typeof fileName !== "string")
throw new Error("file name not specified");
if (fileName.length > 100)
throw new Error(
"utar format does not allow file name longer than 100 bytes"
);
opts = opts || {};

// set meta data
Expand Down