Merge pull request #7495 from macobo/karl-temp-fixes

node-temp: Make the second argument to temp.path optional.
This commit is contained in:
Daniel Rosenwasser
2016-01-05 09:35:57 -05:00
2 changed files with 4 additions and 2 deletions
+2
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() {
+2 -2
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;