Add jsdoc annotations to public interface
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Fabian Stamm 2020-07-28 19:41:57 +02:00
parent e7888075d6
commit 2e92ec337c
2 changed files with 16 additions and 0 deletions

0
tar/dev.sh Executable file → Normal file
View File

View File

@ -2,6 +2,12 @@ import { FS, Path } from "./deps.ts";
import { Tar, Untar } from "./tar.ts"; import { Tar, Untar } from "./tar.ts";
/**
* Uncompresses a tar file to a certain location
* @param {string} src Tar file to be uncompressed
* @param {string} dest The location to uncompress to
* @returns A promise that is resolved once the tar file finished uncompressing
*/
export async function uncompress(src: string, dest: string): Promise<void> { export async function uncompress(src: string, dest: string): Promise<void> {
const tarFile = await Deno.open(src, { read: true }); const tarFile = await Deno.open(src, { read: true });
const untar = new Untar(tarFile); const untar = new Untar(tarFile);
@ -23,9 +29,19 @@ export async function uncompress(src: string, dest: string): Promise<void> {
} }
export interface ICompressOptions { export interface ICompressOptions {
/**
* Controls wether all files inside the tar should be prefixed with the foldername or not
*/
excludeSrc?: boolean; excludeSrc?: boolean;
} }
/**
* Compress file or folder into a .tar file
* @param {string} src File or folder to compress
* @param {string} dest Path of the resulting .tar file
* @param {ICompressOptions} options Options to controll behavious
* @returns A promise that is resolved once the tar file finished compressing
*/
export async function compress( export async function compress(
src: string, src: string,
dest: string, dest: string,