bower-files
Advanced tools
Comparing version 3.3.0 to 3.4.0
@@ -66,3 +66,4 @@ 'use strict'; | ||
overrides: {}, | ||
componentJson: '.bower.json' | ||
componentJson: '.bower.json', | ||
camelCase: true | ||
}, options); | ||
@@ -69,0 +70,0 @@ |
@@ -52,6 +52,7 @@ 'use strict'; | ||
Component.prototype.getDeps = function () { | ||
Component.prototype.getDeps = function (useCamelCase) { | ||
var hash = {}; | ||
hash[camelCase(this.name)] = this.files; | ||
var name = useCamelCase ? camelCase(this.name) : this.name; | ||
hash[name] = this.files; | ||
return assign(hash, depFiles.depHash(this.dependencies)); | ||
}; |
@@ -23,3 +23,4 @@ 'use strict'; | ||
match: [], | ||
join: {} | ||
join: {}, | ||
camelCase: this.bowerFiles._config.camelCase | ||
}; | ||
@@ -26,0 +27,0 @@ } |
@@ -64,5 +64,5 @@ 'use strict'; | ||
hash, | ||
depFiles.depHash(this.dependencies), | ||
options.dev ? depFiles.depHash(this.devDependencies) : {} | ||
depFiles.depHash(this.dependencies, options.camelCase), | ||
options.dev ? depFiles.depHash(this.devDependencies, options.camelCase) : {} | ||
); | ||
}; |
@@ -12,5 +12,5 @@ 'use strict'; | ||
depFiles.depHash = function depHash(dependencies, files) { | ||
depFiles.depHash = function depHash(dependencies, camelCase) { | ||
return dependencies.reduce(function (files, dependency) { | ||
return assign(files, dependency.getDeps()); | ||
return assign(files, dependency.getDeps(camelCase)); | ||
}, {}); | ||
@@ -17,0 +17,0 @@ }; |
{ | ||
"name": "bower-files", | ||
"version": "3.3.0", | ||
"version": "3.4.0", | ||
"description": "Pulls in dynamic list of filepaths to bower components", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -181,2 +181,17 @@ # bower-files | ||
#### `options.camelCase` {Boolean} | ||
Default: `true` | ||
When you get a dependency hash using the `.deps`, by default, it will return | ||
the components in camelCase. So if you have `angular-route` as a dependency, | ||
it will be returned in the dependency hash as `angularRoute`. To prevent this | ||
from happening, pass false to this option. Example: | ||
```javascript | ||
var lib = require('bower-files')({camelCase: false}).deps; | ||
lib['angular-route']; // instead of lib.angularRoute | ||
``` | ||
## API | ||
@@ -183,0 +198,0 @@ |
25191
387
367