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

Commit

Permalink
Forgot that typeof an Array is 'object'
Browse files Browse the repository at this point in the history
  • Loading branch information
cletusw committed Aug 25, 2016
1 parent 1ecad89 commit 568777c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var MessageFormat = require('messageformat');
module.exports = function(content) {
var query = loaderUtils.parseQuery(this.query);
var locale = query.locale || 'en';
var messages = typeof this.inputValue === 'object' ? this.inputValue : this.exec(content);
var messages = (Array.isArray(this.inputValue) && typeof this.inputValue[0] === 'object') ? this.inputValue[0] : this.exec(content);
var messageFunctions = new MessageFormat(locale).compile(messages);

this.cacheable && this.cacheable();
Expand Down

0 comments on commit 568777c

Please sign in to comment.