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

Commit 568777c

Browse files
committed
Forgot that typeof an Array is 'object'
1 parent 1ecad89 commit 568777c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ var MessageFormat = require('messageformat');
44
module.exports = function(content) {
55
var query = loaderUtils.parseQuery(this.query);
66
var locale = query.locale || 'en';
7-
var messages = typeof this.inputValue === 'object' ? this.inputValue : this.exec(content);
7+
var messages = (Array.isArray(this.inputValue) && typeof this.inputValue[0] === 'object') ? this.inputValue[0] : this.exec(content);
88
var messageFunctions = new MessageFormat(locale).compile(messages);
99

1010
this.cacheable && this.cacheable();

0 commit comments

Comments
 (0)