From 91f0e294e4d1da1f6bc21d89bf87372dcc176450 Mon Sep 17 00:00:00 2001 From: Karl-Aksel Puulmann Date: Tue, 5 Jan 2016 16:23:37 +0200 Subject: [PATCH] Make the second argument to node-temp.path optional. --- temp/temp-tests.ts | 2 ++ temp/temp.d.ts | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/temp/temp-tests.ts b/temp/temp-tests.ts index be25d357bb..4fb0cc6f86 100644 --- a/temp/temp-tests.ts +++ b/temp/temp-tests.ts @@ -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() { diff --git a/temp/temp.d.ts b/temp/temp.d.ts index 7cd51d2be5..c8caab7467 100644 --- a/temp/temp.d.ts +++ b/temp/temp.d.ts @@ -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;