Skip to content

Commit

Permalink
🤖 Merge PR DefinitelyTyped#69202 [@types/tar] Add noMtime, mtime in C…
Browse files Browse the repository at this point in the history
…reateOptions by @jvliwanag
  • Loading branch information
jvliwanag authored Apr 17, 2024
1 parent c5bf4b3 commit 7c28187
Showing 1 changed file with 27 additions and 15 deletions.
42 changes: 27 additions & 15 deletions types/tar/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,19 @@ export interface CreateOptions {
*/
noPax?: boolean | undefined;

/**
* Set to true to omit writing mtime values for entries. Note that this prevents using other mtime-based features
* like `tar.update` or the `keepNewer` option with the resulting tar archive. [Alias: m, no-mtime]
*/
noMtime?: boolean | undefined;
m?: boolean | undefined;
"no-mtime"?: boolean | undefined;

/**
* Set to a Date object to force a specific mtime for everything added to the archive. Overridden by noMtime.
*/
mtime?: Date;

/**
* A path portion to prefix onto the entries in the archive.
*/
Expand Down Expand Up @@ -805,17 +818,19 @@ export interface FileOptions {
f?: string | undefined;
}

export type RequiredFileOptions = {
/**
* Uses the given file as the input or output of this function.
*/
file: string;
} | {
/**
* Alias for file.
*/
f: string;
};
export type RequiredFileOptions =
| {
/**
* Uses the given file as the input or output of this function.
*/
file: string;
}
| {
/**
* Alias for file.
*/
f: string;
};

/**
* Create a tarball archive. The fileList is an array of paths to add to the
Expand Down Expand Up @@ -898,10 +913,7 @@ export const x: typeof extract;
* it.
*/
export function list(options: ListOptions & RequiredFileOptions, fileList?: readonly string[]): Promise<void>;
export function list(
options: ListOptions & RequiredFileOptions & { sync: true },
fileList?: readonly string[],
): void;
export function list(options: ListOptions & RequiredFileOptions & { sync: true }, fileList?: readonly string[]): void;
export function list(callback?: (err?: Error) => void): Parse;
export function list(optionsOrFileList: ListOptions | readonly string[], callback?: (err?: Error) => void): Parse;
export function list(options: ListOptions, fileList: readonly string[], callback?: (err?: Error) => void): Parse;
Expand Down

0 comments on commit 7c28187

Please sign in to comment.