Skip to content

Commit

Permalink
removed uneeded condition
Browse files Browse the repository at this point in the history
  • Loading branch information
vstirbu committed Oct 25, 2017
1 parent ca44441 commit bff790d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# chai-as-typed

[![Greenkeeper badge](https://badges.greenkeeper.io/vstirbu/chai-as-typed.svg)](https://greenkeeper.io/)

[![Build Status](https://travis-ci.org/vstirbu/chai-as-typed.svg?branch=master)](https://travis-ci.org/vstirbu/chai-as-typed)
[![Coverage Status](https://coveralls.io/repos/github/vstirbu/chai-as-typed/badge.svg?branch=master)](https://coveralls.io/github/vstirbu/chai-as-typed?branch=master)
[![Greenkeeper badge](https://badges.greenkeeper.io/vstirbu/chai-as-typed.svg)](https://greenkeeper.io/)

## Motivation
12 changes: 4 additions & 8 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,10 @@ const options = {
};

const prettifyDiagnostic = diagnostic => {
if (diagnostic.file) {
const { line, character } = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start);
const messageText = ts.flattenDiagnosticMessageText(diagnostic.messageText, '\n');

return `${diagnostic.file.fileName} (Ln ${line + 1}, Col ${character + 1}): ${messageText}`
} else {
console.log(`${ts.flattenDiagnosticMessageText(diagnostic.messageText, '\n')}`);
}
const { line, character } = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start);
const messageText = ts.flattenDiagnosticMessageText(diagnostic.messageText, '\n');

return `${diagnostic.file.fileName} (Ln ${line + 1}, Col ${character + 1}): ${messageText}`
}

module.exports = (chai, utils) => {
Expand Down

0 comments on commit bff790d

Please sign in to comment.