mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-01 09:01:45 +08:00
Make the second argument to node-temp.path optional.
This commit is contained in:
@@ -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
4
temp/temp.d.ts
vendored
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user