Skip to content

Commit

Permalink
⚡ improvement(warn): suppress warning messages for production
Browse files Browse the repository at this point in the history
  • Loading branch information
kazupon committed Mar 18, 2017
1 parent 0890b44 commit 6e417d2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,9 @@ export default class VueI18n {
if (isPlainObject(message)) {
ret = message[key]
if (typeof ret !== 'string') {
warn(`Value of key '${key}' is not a string!`)
if (process.env.NODE_ENV !== 'production') {
warn(`Value of key '${key}' is not a string!`)
}
return null
}
} else {
Expand All @@ -128,7 +130,9 @@ export default class VueI18n {
if (typeof pathRet === 'string') {
ret = pathRet
} else {
warn(`Value of key '${key}' is not a string!`)
if (process.env.NODE_ENV !== 'production') {
warn(`Value of key '${key}' is not a string!`)
}
return null
}
}
Expand Down

0 comments on commit 6e417d2

Please sign in to comment.