Added supporty for the 'directory' and 'bulk' functions of Archiver JS (#12011)

* Added support for the "directory"  and "bulk" function calls
https://archiverjs.com/docs/lib_core.js.html#line631
https://archiverjs.com/docs/lib_core.js.html#line559

* added funtion overloads and unit tests.

* added returntype to bulk
This commit is contained in:
Noah Hambayi
2016-10-19 05:14:05 -07:00
committed by Masahiro Wakame
parent 09fd5a155b
commit 715c3d55d7
2 changed files with 15 additions and 1 deletions

View File

@@ -11,4 +11,13 @@ var readStream = FS.createReadStream('./archiver.d.ts');
archiver.pipe(writeStream);
archiver.append(readStream, {name: 'archiver.d.ts'});
archiver.finalize();
archiver.finalize();
archiver.directory('./path', './someOtherPath');
archiver.directory('./path', { name: "testName"} );
archiver.directory('./', "", {});
archiver.directory('./', {name: 'test'}, {});
archiver.bulk({ mappaing: {} });

View File

@@ -25,6 +25,11 @@ declare module "archiver" {
interface Archiver extends STREAM.Transform {
pipe(writeStream: FS.WriteStream): void;
append(source: FS.ReadStream | Buffer | string, name: nameInterface): void;
directory(dirpath: string, destpath: nameInterface | string): void;
directory(dirpath: string, destpath: nameInterface | string, data: any | Function): void;
bulk(mappings: any): void;
finalize(): void;
}