prompt-choices
Advanced tools
Comparing version 3.0.3 to 3.0.4
10
index.js
@@ -305,3 +305,3 @@ 'use strict'; | ||
Choices.prototype.get = function(key) { | ||
Choices.prototype.get = function(key, prop) { | ||
if (typeof key === 'string') { | ||
@@ -311,5 +311,9 @@ key = this.getIndex(key); | ||
if (!utils.isNumber(key)) { | ||
throw new TypeError('expected index to be a number or string'); | ||
return null; | ||
} | ||
return this.getChoice(key); | ||
var choice = this.getChoice(key); | ||
if (choice && typeof prop === 'string') { | ||
return choice[prop]; | ||
} | ||
return choice; | ||
}; | ||
@@ -316,0 +320,0 @@ |
{ | ||
"name": "prompt-choices", | ||
"description": "Create an array of multiple choice objects for use in prompts.", | ||
"version": "3.0.3", | ||
"version": "3.0.4", | ||
"homepage": "https://github.com/enquirer/prompt-choices", | ||
@@ -6,0 +6,0 @@ "author": "Jon Schlinkert (https://github.com/jonschlinkert)", |
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
39014
893