Permalink
Browse files

Small improvement.

  • Loading branch information...
satazor committed Feb 23, 2013
1 parent 7b4cadb commit 8e71d18dc74d51275d8e6cef23e7db3b68608b2f
Showing with 6 additions and 6 deletions.
  1. +6 −6 index.js
View
@@ -8,8 +8,8 @@ promptly.prompt = function (message, opts, fn) {
if (typeof opts === 'function') {
fn = opts;
opts = {};
- } else {
- opts = opts || {};
+ } else if (!opts) {
+ opts = {};
}
if (opts.trim === undefined) {
@@ -110,8 +110,8 @@ promptly.confirm = function (message, opts, fn) {
if (typeof opts === 'function') {
fn = opts;
opts = {};
- } else {
- opts = opts || {};
+ } else if (!opts) {
+ opts = {};
}
opts.validator = opts.validator || [];
@@ -151,8 +151,8 @@ promptly.choose = function (message, choices, opts, fn) {
if (typeof opts === 'function') {
fn = opts;
opts = {};
- } else {
- opts = opts || {};
+ } else if (!opts) {
+ opts = {};
}
opts.validator = opts.validator || [];

0 comments on commit 8e71d18

Please sign in to comment.