Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorForrest L Norvell <forrest@npmjs.com>2014-05-24 10:42:13 +0400
committerForrest L Norvell <forrest@npmjs.com>2014-06-13 23:41:13 +0400
commit1c2938189122c0640b9403746a6bfed4d6142b27 (patch)
tree8c6c5776818acc47454bb514f58623f05f8f486a /lib/search.js
parent626c3e4a7fb37159b79ab9b3af2c030f26540b0f (diff)
remove dead code and fix jshint warnings
Diffstat (limited to 'lib/search.js')
-rw-r--r--lib/search.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/search.js b/lib/search.js
index 72abbe8d6..06907dfe4 100644
--- a/lib/search.js
+++ b/lib/search.js
@@ -121,7 +121,7 @@ function filterWords (data, args, notArgs) {
for (var i = 0, l = args.length; i < l; i ++) {
if (!match(words, args[i])) return false
}
- for (var i = 0, l = notArgs.length; i < l; i ++) {
+ for (i = 0, l = notArgs.length; i < l; i ++) {
if (match(words, notArgs[i])) return false
}
return true
@@ -224,7 +224,7 @@ function addColorMarker (str, arg, i) {
var pieces = str.toLowerCase().split(arg.toLowerCase())
, p = 0
- return pieces.map(function (piece, i) {
+ return pieces.map(function (piece) {
piece = str.substr(p, piece.length)
var mark = markStart
+ str.substr(p+piece.length, arg.length)
@@ -245,12 +245,12 @@ function colorize (line) {
}
function getMaxWidth() {
+ var cols
try {
var tty = require("tty")
, stdout = process.stdout
- , cols = !tty.isatty(stdout.fd) ? Infinity
- : process.stdout.getWindowSize()[0]
- cols = (cols == 0) ? Infinity : cols
+ cols = !tty.isatty(stdout.fd) ? Infinity : process.stdout.getWindowSize()[0]
+ cols = (cols === 0) ? Infinity : cols
} catch (ex) { cols = Infinity }
return cols
}