Comparing version 6.2.0 to 6.2.1
@@ -32,3 +32,2 @@ 'use strict'; | ||
this.pointer = 0; | ||
this.firstRender = true; | ||
@@ -91,3 +90,3 @@ // Make sure no default is set (so it won't be printed) | ||
if (this.firstRender) { | ||
if (!this.spaceKeyPressed) { | ||
message += | ||
@@ -171,2 +170,3 @@ '(Press ' + | ||
onSpaceKey() { | ||
this.spaceKeyPressed = true; | ||
this.toggleChoice(this.pointer); | ||
@@ -173,0 +173,0 @@ this.render(); |
@@ -40,7 +40,5 @@ 'use strict'; | ||
if (this.opt.mask) { | ||
events.keypress | ||
.pipe(takeUntil(validation.success)) | ||
.forEach(this.onKeypress.bind(this)); | ||
} | ||
events.keypress | ||
.pipe(takeUntil(validation.success)) | ||
.forEach(this.onKeypress.bind(this)); | ||
@@ -47,0 +45,0 @@ // Init |
@@ -70,2 +70,6 @@ 'use strict'; | ||
.forEach(this.onKeypress.bind(this)); | ||
events.normalizedUpKey.pipe(takeUntil(events.line)).forEach(this.onUpKey.bind(this)); | ||
events.normalizedDownKey | ||
.pipe(takeUntil(events.line)) | ||
.forEach(this.onDownKey.bind(this)); | ||
@@ -150,2 +154,30 @@ // Init the prompt | ||
} | ||
/** | ||
* When user press up key | ||
*/ | ||
onUpKey() { | ||
this.onArrowKey('up'); | ||
} | ||
/** | ||
* When user press down key | ||
*/ | ||
onDownKey() { | ||
this.onArrowKey('down'); | ||
} | ||
/** | ||
* When user press up or down key | ||
* @param {String} type Arrow type: up or down | ||
*/ | ||
onArrowKey(type) { | ||
var index = this.rl.line.length ? Number(this.rl.line) - 1 : 0; | ||
index += type === 'up' ? -1 : 1; | ||
this.rl.line = String(index + 1); | ||
this.onKeypress(); | ||
} | ||
} | ||
@@ -152,0 +184,0 @@ |
{ | ||
"name": "inquirer", | ||
"version": "6.2.0", | ||
"version": "6.2.1", | ||
"description": "A collection of common interactive command line user interfaces.", | ||
"author": "Simon Boudrias <admin@simonboudrias.com>", | ||
"files": [ | ||
"lib" | ||
"lib", | ||
"README.md" | ||
], | ||
@@ -23,9 +24,8 @@ "main": "lib/inquirer.js", | ||
"chai": "^4.0.1", | ||
"chalk-pipe": "^1.2.0", | ||
"chalk-pipe": "^2.0.0", | ||
"cmdify": "^0.0.4", | ||
"mocha": "^5.0.0", | ||
"mockery": "^2.1.0", | ||
"nsp": "^3.0.0", | ||
"nyc": "^12.0.1", | ||
"sinon": "^5.0.0" | ||
"nyc": "^13.1.0", | ||
"sinon": "^7.1.1" | ||
}, | ||
@@ -35,3 +35,4 @@ "scripts": { | ||
"posttest": "nyc report --reporter=text-lcov > ../../coverage/nyc-report.lcov", | ||
"prepublish": "nsp check" | ||
"prepublishOnly": "cp ../../README.md .", | ||
"postpublish": "rm -f README.md" | ||
}, | ||
@@ -52,5 +53,5 @@ "repository": "SBoudrias/Inquirer.js", | ||
"string-width": "^2.1.0", | ||
"strip-ansi": "^4.0.0", | ||
"strip-ansi": "^5.0.0", | ||
"through": "^2.3.6" | ||
} | ||
} |
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
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
75067
7
24
1967
0
425
+ Addedansi-regex@4.1.1(transitive)
+ Addedstrip-ansi@5.2.0(transitive)
Updatedstrip-ansi@^5.0.0