Skip to content

Commit

Permalink
fix cowsay and cowthink default options
Browse files Browse the repository at this point in the history
enable flat ternary expression for eslint
  • Loading branch information
erincones committed May 23, 2021
1 parent b2396df commit 1ee92be
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"no-extra-parens": "error",
"strict": [ "error", "global" ],
"quotes": [ "error", "double" ],
"indent": [ "error", 2, { "SwitchCase": 1 } ]
"indent": [ "error", 2, { "SwitchCase": 1, "flatTernaryExpressions": true } ]
},
"overrides": [
{
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ commands, once installed, run `cowsayjs -h`, `cowthinkjs -h` or `moojs -h` to
print the help.

```Text
moojs, cowsayjs, cowthinkjs v1.0.3
moojs, cowsayjs, cowthinkjs v1.0.4
Copyright (c) 2021 Erick Rincones
Licensed under the MIT License
Expand Down
2 changes: 1 addition & 1 deletion cli/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ function getArg(token, j, argv, i) {
*/
function printHelp() {
// Version
var version = "1.0.3";
var version = "1.0.4";

// Get current script
var script = process.argv[1].replace(/\\/g, "/");
Expand Down
6 changes: 4 additions & 2 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,14 @@ function moo(message, options) {
* Default values:
* - eyes: "oo"
* - wrap: 40
* - action: "say"
*
* @param {string} [message] Message to say
* @param {CowOptions} [options] Cow options
* @returns ASCII cow saying the message
*/
function cowsay(message, options) {
return moo(message, options === undefined ? undefined : extendOptions(options, "action", "say"));
return moo(message, extendOptions(options, "action", "say"));
}

/**
Expand All @@ -144,13 +145,14 @@ function cowsay(message, options) {
* Default values:
* - eyes: "oo"
* - wrap: 40
* - action: "think"
*
* @param {CowAllOptions | string} [message] Message to think
* @param {CowOptions} [options] Cow options
* @returns ASCII cow thinking the message
*/
function cowthink(message, options) {
return moo(message, options === undefined ? undefined : extendOptions(options, "action", "think"));
return moo(message, extendOptions(options, "action", "think"));
}


Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cowsayjs",
"version": "1.0.3",
"version": "1.0.4",
"description": "A nodejs clone of the classic cowsay and cowthink cli commands",
"main": "lib/index.js",
"scripts": {
Expand Down

0 comments on commit 1ee92be

Please sign in to comment.