From 09b956231b4dd42e1cb04f5b2b8ecea4906623b7 Mon Sep 17 00:00:00 2001 From: Alan Agius Date: Wed, 17 May 2017 13:20:13 +0200 Subject: [PATCH] fix(fs-extra): `ensureSymlink` and `ensureLink` should accept more params --- types/fs-extra/fs-extra-tests.ts | 12 ++++++------ types/fs-extra/index.d.ts | 13 +++++++------ 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/types/fs-extra/fs-extra-tests.ts b/types/fs-extra/fs-extra-tests.ts index 005857e48c..9c43bbf64d 100644 --- a/types/fs-extra/fs-extra-tests.ts +++ b/types/fs-extra/fs-extra-tests.ts @@ -167,16 +167,16 @@ fs.ensureFile(path).then(() => { }); fs.ensureFile(path, errorCallback); fs.ensureFileSync(path); -fs.ensureLink(path).then(() => { +fs.ensureLink(path, path).then(() => { // stub }); -fs.ensureLink(path, errorCallback); -fs.ensureLinkSync(path); -fs.ensureSymlink(path).then(() => { +fs.ensureLink(path, path, errorCallback); +fs.ensureLinkSync(path, path); +fs.ensureSymlink(path, path).then(() => { // stub }); -fs.ensureSymlink(path, errorCallback); -fs.ensureSymlinkSync(path); +fs.ensureSymlink(path, path, errorCallback); +fs.ensureSymlinkSync(path, path); fs.emptyDir(path).then(() => { // stub }); diff --git a/types/fs-extra/index.d.ts b/types/fs-extra/index.d.ts index 481fbad644..e84fea7e58 100644 --- a/types/fs-extra/index.d.ts +++ b/types/fs-extra/index.d.ts @@ -79,13 +79,14 @@ export function ensureFile(path: string): Promise; export function ensureFile(path: string, callback: (err: Error) => void): void; export function ensureFileSync(path: string): void; -export function ensureLink(path: string): Promise; -export function ensureLink(path: string, callback: (err: Error) => void): void; -export function ensureLinkSync(path: string): void; +export function ensureLink(src: string, dest: string): Promise; +export function ensureLink(src: string, dest: string, callback: (err: Error) => void): void; +export function ensureLinkSync(src: string, dest: string): void; -export function ensureSymlink(path: string): Promise; -export function ensureSymlink(path: string, callback: (err: Error) => void): void; -export function ensureSymlinkSync(path: string): void; +export function ensureSymlink(src: string, dest: string, type?: string): Promise; +export function ensureSymlink(src: string, dest: string, type: string, callback: (err: Error) => void): void; +export function ensureSymlink(src: string, dest: string, callback: (err: Error) => void): void; +export function ensureSymlinkSync(src: string, dest: string, type?: string): void; export function emptyDir(path: string): Promise; export function emptyDir(path: string, callback: (err: Error) => void): void;