diff --git a/README.md b/README.md index 27d6be4e4a..8760adc871 100755 --- a/README.md +++ b/README.md @@ -86,7 +86,7 @@ List of Definitions * [GoJS](http://gojs.net/) (by [Barbara Duckworth](https://github.com/barbara42)) * [Greasemonkey](http://www.greasespot.net/) (by [Kota Saito](https://github.com/kotas)) * [GreenSock Animation Platform (GSAP)](http://www.greensock.com/get-started-js/) (by [Robert S.](https://github.com/codeBelt)) -* [Grunt JS](http://gruntjs.com/) (by [Jeff May](https://github.com/jeffmay) and [Basarat Ali Syed](https://github.com/basarat)) +* [Grunt JS](http://gruntjs.com/) (by [Jeff May](https://github.com/jeffmay), [Basarat Ali Syed](https://github.com/basarat) and [San Chen](https://github.com/bigsan)) * [Google API Client](https://code.google.com/p/google-api-javascript-client/) (by [Frank M](https://github.com/sgtfrankieboy)) * [Google App Engine Channel API](https://developers.google.com/appengine/docs/java/channel/javascript) (by [vvakame](https://github.com/vvakame)) * [GoogleMaps](https://developers.google.com/maps/) (by [Esben Nepper](https://github.com/eNepper)) diff --git a/gruntjs/gruntjs-tests.ts b/gruntjs/gruntjs-tests.ts index 84a5c22a4b..f36b74d764 100644 --- a/gruntjs/gruntjs-tests.ts +++ b/gruntjs/gruntjs-tests.ts @@ -57,4 +57,8 @@ exports = (grunt: IGrunt) => { asyncedTwoArgs(2, "values", (result: string) => { console.log(result); }); + var fileMaps = grunt.file.expandMapping([''], '', { ext: '.js' }); + fileMaps.length; + fileMaps[0].src.length; + fileMaps[0].dest; }; \ No newline at end of file diff --git a/gruntjs/gruntjs.d.ts b/gruntjs/gruntjs.d.ts index e676189101..99eadf435b 100644 --- a/gruntjs/gruntjs.d.ts +++ b/gruntjs/gruntjs.d.ts @@ -450,7 +450,7 @@ declare module grunt { * @see FileModule.expand method documentation for an explanation of how the patterns * and options arguments may be specified. */ - expandMapping(patterns: string[], dest: string, options: IExpandedFilesConfig): IFilesMap + expandMapping(patterns: string[], dest: string, options: IExpandedFilesConfig): Array /** * Match one or more globbing patterns against one or more file paths. @@ -558,7 +558,7 @@ declare module grunt { /** * Pattern(s) to match, relative to the {@link IExpandedFilesConfig.cwd}. */ - src: string[] + src?: string[] /** * Destination path prefix. @@ -599,7 +599,7 @@ declare module grunt { /** * Enables the following options */ - expand: boolean // = true + expand?: boolean // = true /** * All {@link IExpandedFilesConfig.src} matches are relative to (but don't include) this path. @@ -609,7 +609,7 @@ declare module grunt { /** * Replace any existing extension with this value in generated {@link IExpandedFilesConfig.dest} paths. */ - ext?: boolean + ext?: string /** * Remove all path parts from generated {@link IExpandedFilesConfig.dest} paths. @@ -622,17 +622,21 @@ declare module grunt { * and this function must return a new dest value. * If the same dest is returned more than once, each src which used it will be added to an array of sources for it. */ - rename?: boolean + rename?: Function } /** - * @see {@link http://gruntjs.com/configuring-tasks#files-object-format} + * @see {@link http://gruntjs.com/configuring-tasks#files-array-format} */ - interface IFilesMap { + interface IFileMap { /** - * A map of sources to a destination. + * source filenames. */ - [dest: string]: string[] + src: string[] + /** + * destination filename. + */ + dest: string } } @@ -804,7 +808,7 @@ declare module grunt { * Normalizes a task target configuration object into an array of src-dest file mappings. * This method is used internally by the multi task system this.files / grunt.task.current.files property. */ - normalizeMultiTaskFiles(data: grunt.config.IProjectConfig, targetname?: string): grunt.file.IFilesMap + normalizeMultiTaskFiles(data: grunt.config.IProjectConfig, targetname?: string): Array } interface AsyncResultCatcher {