Make the second argument to node-temp.path optional.

This commit is contained in:
Karl-Aksel Puulmann
2016-01-05 16:23:37 +02:00
parent 419793fb79
commit 91f0e294e4
2 changed files with 4 additions and 2 deletions

View File

@@ -67,6 +67,8 @@ function testMkdirSync() {
function testPath() {
const p = temp.path({ suffix: "justSuffix" }, "defaultPrefix");
p.length;
const p2: string = temp.path("prefix");
const p3: string = temp.path({ prefix: "prefix" });
}
function testTrack() {

4
temp/temp.d.ts vendored
View File

@@ -31,8 +31,8 @@ declare module "temp" {
export function openSync(affixes: string): { path: string, fd: number };
export function openSync(affixes: AffixOptions): { path: string, fd: number };
export function path(affixes: string, defaultPrefix: string): string;
export function path(affixes: AffixOptions, defaultPrefix: string): string;
export function path(affixes: string, defaultPrefix?: string): string;
export function path(affixes: AffixOptions, defaultPrefix?: string): string;
export function cleanup(callback?: (result: boolean | {files: number, dirs?: number}) => void): void;