Skip to content
This repository has been archived by the owner on Jun 18, 2019. It is now read-only.

Commit

Permalink
feat: adds config query parameter to have multiple config options
Browse files Browse the repository at this point in the history
  • Loading branch information
mdreizin committed Jun 16, 2016
1 parent 935a097 commit b4afc74
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,13 @@ export default function(content) {
}

const query = loaderUtils.parseQuery(this.query),
options = merge({}, cloneDeep(query), this.options[OPTIONS_PROPERTY]),
globalOptions = this.options[query.config || OPTIONS_PROPERTY] || {},
localOptions = merge({}, cloneDeep(query), globalOptions),
callback = this.async();

defaultsDeep(options, DEFAULT_OPTIONS);
defaultsDeep(localOptions, DEFAULT_OPTIONS);

properties.parse(content, options, (err, result = {}) => {
properties.parse(content, localOptions, (err, result = {}) => {
callback(err, result);
});
}

0 comments on commit b4afc74

Please sign in to comment.