feat(fs-extra): add SymlinkType

This commit is contained in:
Alan Agius
2017-05-17 22:57:47 +02:00
parent 8ee13ea122
commit d31294e091
2 changed files with 5 additions and 3 deletions
+1 -1
View File
@@ -172,7 +172,7 @@ fs.ensureLink(path, path).then(() => {
});
fs.ensureLink(path, path, errorCallback);
fs.ensureLinkSync(path, path);
fs.ensureSymlink(path, path).then(() => {
fs.ensureSymlink(path, path, "file").then(() => {
// stub
});
fs.ensureSymlink(path, path, errorCallback);
+4 -2
View File
@@ -83,8 +83,8 @@ export function ensureLink(src: string, dest: string): Promise<void>;
export function ensureLink(src: string, dest: string, callback: (err: Error) => void): void;
export function ensureLinkSync(src: string, dest: string): void;
export function ensureSymlink(src: string, dest: string, type?: string): Promise<void>;
export function ensureSymlink(src: string, dest: string, type: string, callback: (err: Error) => void): void;
export function ensureSymlink(src: string, dest: string, type?: SymlinkType): Promise<void>;
export function ensureSymlink(src: string, dest: string, type: SymlinkType, 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;
@@ -262,6 +262,8 @@ export type CopyFilterFunction = (src: string) => boolean;
export type CopyFilter = CopyFilterFunction | RegExp;
export type SymlinkType = "dir" | "file";
export interface CopyOptions {
dereference?: boolean;
overwrite?: boolean;