Skip to content

Commit

Permalink
fix(extract): remove unnecessary checks for valid messages
Browse files Browse the repository at this point in the history
  • Loading branch information
Anton Savoskin committed Jun 19, 2019
1 parent 5394025 commit c56084f
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions src/commands/extract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,18 +101,6 @@ export default class Extract extends Base {
const messages = this.messages;
Object.keys(this.fileToMessages).forEach(fileName => {
this.fileToMessages[fileName].forEach(newMsg => {
if (messages[newMsg.id]) {
if (messages[newMsg.id].defaultMessage !== newMsg.defaultMessage) {
throw new Error(`Different message default messages for message id "${newMsg.id}":
${messages[newMsg.id].defaultMessage} -- ${messages[newMsg.id].files}
${newMsg.defaultMessage} -- ${fileName}`);
}
if (messages[newMsg.id].description && newMsg.description) {
throw new Error(`Should be only one description for message id "${newMsg.id}":
${messages[newMsg.id].description} -- ${messages[newMsg.id].files}
${newMsg.description} -- ${fileName}`);
}
}
const message = messages[newMsg.id] || {};
messages[newMsg.id] = {
description: newMsg.description || message.description,
Expand Down

0 comments on commit c56084f

Please sign in to comment.