diff --git a/del/del-tests.ts b/del/del-tests.ts index d2e931dfbf..b0dd984349 100644 --- a/del/del-tests.ts +++ b/del/del-tests.ts @@ -3,6 +3,10 @@ import del = require("del"); var paths = ["build", "dist/**/*.js"]; +del(["tmp/*.js", "!tmp/unicorn.js"]); + +del(["tmp/*.js", "!tmp/unicorn.js"], {force: true}); + del(["tmp/*.js", "!tmp/unicorn.js"], (err, paths) => { console.log('Deleted files/folders:\n', paths.join('\n')); }); @@ -11,6 +15,10 @@ del(["tmp/*.js", "!tmp/unicorn.js"], {force: true}, (err, paths) => { console.log('Deleted files/folders:\n', paths.join('\n')); }); +del("tmp/*.js"); + +del("tmp/*.js", {force: true}); + del("tmp/*.js", (err, paths) => { console.log('Deleted files/folders:\n', paths.join('\n')); }); @@ -25,4 +33,4 @@ del.sync(["tmp/*.js", "!tmp/unicorn.js"], {force: true}); del.sync("tmp/*.js"); -del.sync("tmp/*.js", {force: true}); \ No newline at end of file +del.sync("tmp/*.js", {force: true}); diff --git a/del/del.d.ts b/del/del.d.ts index f83fb821b4..b20bac92ce 100644 --- a/del/del.d.ts +++ b/del/del.d.ts @@ -1,4 +1,4 @@ -// Type definitions for del +// Type definitions for del v1.2.0 // Project: https://github.com/sindresorhus/del // Definitions by: Asana // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -8,13 +8,16 @@ declare module "del" { import glob = require("glob"); + function Del(pattern: string): void; + function Del(pattern: string, options: Del.Options): void; function Del(pattern: string, callback: (err: Error, deletedFiles: string[]) => any): void; - function Del(pattern: string, options: Del.Options, callback: (err: Error, deletedFiles: string[]) => any): void; + function Del(patterns: string[]): void; + function Del(patterns: string[], options: Del.Options): void; function Del(patterns: string[], callback: (err: Error, deletedFiles: string[]) => any): void; - function Del(patterns: string[], options: Del.Options, callback: (err: Error, deletedFiles: string[]) => any): void; + module Del { function sync(pattern: string, options?: Options): void; function sync(patterns: string[], options?: Options): void; @@ -25,4 +28,4 @@ declare module "del" { } export = Del; -} \ No newline at end of file +}