Merge pull request #16580 from alan-agius4/feature/fs-extra-symlink

Feature/fs extra symlink
This commit is contained in:
Nathan Shively-Sanders
2017-06-01 16:16:03 -07:00
committed by GitHub
2 changed files with 18 additions and 17 deletions

View File

@@ -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, "file").then(() => {
// stub
});
fs.ensureSymlink(path, errorCallback);
fs.ensureSymlinkSync(path);
fs.ensureSymlink(path, path, errorCallback);
fs.ensureSymlinkSync(path, path);
fs.emptyDir(path).then(() => {
// stub
});

View File

@@ -1,8 +1,8 @@
// Type definitions for fs-extra 3.0
// Project: https://github.com/jprichardson/node-fs-extra
// Definitions by: Alan Agius <https://github.com/alan-agius4>
// midknight41 <https://github.com/midknight41>
// Brendan Forster <https://github.com/shiftkey>
// Definitions by: Alan Agius <https://github.com/alan-agius4>,
// midknight41 <https://github.com/midknight41>,
// Brendan Forster <https://github.com/shiftkey>,
// Mees van Dijk <https://github.com/mees->
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2
@@ -79,13 +79,14 @@ export function ensureFile(path: string): Promise<void>;
export function ensureFile(path: string, callback: (err: Error) => void): void;
export function ensureFileSync(path: string): void;
export function ensureLink(path: string): Promise<void>;
export function ensureLink(path: string, callback: (err: Error) => void): void;
export function ensureLinkSync(path: string): void;
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(path: string): Promise<void>;
export function ensureSymlink(path: string, callback: (err: Error) => void): void;
export function ensureSymlinkSync(path: string): 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?: SymlinkType): void;
export function emptyDir(path: string): Promise<void>;
export function emptyDir(path: string, callback: (err: Error) => void): void;
@@ -257,9 +258,9 @@ export interface PathEntryStream {
read(): PathEntry | null;
}
export type CopyFilterFunction = (src: string) => boolean;
export type CopyFilter = ((src: string) => boolean) | RegExp;
export type CopyFilter = CopyFilterFunction | RegExp;
export type SymlinkType = "dir" | "file";
export interface CopyOptions {
dereference?: boolean;