prompt-for
Advanced tools
Comparing version 0.5.0 to 0.5.1
0.5.1 - March 27, 2015 | ||
---------------------- | ||
* fix bug for required strings | ||
0.5.0 - October 4, 2014 | ||
@@ -3,0 +7,0 @@ ----------------------- |
@@ -18,3 +18,6 @@ | ||
var msg = format(schema, options); | ||
prompt(msg, fn); | ||
prompt(msg, function(val){ | ||
if ('' === val && schema.required) return fn(); | ||
return fn(val); | ||
}); | ||
}; | ||
@@ -32,3 +35,6 @@ | ||
var msg = format(schema, options); | ||
prompt.password(msg, fn); | ||
prompt.password(msg, function(val){ | ||
if ('' === val && schema.required) return fn(); | ||
return fn(val); | ||
}); | ||
}; | ||
@@ -35,0 +41,0 @@ |
@@ -5,3 +5,3 @@ { | ||
"repository": "git://github.com/segmentio/prompt-for.git", | ||
"version": "0.5.0", | ||
"version": "0.5.1", | ||
"license": "MIT", | ||
@@ -8,0 +8,0 @@ "main": "lib/index.js", |
@@ -90,5 +90,5 @@ | ||
it('should wait for required values', function(done){ | ||
prompt({ number: { type: 'number', required: true }}, function(err, answers){ | ||
prompt({ string: { required: true }}, function(err, answers){ | ||
if (err) return done(err); | ||
assert.equal(answers.number, 42); | ||
assert.equal(answers.string, '42'); | ||
done(); | ||
@@ -95,0 +95,0 @@ }); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12559
332