inquirer-search-checkbox
Advanced tools
Comparing version 0.1.1 to 1.0.0
@@ -25,2 +25,3 @@ "use strict"; | ||
var chalk_1 = require("chalk"); | ||
var fuzzy = require("fuzzy"); | ||
var ignoreKeys = ["up", "down", "space"]; | ||
@@ -77,5 +78,3 @@ function getCheckbox(checked) { | ||
var bottomContent = ""; | ||
var input = ""; | ||
var tip = chalk_1.default.dim("(Press <space> to select, <enter> to submit.)"); | ||
input = this.rl.line; | ||
if (this.status === "answered") { | ||
@@ -95,6 +94,6 @@ message += chalk_1.default.cyan(this.selection.join(", ")); | ||
SearchBox.prototype.filterChoices = function () { | ||
var _this = this; | ||
this.filterList = this.choices.filter(function (c) { | ||
return c.name.toLocaleLowerCase().includes(_this.rl.line); | ||
}); | ||
var options = { | ||
extract: function (el) { return el.name; } | ||
}; | ||
this.filterList = fuzzy.filter(this.rl.line, this.choices, options).map(function (el) { return el.original; }); | ||
}; | ||
@@ -101,0 +100,0 @@ SearchBox.prototype.toggleChoice = function (index) { |
{ | ||
"name": "inquirer-search-checkbox", | ||
"version": "0.1.1", | ||
"version": "1.0.0", | ||
"description": "Searchable Inquirer checkbox", | ||
@@ -20,6 +20,7 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"inquirer": "^3.3.0", | ||
"chalk": "^2.3.0", | ||
"figures": "^2.0.0" | ||
"figures": "^2.0.0", | ||
"fuzzy": "^0.1.3", | ||
"inquirer": "^3.3.0" | ||
} | ||
} |
@@ -6,2 +6,3 @@ import Base = require("inquirer/lib/prompts/base"); | ||
import chalk from "chalk"; | ||
import * as fuzzy from "fuzzy"; | ||
@@ -79,5 +80,3 @@ interface Event { | ||
var bottomContent = ""; | ||
var input = ""; | ||
const tip = chalk.dim("(Press <space> to select, <enter> to submit.)"); | ||
input = this.rl.line; // remove space | ||
@@ -105,5 +104,7 @@ // Render choices or answer depending on the state | ||
filterChoices() { | ||
this.filterList = this.choices.filter(c => | ||
c.name.toLocaleLowerCase().includes(this.rl.line) | ||
); | ||
const options = { | ||
extract: (el: Choice) => el.name | ||
}; | ||
this.filterList = fuzzy.filter(this.rl.line, this.choices, options).map(el => el.original); | ||
} | ||
@@ -110,0 +111,0 @@ |
@@ -9,3 +9,2 @@ { | ||
"moduleResolution": "node", | ||
"allowSyntheticDefaultImports": true, | ||
"removeComments": true, | ||
@@ -12,0 +11,0 @@ "noUnusedLocals": true, |
Sorry, the diff of this file is not supported yet
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 v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
34088
13
1
4
442
+ Addedfuzzy@^0.1.3
+ Addedfuzzy@0.1.3(transitive)