Socket
Socket
Sign inDemoInstall

prompt

Package Overview
Dependencies
Maintainers
3
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

prompt - npm Package Compare versions

Comparing version 0.2.3 to 0.2.4

15

lib/prompt.js

@@ -421,10 +421,7 @@ /*

if (prompt.override && prompt.override[propName]) {
var isValid = prompt._performValidation(name, prop, prompt.override, schema, -1, callback);
if(isValid){
if (prompt._performValidation(name, prop, prompt.override, schema, -1, callback)) {
return callback(null, prompt.override[propName]);
}else{
delete prompt.override[propName];
}
delete prompt.override[propName];
}

@@ -478,3 +475,3 @@

if(!isValid){
if (!isValid) {
return prompt.getInput(prop, callback);

@@ -504,4 +501,3 @@ }

//
prompt._performValidation = function(name, prop, against, schema, line, callback){
prompt._performValidation = function (name, prop, against, schema, line, callback) {
var valid, msg;

@@ -517,3 +513,2 @@

if (!valid.valid) {
msg = line !== -1 ? 'Invalid input for ' : 'Invalid command-line input for ';

@@ -520,0 +515,0 @@

{
"name": "prompt",
"description": "A beautiful command-line prompt for node.js",
"version": "0.2.3",
"version": "0.2.4",
"author": "Nodejitsu Inc. <info@nodejitsu.com>",

@@ -16,3 +16,3 @@ "maintainers": [

"pkginfo": "0.x.x",
"read": "0.1.x",
"read": "1.0.x",
"revalidator": "0.1.x",

@@ -19,0 +19,0 @@ "utile": "0.1.x",

@@ -121,6 +121,13 @@ /*

fnvalidator: {
name: 'fnvalidator',
validator: function (line) {
return line.slice(0,2) == 'fn';
},
message: 'fnvalidator must start with "fn"'
},
fnconform: {
conform: function (line) {
return line.slice(0,2) == 'fn';
},
message: 'fnvalidator must start with "fn"'
message: 'fnconform must start with "fn"'
}/*,

@@ -127,0 +134,0 @@ cbvalidator: {

@@ -171,3 +171,12 @@ /*

topic: function () {
prompt.getInput(grab('badValidator'), this.callback);
var that = this,
called;
prompt.getInput(grab('badValidator'), function (err) {
if (!called) {
called = true;
that.callback(err);
}
});
helpers.stdin.writeNextTick('some-user\n');
},

@@ -235,3 +244,3 @@ "should respond with an error": function (err, ign) {

},
"with a sync function validator": {
"with a sync function validator (.validator)": {
topic: function () {

@@ -244,3 +253,3 @@ var that = this;

prompt.get(grab('fnvalidator'), this.callback);
prompt.get(helpers.schema.properties.fnvalidator, this.callback);
helpers.stdin.writeNextTick('fn123\n');

@@ -252,2 +261,18 @@ },

}
},
"with a sync function validator (.conform)": {
topic: function () {
var that = this;
helpers.stdout.once('data', function (msg) {
that.msg = msg;
});
prompt.get(grab('fnconform'), this.callback);
helpers.stdin.writeNextTick('fn123\n');
},
"should accept a value that is checked": function (err, result) {
assert.isNull(err);
assert.equal(result['fnconform'],'fn123');
}
}

@@ -254,0 +279,0 @@ //

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc