Merge pull request #1546 from bigsan/master

fix grunt.file.expandMapping related issue
This commit is contained in:
Basarat Ali Syed
2014-01-15 03:26:02 -08:00
3 changed files with 19 additions and 11 deletions

View File

@@ -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))

View File

@@ -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;
};

24
gruntjs/gruntjs.d.ts vendored
View File

@@ -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<IFileMap>
/**
* 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<grunt.file.IFileMap>
}
interface AsyncResultCatcher {