Skip to content

Commit

Permalink
tweak resolveAsset function
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Oct 20, 2015
1 parent 4e3fb0d commit 57852b5
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/util/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -343,8 +343,11 @@ exports.mergeOptions = function merge (parent, child, vm) {
*/

exports.resolveAsset = function resolve (options, type, id) {
var camelizedId = _.camelize(id)
var pascalizedId = camelizedId.charAt(0).toUpperCase() + camelizedId.slice(1)
var assets = options[type]
return assets[id] || assets[camelizedId] || assets[pascalizedId]
var camelizedId
return assets[id] ||
// camelCase ID
assets[camelizedId = _.camelize(id)] ||
// Pascal Case ID
assets[camelizedId.charAt(0).toUpperCase() + camelizedId.slice(1)]
}

0 comments on commit 57852b5

Please sign in to comment.