Skip to content

Commit

Permalink
Fix code-style
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Jul 27, 2017
1 parent 3d8de55 commit 84daf8c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
12 changes: 6 additions & 6 deletions cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,24 @@ if (
argv.indexOf('-v') !== -1
) {
console.log(pack.version);
} else if (argv.length) {
getSyllables(argv.join(' '));
} else {
} else if (argv.length === 0) {
process.stdin.resume();
process.stdin.setEncoding('utf8');
process.stdin.on('data', function (data) {
getSyllables(data);
});
} else {
getSyllables(argv.join(' '));
}

function getSyllables(value) {
value = value.split(/\s+/g).map(trim).filter(Boolean);

if (value.length) {
console.log(syllables(value));
} else {
if (value.length === 0) {
process.stderr.write(help());
process.exit(1);
} else {
console.log(syllables(value));
}
}

Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ function syllable(value) {
var addOne;
var subtractOne;

if (!value.length) {
if (value.length === 0) {
return count;
}

Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@
"space": true,
"esnext": false,
"rules": {
"unicorn/explicit-length-check": "off",
"guard-for-in": "off"
},
"ignores": [
Expand Down

0 comments on commit 84daf8c

Please sign in to comment.