summaryrefslogtreecommitdiff
path: root/deps/npm/node_modules/columnify
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/node_modules/columnify')
-rw-r--r--deps/npm/node_modules/columnify/LICENSE21
-rw-r--r--deps/npm/node_modules/columnify/Readme.md229
-rw-r--r--deps/npm/node_modules/columnify/index.js49
-rwxr-xr-xdeps/npm/node_modules/columnify/node_modules/strip-ansi/cli.js39
-rw-r--r--deps/npm/node_modules/columnify/node_modules/strip-ansi/index.js6
-rw-r--r--deps/npm/node_modules/columnify/node_modules/strip-ansi/node_modules/ansi-regex/index.js2
-rw-r--r--deps/npm/node_modules/columnify/node_modules/strip-ansi/node_modules/ansi-regex/package.json75
-rw-r--r--deps/npm/node_modules/columnify/node_modules/strip-ansi/node_modules/ansi-regex/readme.md28
-rw-r--r--deps/npm/node_modules/columnify/node_modules/strip-ansi/package.json84
-rw-r--r--deps/npm/node_modules/columnify/node_modules/strip-ansi/readme.md43
-rw-r--r--deps/npm/node_modules/columnify/node_modules/wcwidth.js/INSTALL.md12
-rw-r--r--deps/npm/node_modules/columnify/node_modules/wcwidth.js/LICENSE.md29
-rw-r--r--deps/npm/node_modules/columnify/node_modules/wcwidth.js/NEWS9
-rw-r--r--deps/npm/node_modules/columnify/node_modules/wcwidth.js/README.md65
-rw-r--r--deps/npm/node_modules/columnify/node_modules/wcwidth.js/node_modules/underscore/LICENSE23
-rw-r--r--deps/npm/node_modules/columnify/node_modules/wcwidth.js/node_modules/underscore/README.md22
-rw-r--r--deps/npm/node_modules/columnify/node_modules/wcwidth.js/node_modules/underscore/package.json67
-rw-r--r--deps/npm/node_modules/columnify/node_modules/wcwidth.js/node_modules/underscore/underscore-min.js6
-rw-r--r--deps/npm/node_modules/columnify/node_modules/wcwidth.js/node_modules/underscore/underscore.js1343
-rw-r--r--deps/npm/node_modules/columnify/node_modules/wcwidth.js/package.json60
-rw-r--r--deps/npm/node_modules/columnify/node_modules/wcwidth.js/wcwidth.js262
-rw-r--r--deps/npm/node_modules/columnify/package.json34
-rw-r--r--deps/npm/node_modules/columnify/utils.js104
-rw-r--r--deps/npm/node_modules/columnify/width.js6
24 files changed, 2546 insertions, 72 deletions
diff --git a/deps/npm/node_modules/columnify/LICENSE b/deps/npm/node_modules/columnify/LICENSE
new file mode 100644
index 0000000000..ed47678e61
--- /dev/null
+++ b/deps/npm/node_modules/columnify/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2013 Tim Oxley
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/deps/npm/node_modules/columnify/Readme.md b/deps/npm/node_modules/columnify/Readme.md
index 6520379659..a20739b653 100644
--- a/deps/npm/node_modules/columnify/Readme.md
+++ b/deps/npm/node_modules/columnify/Readme.md
@@ -2,8 +2,12 @@
[![Build Status](https://travis-ci.org/timoxley/columnify.png?branch=master)](https://travis-ci.org/timoxley/columnify)
-Create text-based columns suitable for console output.
-Supports minimum and maximum column widths via truncation and text wrapping.
+Create text-based columns suitable for console output from objects or
+arrays of objects.
+
+Columns are automatically resized to fit the content of the largest
+cell. Each cell will be padded with spaces to fill the available space
+and ensure column contents are left-aligned.
Designed to [handle sensible wrapping in npm search results](https://github.com/isaacs/npm/pull/2328).
@@ -19,7 +23,7 @@ $ npm install --save columnify@latest
## Usage
-```js
+```javascript
var columnify = require('columnify')
var columns = columnify(data, options)
console.log(columns)
@@ -27,14 +31,56 @@ console.log(columns)
## Examples
-### Simple Columns
+### Columnify Objects
-Text is aligned under column headings. Columns are automatically resized
-to fit the content of the largest cell. Each cell will be padded with
-spaces to fill the available space and ensure column contents are
-left-aligned.
+Objects are converted to a list of key/value pairs:
-```js
+```javascript
+
+var data = {
+ "commander@0.6.1": 1,
+ "minimatch@0.2.14": 3,
+ "mkdirp@0.3.5": 2,
+ "sigmund@1.0.0": 3
+}
+
+console.log(columnify(data))
+```
+#### Output:
+```
+KEY VALUE
+commander@0.6.1 1
+minimatch@0.2.14 3
+mkdirp@0.3.5 2
+sigmund@1.0.0 3
+```
+
+### Custom Column Names
+
+```javascript
+var data = {
+ "commander@0.6.1": 1,
+ "minimatch@0.2.14": 3,
+ "mkdirp@0.3.5": 2,
+ "sigmund@1.0.0": 3
+}
+
+console.log(columnify(data, {columns: ['MODULE', 'COUNT']}))
+```
+#### Output:
+```
+MODULE COUNT
+commander@0.6.1 1
+minimatch@0.2.14 3
+mkdirp@0.3.5 2
+sigmund@1.0.0 3
+```
+
+### Columnify Arrays of Objects
+
+Column headings are extracted from the keys in supplied objects.
+
+```javascript
var columnify = require('columnify')
var columns = columnify([{
@@ -47,6 +93,7 @@ var columns = columnify([{
console.log(columns)
```
+#### Output:
```
NAME VERSION
mod1 0.0.1
@@ -60,8 +107,7 @@ columns. Minimum width is also supported. Wrapping will happen at word
boundaries. Empty cells or those which do not fill the max/min width
will be padded with spaces.
-```js
-var columnify = require('columnify')
+```javascript
var columns = columnify([{
name: 'mod1',
@@ -75,6 +121,7 @@ var columns = columnify([{
console.log(columns)
```
+#### Output:
```
NAME DESCRIPTION VERSION
mod1 some description which happens 0.0.1
@@ -83,13 +130,13 @@ module-two another description larger 0.2.0
than the max
```
-### Truncated Columns
+### Truncating Column Cells
You can disable wrapping and instead truncate content at the maximum
column width. Truncation respects word boundaries. A truncation marker,
`…` will appear next to the last word in any truncated line.
-```js
+```javascript
var columns = columnify(data, {
truncate: true,
config: {
@@ -101,20 +148,124 @@ var columns = columnify(data, {
console.log(columns)
```
-
+#### Output:
```
NAME DESCRIPTION VERSION
mod1 some description… 0.0.1
module-two another description… 0.2.0
```
+### Filtering & Ordering Columns
+
+By default, all properties are converted into columns, whether or not
+they exist on every object or not.
+
+To explicitly specify which columns to include, and in which order,
+supply a "columns" or "include" array ("include" is just an alias).
+
+```javascript
+var data = [{
+ name: 'module1',
+ description: 'some description',
+ version: '0.0.1',
+}, {
+ name: 'module2',
+ description: 'another description',
+ version: '0.2.0',
+}]
+
+var columns = columnify(data, {
+ columns: ['name', 'version'] // note description not included
+})
+
+console.log(columns)
+```
+
+#### Output:
+```
+NAME VERSION
+module1 0.0.1
+module2 0.2.0
+```
+
+
+## Other Configuration Options
+
+### Align Right
+
+```js
+var data = {
+ "mocha@1.18.2": 1,
+ "commander@2.0.0": 1,
+ "debug@0.8.1": 1
+}
+
+columnify(data, {config: {value: {align: 'right'}}})
+```
+
+#### Output:
+```
+KEY VALUE
+mocha@1.18.2 1
+commander@2.0.0 1
+debug@0.8.1 1
+```
+
+### Preserve existing newlines
+
+By default, `columnify` sanitises text by replacing any occurance of 1 or more whitespace characters with a single space.
+
+`columnify` can be configured to respect existing new line characters using the `preserveNewLines` option. Note this will still collapse all other whitespace.
+
+```javascript
+var data = [{
+ name: "glob@3.2.9",
+ paths: [
+ "node_modules/tap/node_modules/glob",
+ "node_modules/tape/node_modules/glob"
+ ].join('\n')
+}, {
+ name: "nopt@2.2.1",
+ paths: [
+ "node_modules/tap/node_modules/nopt"
+ ]
+}, {
+ name: "runforcover@0.0.2",
+ paths: "node_modules/tap/node_modules/runforcover"
+}]
+
+console.log(columnify(data, {preserveNewLines: true}))
+```
+#### Output:
+```
+NAME PATHS
+glob@3.2.9 node_modules/tap/node_modules/glob
+ node_modules/tape/node_modules/glob
+nopt@2.2.1 node_modules/tap/node_modules/nopt
+runforcover@0.0.2 node_modules/tap/node_modules/runforcover
+```
+
+Compare this with output without `preserveNewLines`:
+
+```javascript
+console.log(columnify(data, {preserveNewLines: false}))
+// or just
+console.log(columnify(data))
+```
+
+```
+NAME PATHS
+glob@3.2.9 node_modules/tap/node_modules/glob node_modules/tape/node_modules/glob
+nopt@2.2.1 node_modules/tap/node_modules/nopt
+runforcover@0.0.2 node_modules/tap/node_modules/runforcover
+```
### Custom Truncation Marker
You can change the truncation marker to something other than the default
`…`.
-```js
+```javascript
var columns = columnify(data, {
truncate: true,
truncateMarker: '>',
@@ -127,7 +278,7 @@ var columns = columnify(data, {
console.log(columns)
```
-
+#### Output:
```
NAME DESCRIPTION VERSION
mod1 some description> 0.0.1
@@ -139,7 +290,7 @@ module-two another description> 0.2.0
If your columns need some bling, you can split columns with custom
characters.
-```js
+```javascript
var columns = columnify(data, {
columnSplitter: ' | '
@@ -147,43 +298,51 @@ var columns = columnify(data, {
console.log(columns)
```
+#### Output:
```
NAME | DESCRIPTION | VERSION
mod1 | some description which happens to be far larger than the max | 0.0.1
module-two | another description larger than the max | 0.2.0
```
-### Filtering & Ordering Columns
+## Multibyte Character Support
-By default, all properties are converted into columns, whether or not
-they exist on every object or not.
-
-To explicitly specify which columns to include, and in which order,
-supply an "include" array:
+`columnify` uses [mycoboco/wcwidth.js](https://github.com/mycoboco/wcwidth.js) to calculate length of multibyte characters:
-```js
+```javascript
var data = [{
- name: 'module1',
+ name: 'module-one',
description: 'some description',
version: '0.0.1',
}, {
- name: 'module2',
- description: 'another description',
- version: '0.2.0',
+ name: '这是一个很长的名字的模块',
+ description: '这真的是一个描述的内容这个描述很长',
+ version: "0.3.3"
}]
-var columns = columnify(data, {
- include: ['name', 'version'] // note description not included
-})
+console.log(columnify(data))
+```
-console.log(columns)
+#### Without multibyte handling:
+
+i.e. before columnify added this feature
+
+```
+NAME DESCRIPTION VERSION
+module-one some description 0.0.1
+这是一个很长的名字的模块 这真的是一个描述的内容这个描述很长 0.3.3
```
+#### With multibyte handling:
+
```
-NAME VERSION
-module1 0.0.1
-module2 0.2.0
+NAME DESCRIPTION VERSION
+module-one some description 0.0.1
+这是一个很长的名字的模块 这真的是一个描述的内容这个描述很长 0.3.3
```
+
## License
MIT
+
+
diff --git a/deps/npm/node_modules/columnify/index.js b/deps/npm/node_modules/columnify/index.js
index 462c2919f9..63257dcecc 100644
--- a/deps/npm/node_modules/columnify/index.js
+++ b/deps/npm/node_modules/columnify/index.js
@@ -1,9 +1,12 @@
"use strict"
+var wcwidth = require('./width')
var utils = require('./utils')
var padRight = utils.padRight
+var padLeft = utils.padLeft
var splitIntoLines = utils.splitIntoLines
var splitLongWords = utils.splitLongWords
+var truncateString = utils.truncateString
var DEFAULTS = {
maxWidth: Infinity,
@@ -11,6 +14,7 @@ var DEFAULTS = {
columnSplitter: ' ',
truncate: false,
truncateMarker: '…',
+ preserveNewLines: false,
headingTransform: function(key) {
return key.toUpperCase()
},
@@ -26,14 +30,20 @@ module.exports = function(items, options) {
var columnConfigs = options.config || {}
delete options.config // remove config so doesn't appear on every column.
+ var maxLineWidth = options.maxLineWidth || Infinity
+ delete options.maxLineWidth // this is a line control option, don't pass it to column
+
// Option defaults inheritance:
// options.config[columnName] => options => DEFAULTS
options = mixin(options, DEFAULTS)
options.config = options.config || Object.create(null)
options.spacing = options.spacing || '\n' // probably useless
+ options.preserveNewLines = !!options.preserveNewLines
+ options.columns = options.columns || options.include // alias include/columns, prefer columns if supplied
+ var columnNames = options.columns || [] // optional user-supplied columns to include
- var columnNames = options.include || [] // optional user-supplied columns to include
+ items = toArray(items, columnNames)
// if not suppled column names, automatically determine columns from data keys
if (!columnNames.length) {
@@ -67,8 +77,13 @@ module.exports = function(items, options) {
result[columnName] = item[columnName] != null ? item[columnName] : ''
// toString everything
result[columnName] = '' + result[columnName]
- // remove funky chars
- result[columnName] = result[columnName].replace(/\s+/g, " ")
+ if (columns[columnName].preserveNewLines) {
+ // merge non-newline whitespace chars
+ result[columnName] = result[columnName].replace(/[^\S\n]/gmi, ' ')
+ } else {
+ // merge all whitespace chars
+ result[columnName] = result[columnName].replace(/\s/gmi, ' ')
+ }
})
return result
})
@@ -97,7 +112,7 @@ module.exports = function(items, options) {
column.width = items.map(function(item) {
return item[columnName]
}).reduce(function(min, cur) {
- return Math.max(min, Math.min(column.maxWidth, Math.max(column.minWidth, cur.length)))
+ return Math.max(min, Math.min(column.maxWidth, Math.max(column.minWidth, wcwidth(cur))))
}, 0)
})
@@ -119,7 +134,7 @@ module.exports = function(items, options) {
// if truncating required, only include first line + add truncation char
if (column.truncate && item[columnName].length > 1) {
- item[columnName] = splitIntoLines(cell, column.width - column.truncateMarker.length)
+ item[columnName] = splitIntoLines(cell, column.width - wcwidth(column.truncateMarker))
var firstLine = item[columnName][0]
if (!endsWith(firstLine, column.truncateMarker)) item[columnName][0] += column.truncateMarker
item[columnName] = item[columnName].slice(0, 1)
@@ -133,21 +148,23 @@ module.exports = function(items, options) {
var column = columns[columnName]
column.width = items.map(function(item) {
return item[columnName].reduce(function(min, cur) {
- return Math.max(min, Math.min(column.maxWidth, Math.max(column.minWidth, cur.length)))
+ return Math.max(min, Math.min(column.maxWidth, Math.max(column.minWidth, wcwidth(cur))))
}, 0)
}).reduce(function(min, cur) {
return Math.max(min, Math.min(column.maxWidth, Math.max(column.minWidth, cur)))
}, 0)
})
- var rows = createRows(items, columns, columnNames) // merge lines into rows
+ var rows = createRows(items, columns, columnNames) // merge lines into rows
// conceive output
return rows.reduce(function(output, row) {
return output.concat(row.reduce(function(rowOut, line) {
return rowOut.concat(line.join(options.columnSplitter))
}, []))
- }, []).join(options.spacing)
+ }, []).map(function(line) {
+ return truncateString(line, maxLineWidth)
+ }).join(options.spacing)
}
/**
@@ -172,7 +189,8 @@ function createRows(items, columns, columnNames) {
columnNames.forEach(function(columnName) {
var column = columns[columnName]
var val = item[columnName][i] || '' // || '' ensures empty columns get padded
- row[i].push(padRight(val, column.width))
+ if (column.align == 'right') row[i].push(padLeft(val, column.width))
+ else row[i].push(padRight(val, column.width))
})
}
return row
@@ -208,3 +226,16 @@ function endsWith(target, searchString, position) {
var lastIndex = target.lastIndexOf(searchString);
return lastIndex !== -1 && lastIndex === position;
}
+
+
+function toArray(items, columnNames) {
+ if (Array.isArray(items)) return items
+ var rows = []
+ for (var key in items) {
+ var item = {}
+ item[columnNames[0] || 'key'] = key
+ item[columnNames[1] || 'value'] = items[key]
+ rows.push(item)
+ }
+ return rows
+}
diff --git a/deps/npm/node_modules/columnify/node_modules/strip-ansi/cli.js b/deps/npm/node_modules/columnify/node_modules/strip-ansi/cli.js
new file mode 100755
index 0000000000..602ae00e8f
--- /dev/null
+++ b/deps/npm/node_modules/columnify/node_modules/strip-ansi/cli.js
@@ -0,0 +1,39 @@
+#!/usr/bin/env node
+'use strict';
+var fs = require('fs');
+var pkg = require('./package.json');
+var strip = require('./');
+var input = process.argv[2];
+
+function help() {
+ console.log([
+ pkg.description,
+ '',
+ 'Usage',
+ ' $ strip-ansi <input-file> > <output-file>',
+ ' $ cat <input-file> | strip-ansi > <output-file>',
+ '',
+ 'Example',
+ ' $ strip-ansi unicorn.txt > unicorn-stripped.txt'
+ ].join('\n'));
+}
+
+if (process.argv.indexOf('--help') !== -1) {
+ help();
+ return;
+}
+
+if (process.argv.indexOf('--version') !== -1) {
+ console.log(pkg.version);
+ return;
+}
+
+if (input) {
+ process.stdout.write(strip(fs.readFileSync(input, 'utf8')));
+ return;
+}
+
+process.stdin.setEncoding('utf8');
+process.stdin.on('data', function (data) {
+ process.stdout.write(strip(data));
+});
diff --git a/deps/npm/node_modules/columnify/node_modules/strip-ansi/index.js b/deps/npm/node_modules/columnify/node_modules/strip-ansi/index.js
new file mode 100644
index 0000000000..11e072e4ea
--- /dev/null
+++ b/deps/npm/node_modules/columnify/node_modules/strip-ansi/index.js
@@ -0,0 +1,6 @@
+'use strict';
+var ansiRegex = require('ansi-regex');
+
+module.exports = function (str) {
+ return typeof str === 'string' ? str.replace(ansiRegex, '') : str;
+};
diff --git a/deps/npm/node_modules/columnify/node_modules/strip-ansi/node_modules/ansi-regex/index.js b/deps/npm/node_modules/columnify/node_modules/strip-ansi/node_modules/ansi-regex/index.js
new file mode 100644
index 0000000000..182e434578
--- /dev/null
+++ b/deps/npm/node_modules/columnify/node_modules/strip-ansi/node_modules/ansi-regex/index.js
@@ -0,0 +1,2 @@
+'use strict';
+module.exports = /\x1B\[([0-9]{1,3}(;[0-9]{1,3})*)?[m|K]/g;
diff --git a/deps/npm/node_modules/columnify/node_modules/strip-ansi/node_modules/ansi-regex/package.json b/deps/npm/node_modules/columnify/node_modules/strip-ansi/node_modules/ansi-regex/package.json
new file mode 100644
index 0000000000..6b53e50dc6
--- /dev/null
+++ b/deps/npm/node_modules/columnify/node_modules/strip-ansi/node_modules/ansi-regex/package.json
@@ -0,0 +1,75 @@
+{
+ "name": "ansi-regex",
+ "version": "0.1.0",
+ "description": "Regular expression for matching ANSI escape codes",
+ "license": "MIT",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/sindresorhus/ansi-regex"
+ },
+ "author": {
+ "name": "Sindre Sorhus",
+ "email": "sindresorhus@gmail.com",
+ "url": "http://sindresorhus.com"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ },
+ "scripts": {
+ "test": "mocha"
+ },
+ "files": [
+ "index.js"
+ ],
+ "keywords": [
+ "ansi",
+ "styles",
+ "color",
+ "colour",
+ "colors",
+ "terminal",
+ "console",
+ "cli",
+ "string",
+ "tty",
+ "escape",
+ "formatting",
+ "rgb",
+ "256",
+ "shell",
+ "xterm",
+ "command-line",
+ "text",
+ "regex",
+ "regexp",
+ "re"
+ ],
+ "devDependencies": {
+ "mocha": "*"
+ },
+ "bugs": {
+ "url": "https://github.com/sindresorhus/ansi-regex/issues"
+ },
+ "homepage": "https://github.com/sindresorhus/ansi-regex",
+ "_id": "ansi-regex@0.1.0",
+ "_shasum": "55ca60db6900857c423ae9297980026f941ed903",
+ "_from": "ansi-regex@^0.1.0",
+ "_npmVersion": "1.4.9",
+ "_npmUser": {
+ "name": "sindresorhus",
+ "email": "sindresorhus@gmail.com"
+ },
+ "maintainers": [
+ {
+ "name": "sindresorhus",
+ "email": "sindresorhus@gmail.com"
+ }
+ ],
+ "dist": {
+ "shasum": "55ca60db6900857c423ae9297980026f941ed903",
+ "tarball": "http://registry.npmjs.org/ansi-regex/-/ansi-regex-0.1.0.tgz"
+ },
+ "directories": {},
+ "_resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-0.1.0.tgz",
+ "readme": "ERROR: No README data found!"
+}
diff --git a/deps/npm/node_modules/columnify/node_modules/strip-ansi/node_modules/ansi-regex/readme.md b/deps/npm/node_modules/columnify/node_modules/strip-ansi/node_modules/ansi-regex/readme.md
new file mode 100644
index 0000000000..72c248cd73
--- /dev/null
+++ b/deps/npm/node_modules/columnify/node_modules/strip-ansi/node_modules/ansi-regex/readme.md
@@ -0,0 +1,28 @@
+# ansi-regex [![Build Status](https://travis-ci.org/sindresorhus/ansi-regex.svg?branch=master)](https://travis-ci.org/sindresorhus/ansi-regex)
+
+> Regular expression for matching [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code)
+
+
+## Install
+
+```sh
+$ npm install --save ansi-regex
+```
+
+
+## Usage
+
+```js
+var ansiRegex = require('ansi-regex');
+
+ansiRegex.test('\x1b[4mcake\x1b[0m');
+//=> true
+
+ansiRegex.test('cake');
+//=> false
+```
+
+
+## License
+
+MIT © [Sindre Sorhus](http://sindresorhus.com)
diff --git a/deps/npm/node_modules/columnify/node_modules/strip-ansi/package.json b/deps/npm/node_modules/columnify/node_modules/strip-ansi/package.json
new file mode 100644
index 0000000000..ea6a22fe21
--- /dev/null
+++ b/deps/npm/node_modules/columnify/node_modules/strip-ansi/package.json
@@ -0,0 +1,84 @@
+{
+ "name": "strip-ansi",
+ "version": "0.2.2",
+ "description": "Strip ANSI escape codes",
+ "license": "MIT",
+ "bin": {
+ "strip-ansi": "cli.js"
+ },
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/sindresorhus/strip-ansi"
+ },
+ "author": {
+ "name": "Sindre Sorhus",
+ "email": "sindresorhus@gmail.com",
+ "url": "http://sindresorhus.com"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ },
+ "scripts": {
+ "test": "mocha"
+ },
+ "files": [
+ "index.js",
+ "cli.js"
+ ],
+ "keywords": [
+ "strip",
+ "trim",
+ "remove",
+ "ansi",
+ "styles",
+ "color",
+ "colour",
+ "colors",
+ "terminal",
+ "console",
+ "cli",
+ "string",
+ "tty",
+ "escape",
+ "formatting",
+ "rgb",
+ "256",
+ "shell",
+ "xterm",
+ "log",
+ "logging",
+ "command-line",
+ "text"
+ ],
+ "dependencies": {
+ "ansi-regex": "^0.1.0"
+ },
+ "devDependencies": {
+ "mocha": "*"
+ },
+ "bugs": {
+ "url": "https://github.com/sindresorhus/strip-ansi/issues"
+ },
+ "homepage": "https://github.com/sindresorhus/strip-ansi",
+ "_id": "strip-ansi@0.2.2",
+ "_shasum": "854d290c981525fc8c397a910b025ae2d54ffc08",
+ "_from": "strip-ansi@^0.2.1",
+ "_npmVersion": "1.4.9",
+ "_npmUser": {
+ "name": "sindresorhus",
+ "email": "sindresorhus@gmail.com"
+ },
+ "maintainers": [
+ {
+ "name": "sindresorhus",
+ "email": "sindresorhus@gmail.com"
+ }
+ ],
+ "dist": {
+ "shasum": "854d290c981525fc8c397a910b025ae2d54ffc08",
+ "tarball": "http://registry.npmjs.org/strip-ansi/-/strip-ansi-0.2.2.tgz"
+ },
+ "directories": {},
+ "_resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-0.2.2.tgz",
+ "readme": "ERROR: No README data found!"
+}
diff --git a/deps/npm/node_modules/columnify/node_modules/strip-ansi/readme.md b/deps/npm/node_modules/columnify/node_modules/strip-ansi/readme.md
new file mode 100644
index 0000000000..5477079d00
--- /dev/null
+++ b/deps/npm/node_modules/columnify/node_modules/strip-ansi/readme.md
@@ -0,0 +1,43 @@
+# strip-ansi [![Build Status](https://travis-ci.org/sindresorhus/strip-ansi.svg?branch=master)](https://travis-ci.org/sindresorhus/strip-ansi)
+
+> Strip [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code)
+
+
+## Install
+
+```sh
+$ npm install --save strip-ansi
+```
+
+
+## Usage
+
+```js
+var stripAnsi = require('strip-ansi');
+
+stripAnsi('\x1b[4mcake\x1b[0m');
+//=> 'cake'
+```
+
+
+## CLI
+
+```sh
+$ npm install --global strip-ansi
+```
+
+```sh
+$ strip-ansi --help
+
+Usage
+ $ strip-ansi <input-file> > <output-file>
+ $ cat <input-file> | strip-ansi > <output-file>
+
+Example
+ $ strip-ansi unicorn.txt > unicorn-stripped.txt
+```
+
+
+## License
+
+MIT © [Sindre Sorhus](http://sindresorhus.com)
diff --git a/deps/npm/node_modules/columnify/node_modules/wcwidth.js/INSTALL.md b/deps/npm/node_modules/columnify/node_modules/wcwidth.js/INSTALL.md
new file mode 100644
index 0000000000..e4eafaff71
--- /dev/null
+++ b/deps/npm/node_modules/columnify/node_modules/wcwidth.js/INSTALL.md
@@ -0,0 +1,12 @@
+How To Build and Install wcwidth.js
+===================================
+
+This package does not provide an automated way to build or install the library
+except using [`npm`](http://npmjs.org/package/wcwidth.js) because wcwidth.js is
+intended to runs on top of [`node.js`](http://nodejs.org) that is a javascript
+interpreter. If you have `node.js` installed,
+
+ npm install wcwidth.js
+
+brings the latest version of `wcwidth.js` and installs it with its all
+depending packages.
diff --git a/deps/npm/node_modules/columnify/node_modules/wcwidth.js/LICENSE.md b/deps/npm/node_modules/columnify/node_modules/wcwidth.js/LICENSE.md
new file mode 100644
index 0000000000..14deaf94b8
--- /dev/null
+++ b/deps/npm/node_modules/columnify/node_modules/wcwidth.js/LICENSE.md
@@ -0,0 +1,29 @@
+wcwidth.js: JavaScript Portng of Markus Kuhn's wcwidth() Implementation
+=======================================================================
+
+Copyright (C) 2012 by Jun Woong.
+
+This package is a JavaScript porting of `wcwidth()` implementation
+[by Markus Kuhn](http://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c).
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is furnished to do
+so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+
+THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR
+OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
diff --git a/deps/npm/node_modules/columnify/node_modules/wcwidth.js/NEWS b/deps/npm/node_modules/columnify/node_modules/wcwidth.js/NEWS
new file mode 100644
index 0000000000..cf80fbc1c9
--- /dev/null
+++ b/deps/npm/node_modules/columnify/node_modules/wcwidth.js/NEWS
@@ -0,0 +1,9 @@
+What's New in wcwidth.js?
+=========================
+
+2014-04-26 0.0.4 released.
+2012-12-13 0.0.3 released.
+2012-12-12 Moved the repository to git/github.
+2012-10-16 0.0.2 released.
+2012-10-16 Using `wcwidth' without invoking it checked.
+2012-10-12 First release.
diff --git a/deps/npm/node_modules/columnify/node_modules/wcwidth.js/README.md b/deps/npm/node_modules/columnify/node_modules/wcwidth.js/README.md
new file mode 100644
index 0000000000..6c562cff58
--- /dev/null
+++ b/deps/npm/node_modules/columnify/node_modules/wcwidth.js/README.md
@@ -0,0 +1,65 @@
+wcwidth.js: A JavaScript Porting of Markus Kuhn's wcwidth() Implementation
+==========================================================================
+
+`wcwidth.js` is a simple JavaScript porting of `wcwidth()` implemented in C
+[by Markus Kuhn](http://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c).
+
+`wcwidth()` and its string version, `wcswidth()` are defined by IEEE Std
+1002.1-2001, a.k.a. POSIX.1-2001, and return the number of columns used to
+represent the given wide character and string. Markus's implementation assumes
+the wide character given to those functions to be encoded in ISO 10646, which
+is almost true for JavaScript's characters.
+
+For convenience, `wcwidth.js` sets the getter of the property named `wcwidth`
+for the string type. You don't need to invoke a function to get the width of
+strings, but inspecting the `wcwidth` property is enough. The following code
+snippet shows how to use `wcwidth.js`:
+
+ var wcwidth = require('wcwidth')({
+ nul: 0,
+ control: -1,
+ monkeypatch: true
+ }); // equivalent to var wcwidth = require('wcwidth')();
+
+ console.log("한글".wcwidth); // prints 4
+ console.log("\0".wcwidth); // prints 0
+ console.log("\t".wcwidth); // prints -1
+
+The argument `{ nul: 0, control: -1, monkeypatch: true }` (which are the
+default values, in fact) tells `wcwidth.js` to return 0 for the NUL character
+and -1 for non-printable control characters. Setting a negative value to `nul`
+or `control` makes the `wcwidth` property set to -1 for any string that
+contains NUL or control characters respectively. If you plan to replace each
+control character with, say, `???` when printing, you can 'require'
+`wcwidth.js` as follows:
+
+ var wcwidth = require('wcwidth')({
+ control: 3
+ }); // leaving nul as 0
+
+ console.log("\t".wcwidth); // prints 3
+ console.log("\0".wcwidth); // prints 0
+
+The last option `monkeypatch` allows `wcwidth.js` to monkey-patch
+`String.prototype` to provide the getter `wcwidth`. Even if it is convenient to
+have a getter that looks like the native one, it is sometimes unwanted as
+adding a getter into `String.prototype` may break node.js's module system; you
+are not guaranteed to have the version your code `require`s through the getter
+if other modules you're using also depend on other versions of `wcwidth.js`
+(thanks to [timoxley](https://github.com/timoxley) for the information). By
+setting `monkeypatch` to `false`, `wcwidth.js` touches no global object and
+provides no getter but a callable method explained below.
+
+`wcwidth.js` also provides a method. Since JavaScript has no character type,
+it is meaningless to have two versions while POSIX does for C. The method also
+accepts a code value that can be obtained by the `charCodeAt()` method.
+
+ console.log(wcwidth('한')); // prints 2
+ console.log(wcwidth('글'.charCodeAt(0)); // prints 2
+ console.log(wcwidth('한글')); // prints 4
+
+`INSTALL.md` explains how to build and install the library. For the copyright
+issues, see the accompanying `LICENSE.md` file.
+
+If you have a question or suggestion, do not hesitate to contact me via email
+(woong.jun at gmail.com) or web (http://code.woong.org/).
diff --git a/deps/npm/node_modules/columnify/node_modules/wcwidth.js/node_modules/underscore/LICENSE b/deps/npm/node_modules/columnify/node_modules/wcwidth.js/node_modules/underscore/LICENSE
new file mode 100644
index 0000000000..0d6b8739d9
--- /dev/null
+++ b/deps/npm/node_modules/columnify/node_modules/wcwidth.js/node_modules/underscore/LICENSE
@@ -0,0 +1,23 @@
+Copyright (c) 2009-2014 Jeremy Ashkenas, DocumentCloud and Investigative
+Reporters & Editors
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
diff --git a/deps/npm/node_modules/columnify/node_modules/wcwidth.js/node_modules/underscore/README.md b/deps/npm/node_modules/columnify/node_modules/wcwidth.js/node_modules/underscore/README.md
new file mode 100644
index 0000000000..c2ba2590c6
--- /dev/null
+++ b/deps/npm/node_modules/columnify/node_modules/wcwidth.js/node_modules/underscore/README.md
@@ -0,0 +1,22 @@
+ __
+ /\ \ __
+ __ __ ___ \_\ \ __ _ __ ____ ___ ___ _ __ __ /\_\ ____
+ /\ \/\ \ /' _ `\ /'_ \ /'__`\/\ __\/ ,__\ / ___\ / __`\/\ __\/'__`\ \/\ \ /',__\
+ \ \ \_\ \/\ \/\ \/\ \ \ \/\ __/\ \ \//\__, `\/\ \__//\ \ \ \ \ \//\ __/ __ \ \ \/\__, `\
+ \ \____/\ \_\ \_\ \___,_\ \____\\ \_\\/\____/\ \____\ \____/\ \_\\ \____\/\_\ _\ \ \/\____/
+ \/___/ \/_/\/_/\/__,_ /\/____/ \/_/ \/___/ \/____/\/___/ \/_/ \/____/\/_//\ \_\ \/___/
+ \ \____/
+ \/___/
+
+Underscore.js is a utility-belt library for JavaScript that provides
+support for the usual functional suspects (each, map, reduce, filter...)
+without extending any core JavaScript objects.
+
+For Docs, License, Tests, and pre-packed downloads, see:
+http://underscorejs.org
+
+Underscore is an open-sourced component of DocumentCloud:
+https://github.com/documentcloud
+
+Many thanks to our contributors:
+https://github.com/jashkenas/underscore/contributors
diff --git a/deps/npm/node_modules/columnify/node_modules/wcwidth.js/node_modules/underscore/package.json b/deps/npm/node_modules/columnify/node_modules/wcwidth.js/node_modules/underscore/package.json
new file mode 100644
index 0000000000..49e9145c99
--- /dev/null
+++ b/deps/npm/node_modules/columnify/node_modules/wcwidth.js/node_modules/underscore/package.json
@@ -0,0 +1,67 @@
+{
+ "name": "underscore",
+ "description": "JavaScript's functional programming helper library.",
+ "homepage": "http://underscorejs.org",
+ "keywords": [
+ "util",
+ "functional",
+ "server",
+ "client",
+ "browser"
+ ],
+ "author": {
+ "name": "Jeremy Ashkenas",
+ "email": "jeremy@documentcloud.org"
+ },
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/jashkenas/underscore.git"
+ },
+ "main": "underscore.js",
+ "version": "1.6.0",
+ "devDependencies": {
+ "docco": "0.6.x",
+ "phantomjs": "1.9.0-1",
+ "uglify-js": "2.4.x"
+ },
+ "scripts": {
+ "test": "phantomjs test/vendor/runner.js test/index.html?noglobals=true",
+ "build": "uglifyjs underscore.js -c \"evaluate=false\" --comments \"/ .*/\" -m --source-map underscore-min.map -o underscore-min.js",
+ "doc": "docco underscore.js"
+ },
+ "licenses": [
+ {
+ "type": "MIT",
+ "url": "https://raw.github.com/jashkenas/underscore/master/LICENSE"
+ }
+ ],
+ "files": [
+ "underscore.js",
+ "underscore-min.js",
+ "LICENSE"
+ ],
+ "bugs": {
+ "url": "https://github.com/jashkenas/underscore/issues"
+ },
+ "_id": "underscore@1.6.0",
+ "dist": {
+ "shasum": "8b38b10cacdef63337b8b24e4ff86d45aea529a8",
+ "tarball": "http://registry.npmjs.org/underscore/-/underscore-1.6.0.tgz"
+ },
+ "_from": "underscore@>= 1.3.0",
+ "_npmVersion": "1.3.21",
+ "_npmUser": {
+ "name": "jashkenas",
+ "email": "jashkenas@gmail.com"
+ },
+ "maintainers": [
+ {
+ "name": "jashkenas",
+ "email": "jashkenas@gmail.com"
+ }
+ ],
+ "directories": {},
+ "_shasum": "8b38b10cacdef63337b8b24e4ff86d45aea529a8",
+ "_resolved": "https://registry.npmjs.org/underscore/-/underscore-1.6.0.tgz",
+ "readme": "ERROR: No README data found!"
+}
diff --git a/deps/npm/node_modules/columnify/node_modules/wcwidth.js/node_modules/underscore/underscore-min.js b/deps/npm/node_modules/columnify/node_modules/wcwidth.js/node_modules/underscore/underscore-min.js
new file mode 100644
index 0000000000..3434d6c590
--- /dev/null
+++ b/deps/npm/node_modules/columnify/node_modules/wcwidth.js/node_modules/underscore/underscore-min.js
@@ -0,0 +1,6 @@
+// Underscore.js 1.6.0
+// http://underscorejs.org
+// (c) 2009-2014 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
+// Underscore may be freely distributed under the MIT license.
+(function(){var n=this,t=n._,r={},e=Array.prototype,u=Object.prototype,i=Function.prototype,a=e.push,o=e.slice,c=e.concat,l=u.toString,f=u.hasOwnProperty,s=e.forEach,p=e.map,h=e.reduce,v=e.reduceRight,g=e.filter,d=e.every,m=e.some,y=e.indexOf,b=e.lastIndexOf,x=Array.isArray,w=Object.keys,_=i.bind,j=function(n){return n instanceof j?n:this instanceof j?void(this._wrapped=n):new j(n)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=j),exports._=j):n._=j,j.VERSION="1.6.0";var A=j.each=j.forEach=function(n,t,e){if(null==n)return n;if(s&&n.forEach===s)n.forEach(t,e);else if(n.length===+n.length){for(var u=0,i=n.length;i>u;u++)if(t.call(e,n[u],u,n)===r)return}else for(var a=j.keys(n),u=0,i=a.length;i>u;u++)if(t.call(e,n[a[u]],a[u],n)===r)return;return n};j.map=j.collect=function(n,t,r){var e=[];return null==n?e:p&&n.map===p?n.map(t,r):(A(n,function(n,u,i){e.push(t.call(r,n,u,i))}),e)};var O="Reduce of empty array with no initial value";j.reduce=j.foldl=j.inject=function(n,t,r,e){var u=arguments.length>2;if(null==n&&(n=[]),h&&n.reduce===h)return e&&(t=j.bind(t,e)),u?n.reduce(t,r):n.reduce(t);if(A(n,function(n,i,a){u?r=t.call(e,r,n,i,a):(r=n,u=!0)}),!u)throw new TypeError(O);return r},j.reduceRight=j.foldr=function(n,t,r,e){var u=arguments.length>2;if(null==n&&(n=[]),v&&n.reduceRight===v)return e&&(t=j.bind(t,e)),u?n.reduceRight(t,r):n.reduceRight(t);var i=n.length;if(i!==+i){var a=j.keys(n);i=a.length}if(A(n,function(o,c,l){c=a?a[--i]:--i,u?r=t.call(e,r,n[c],c,l):(r=n[c],u=!0)}),!u)throw new TypeError(O);return r},j.find=j.detect=function(n,t,r){var e;return k(n,function(n,u,i){return t.call(r,n,u,i)?(e=n,!0):void 0}),e},j.filter=j.select=function(n,t,r){var e=[];return null==n?e:g&&n.filter===g?n.filter(t,r):(A(n,function(n,u,i){t.call(r,n,u,i)&&e.push(n)}),e)},j.reject=function(n,t,r){return j.filter(n,function(n,e,u){return!t.call(r,n,e,u)},r)},j.every=j.all=function(n,t,e){t||(t=j.identity);var u=!0;return null==n?u:d&&n.every===d?n.every(t,e):(A(n,function(n,i,a){return(u=u&&t.call(e,n,i,a))?void 0:r}),!!u)};var k=j.some=j.any=function(n,t,e){t||(t=j.identity);var u=!1;return null==n?u:m&&n.some===m?n.some(t,e):(A(n,function(n,i,a){return u||(u=t.call(e,n,i,a))?r:void 0}),!!u)};j.contains=j.include=function(n,t){return null==n?!1:y&&n.indexOf===y?n.indexOf(t)!=-1:k(n,function(n){return n===t})},j.invoke=function(n,t){var r=o.call(arguments,2),e=j.isFunction(t);return j.map(n,function(n){return(e?t:n[t]).apply(n,r)})},j.pluck=function(n,t){return j.map(n,j.property(t))},j.where=function(n,t){return j.filter(n,j.matches(t))},j.findWhere=function(n,t){return j.find(n,j.matches(t))},j.max=function(n,t,r){if(!t&&j.isArray(n)&&n[0]===+n[0]&&n.length<65535)return Math.max.apply(Math,n);var e=-1/0,u=-1/0;return A(n,function(n,i,a){var o=t?t.call(r,n,i,a):n;o>u&&(e=n,u=o)}),e},j.min=function(n,t,r){if(!t&&j.isArray(n)&&n[0]===+n[0]&&n.length<65535)return Math.min.apply(Math,n);var e=1/0,u=1/0;return A(n,function(n,i,a){var o=t?t.call(r,n,i,a):n;u>o&&(e=n,u=o)}),e},j.shuffle=function(n){var t,r=0,e=[];return A(n,function(n){t=j.random(r++),e[r-1]=e[t],e[t]=n}),e},j.sample=function(n,t,r){return null==t||r?(n.length!==+n.length&&(n=j.values(n)),n[j.random(n.length-1)]):j.shuffle(n).slice(0,Math.max(0,t))};var E=function(n){return null==n?j.identity:j.isFunction(n)?n:j.property(n)};j.sortBy=function(n,t,r){return t=E(t),j.pluck(j.map(n,function(n,e,u){return{value:n,index:e,criteria:t.call(r,n,e,u)}}).sort(function(n,t){var r=n.criteria,e=t.criteria;if(r!==e){if(r>e||r===void 0)return 1;if(e>r||e===void 0)return-1}return n.index-t.index}),"value")};var F=function(n){return function(t,r,e){var u={};return r=E(r),A(t,function(i,a){var o=r.call(e,i,a,t);n(u,o,i)}),u}};j.groupBy=F(function(n,t,r){j.has(n,t)?n[t].push(r):n[t]=[r]}),j.indexBy=F(function(n,t,r){n[t]=r}),j.countBy=F(function(n,t){j.has(n,t)?n[t]++:n[t]=1}),j.sortedIndex=function(n,t,r,e){r=E(r);for(var u=r.call(e,t),i=0,a=n.length;a>i;){var o=i+a>>>1;r.call(e,n[o])<u?i=o+1:a=o}return i},j.toArray=function(n){return n?j.isArray(n)?o.call(n):n.length===+n.length?j.map(n,j.identity):j.values(n):[]},j.size=function(n){return null==n?0:n.length===+n.length?n.length:j.keys(n).length},j.first=j.head=j.take=function(n,t,r){return null==n?void 0:null==t||r?n[0]:0>t?[]:o.call(n,0,t)},j.initial=function(n,t,r){return o.call(n,0,n.length-(null==t||r?1:t))},j.last=function(n,t,r){return null==n?void 0:null==t||r?n[n.length-1]:o.call(n,Math.max(n.length-t,0))},j.rest=j.tail=j.drop=function(n,t,r){return o.call(n,null==t||r?1:t)},j.compact=function(n){return j.filter(n,j.identity)};var M=function(n,t,r){return t&&j.every(n,j.isArray)?c.apply(r,n):(A(n,function(n){j.isArray(n)||j.isArguments(n)?t?a.apply(r,n):M(n,t,r):r.push(n)}),r)};j.flatten=function(n,t){return M(n,t,[])},j.without=function(n){return j.difference(n,o.call(arguments,1))},j.partition=function(n,t){var r=[],e=[];return A(n,function(n){(t(n)?r:e).push(n)}),[r,e]},j.uniq=j.unique=function(n,t,r,e){j.isFunction(t)&&(e=r,r=t,t=!1);var u=r?j.map(n,r,e):n,i=[],a=[];return A(u,function(r,e){(t?e&&a[a.length-1]===r:j.contains(a,r))||(a.push(r),i.push(n[e]))}),i},j.union=function(){return j.uniq(j.flatten(arguments,!0))},j.intersection=function(n){var t=o.call(arguments,1);return j.filter(j.uniq(n),function(n){return j.every(t,function(t){return j.contains(t,n)})})},j.difference=function(n){var t=c.apply(e,o.call(arguments,1));return j.filter(n,function(n){return!j.contains(t,n)})},j.zip=function(){for(var n=j.max(j.pluck(arguments,"length").concat(0)),t=new Array(n),r=0;n>r;r++)t[r]=j.pluck(arguments,""+r);return t},j.object=function(n,t){if(null==n)return{};for(var r={},e=0,u=n.length;u>e;e++)t?r[n[e]]=t[e]:r[n[e][0]]=n[e][1];return r},j.indexOf=function(n,t,r){if(null==n)return-1;var e=0,u=n.length;if(r){if("number"!=typeof r)return e=j.sortedIndex(n,t),n[e]===t?e:-1;e=0>r?Math.max(0,u+r):r}if(y&&n.indexOf===y)return n.indexOf(t,r);for(;u>e;e++)if(n[e]===t)return e;return-1},j.lastIndexOf=function(n,t,r){if(null==n)return-1;var e=null!=r;if(b&&n.lastIndexOf===b)return e?n.lastIndexOf(t,r):n.lastIndexOf(t);for(var u=e?r:n.length;u--;)if(n[u]===t)return u;return-1},j.range=function(n,t,r){arguments.length<=1&&(t=n||0,n=0),r=arguments[2]||1;for(var e=Math.max(Math.ceil((t-n)/r),0),u=0,i=new Array(e);e>u;)i[u++]=n,n+=r;return i};var R=function(){};j.bind=function(n,t){var r,e;if(_&&n.bind===_)return _.apply(n,o.call(arguments,1));if(!j.isFunction(n))throw new TypeError;return r=o.call(arguments,2),e=function(){if(!(this instanceof e))return n.apply(t,r.concat(o.call(arguments)));R.prototype=n.prototype;var u=new R;R.prototype=null;var i=n.apply(u,r.concat(o.call(arguments)));return Object(i)===i?i:u}},j.partial=function(n){var t=o.call(arguments,1);return function(){for(var r=0,e=t.slice(),u=0,i=e.length;i>u;u++)e[u]===j&&(e[u]=arguments[r++]);for(;r<arguments.length;)e.push(arguments[r++]);return n.apply(this,e)}},j.bindAll=function(n){var t=o.call(arguments,1);if(0===t.length)throw new Error("bindAll must be passed function names");return A(t,function(t){n[t]=j.bind(n[t],n)}),n},j.memoize=function(n,t){var r={};return t||(t=j.identity),function(){var e=t.apply(this,arguments);return j.has(r,e)?r[e]:r[e]=n.apply(this,arguments)}},j.delay=function(n,t){var r=o.call(arguments,2);return setTimeout(function(){return n.apply(null,r)},t)},j.defer=function(n){return j.delay.apply(j,[n,1].concat(o.call(arguments,1)))},j.throttle=function(n,t,r){var e,u,i,a=null,o=0;r||(r={});var c=function(){o=r.leading===!1?0:j.now(),a=null,i=n.apply(e,u),e=u=null};return function(){var l=j.now();o||r.leading!==!1||(o=l);var f=t-(l-o);return e=this,u=arguments,0>=f?(clearTimeout(a),a=null,o=l,i=n.apply(e,u),e=u=null):a||r.trailing===!1||(a=setTimeout(c,f)),i}},j.debounce=function(n,t,r){var e,u,i,a,o,c=function(){var l=j.now()-a;t>l?e=setTimeout(c,t-l):(e=null,r||(o=n.apply(i,u),i=u=null))};return function(){i=this,u=arguments,a=j.now();var l=r&&!e;return e||(e=setTimeout(c,t)),l&&(o=n.apply(i,u),i=u=null),o}},j.once=function(n){var t,r=!1;return function(){return r?t:(r=!0,t=n.apply(this,arguments),n=null,t)}},j.wrap=function(n,t){return j.partial(t,n)},j.compose=function(){var n=arguments;return function(){for(var t=arguments,r=n.length-1;r>=0;r--)t=[n[r].apply(this,t)];return t[0]}},j.after=function(n,t){return function(){return--n<1?t.apply(this,arguments):void 0}},j.keys=function(n){if(!j.isObject(n))return[];if(w)return w(n);var t=[];for(var r in n)j.has(n,r)&&t.push(r);return t},j.values=function(n){for(var t=j.keys(n),r=t.length,e=new Array(r),u=0;r>u;u++)e[u]=n[t[u]];return e},j.pairs=function(n){for(var t=j.keys(n),r=t.length,e=new Array(r),u=0;r>u;u++)e[u]=[t[u],n[t[u]]];return e},j.invert=function(n){for(var t={},r=j.keys(n),e=0,u=r.length;u>e;e++)t[n[r[e]]]=r[e];return t},j.functions=j.methods=function(n){var t=[];for(var r in n)j.isFunction(n[r])&&t.push(r);return t.sort()},j.extend=function(n){return A(o.call(arguments,1),function(t){if(t)for(var r in t)n[r]=t[r]}),n},j.pick=function(n){var t={},r=c.apply(e,o.call(arguments,1));return A(r,function(r){r in n&&(t[r]=n[r])}),t},j.omit=function(n){var t={},r=c.apply(e,o.call(arguments,1));for(var u in n)j.contains(r,u)||(t[u]=n[u]);return t},j.defaults=function(n){return A(o.call(arguments,1),function(t){if(t)for(var r in t)n[r]===void 0&&(n[r]=t[r])}),n},j.clone=function(n){return j.isObject(n)?j.isArray(n)?n.slice():j.extend({},n):n},j.tap=function(n,t){return t(n),n};var S=function(n,t,r,e){if(n===t)return 0!==n||1/n==1/t;if(null==n||null==t)return n===t;n instanceof j&&(n=n._wrapped),t instanceof j&&(t=t._wrapped);var u=l.call(n);if(u!=l.call(t))return!1;switch(u){case"[object String]":return n==String(t);case"[object Number]":return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case"[object Date]":case"[object Boolean]":return+n==+t;case"[object RegExp]":return n.source==t.source&&n.global==t.global&&n.multiline==t.multiline&&n.ignoreCase==t.ignoreCase}if("object"!=typeof n||"object"!=typeof t)return!1;for(var i=r.length;i--;)if(r[i]==n)return e[i]==t;var a=n.constructor,o=t.constructor;if(a!==o&&!(j.isFunction(a)&&a instanceof a&&j.isFunction(o)&&o instanceof o)&&"constructor"in n&&"constructor"in t)return!1;r.push(n),e.push(t);var c=0,f=!0;if("[object Array]"==u){if(c=n.length,f=c==t.length)for(;c--&&(f=S(n[c],t[c],r,e)););}else{for(var s in n)if(j.has(n,s)&&(c++,!(f=j.has(t,s)&&S(n[s],t[s],r,e))))break;if(f){for(s in t)if(j.has(t,s)&&!c--)break;f=!c}}return r.pop(),e.pop(),f};j.isEqual=function(n,t){return S(n,t,[],[])},j.isEmpty=function(n){if(null==n)return!0;if(j.isArray(n)||j.isString(n))return 0===n.length;for(var t in n)if(j.has(n,t))return!1;return!0},j.isElement=function(n){return!(!n||1!==n.nodeType)},j.isArray=x||function(n){return"[object Array]"==l.call(n)},j.isObject=function(n){return n===Object(n)},A(["Arguments","Function","String","Number","Date","RegExp"],function(n){j["is"+n]=function(t){return l.call(t)=="[object "+n+"]"}}),j.isArguments(arguments)||(j.isArguments=function(n){return!(!n||!j.has(n,"callee"))}),"function"!=typeof/./&&(j.isFunction=function(n){return"function"==typeof n}),j.isFinite=function(n){return isFinite(n)&&!isNaN(parseFloat(n))},j.isNaN=function(n){return j.isNumber(n)&&n!=+n},j.isBoolean=function(n){return n===!0||n===!1||"[object Boolean]"==l.call(n)},j.isNull=function(n){return null===n},j.isUndefined=function(n){return n===void 0},j.has=function(n,t){return f.call(n,t)},j.noConflict=function(){return n._=t,this},j.identity=function(n){return n},j.constant=function(n){return function(){return n}},j.property=function(n){return function(t){return t[n]}},j.matches=function(n){return function(t){if(t===n)return!0;for(var r in n)if(n[r]!==t[r])return!1;return!0}},j.times=function(n,t,r){for(var e=Array(Math.max(0,n)),u=0;n>u;u++)e[u]=t.call(r,u);return e},j.random=function(n,t){return null==t&&(t=n,n=0),n+Math.floor(Math.random()*(t-n+1))},j.now=Date.now||function(){return(new Date).getTime()};var T={escape:{"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;"}};T.unescape=j.invert(T.escape);var I={escape:new RegExp("["+j.keys(T.escape).join("")+"]","g"),unescape:new RegExp("("+j.keys(T.unescape).join("|")+")","g")};j.each(["escape","unescape"],function(n){j[n]=function(t){return null==t?"":(""+t).replace(I[n],function(t){return T[n][t]})}}),j.result=function(n,t){if(null==n)return void 0;var r=n[t];return j.isFunction(r)?r.call(n):r},j.mixin=function(n){A(j.functions(n),function(t){var r=j[t]=n[t];j.prototype[t]=function(){var n=[this._wrapped];return a.apply(n,arguments),z.call(this,r.apply(j,n))}})};var N=0;j.uniqueId=function(n){var t=++N+"";return n?n+t:t},j.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var q=/(.)^/,B={"'":"'","\\":"\\","\r":"r","\n":"n"," ":"t","\u2028":"u2028","\u2029":"u2029"},D=/\\|'|\r|\n|\t|\u2028|\u2029/g;j.template=function(n,t,r){var e;r=j.defaults({},r,j.templateSettings);var u=new RegExp([(r.escape||q).source,(r.interpolate||q).source,(r.evaluate||q).source].join("|")+"|$","g"),i=0,a="__p+='";n.replace(u,function(t,r,e,u,o){return a+=n.slice(i,o).replace(D,function(n){return"\\"+B[n]}),r&&(a+="'+\n((__t=("+r+"))==null?'':_.escape(__t))+\n'"),e&&(a+="'+\n((__t=("+e+"))==null?'':__t)+\n'"),u&&(a+="';\n"+u+"\n__p+='"),i=o+t.length,t}),a+="';\n",r.variable||(a="with(obj||{}){\n"+a+"}\n"),a="var __t,__p='',__j=Array.prototype.join,"+"print=function(){__p+=__j.call(arguments,'');};\n"+a+"return __p;\n";try{e=new Function(r.variable||"obj","_",a)}catch(o){throw o.source=a,o}if(t)return e(t,j);var c=function(n){return e.call(this,n,j)};return c.source="function("+(r.variable||"obj")+"){\n"+a+"}",c},j.chain=function(n){return j(n).chain()};var z=function(n){return this._chain?j(n).chain():n};j.mixin(j),A(["pop","push","reverse","shift","sort","splice","unshift"],function(n){var t=e[n];j.prototype[n]=function(){var r=this._wrapped;return t.apply(r,arguments),"shift"!=n&&"splice"!=n||0!==r.length||delete r[0],z.call(this,r)}}),A(["concat","join","slice"],function(n){var t=e[n];j.prototype[n]=function(){return z.call(this,t.apply(this._wrapped,arguments))}}),j.extend(j.prototype,{chain:function(){return this._chain=!0,this},value:function(){return this._wrapped}}),"function"==typeof define&&define.amd&&define("underscore",[],function(){return j})}).call(this);
+//# sourceMappingURL=underscore-min.map \ No newline at end of file
diff --git a/deps/npm/node_modules/columnify/node_modules/wcwidth.js/node_modules/underscore/underscore.js b/deps/npm/node_modules/columnify/node_modules/wcwidth.js/node_modules/underscore/underscore.js
new file mode 100644
index 0000000000..9a4cabecf7
--- /dev/null
+++ b/deps/npm/node_modules/columnify/node_modules/wcwidth.js/node_modules/underscore/underscore.js
@@ -0,0 +1,1343 @@
+// Underscore.js 1.6.0
+// http://underscorejs.org
+// (c) 2009-2014 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
+// Underscore may be freely distributed under the MIT license.
+
+(function() {
+
+ // Baseline setup
+ // --------------
+
+ // Establish the root object, `window` in the browser, or `exports` on the server.
+ var root = this;
+
+ // Save the previous value of the `_` variable.
+ var previousUnderscore = root._;
+
+ // Establish the object that gets returned to break out of a loop iteration.
+ var breaker = {};
+
+ // Save bytes in the minified (but not gzipped) version:
+ var ArrayProto = Array.prototype, ObjProto = Object.prototype, FuncProto = Function.prototype;
+
+ // Create quick reference variables for speed access to core prototypes.
+ var
+ push = ArrayProto.push,
+ slice = ArrayProto.slice,
+ concat = ArrayProto.concat,
+ toString = ObjProto.toString,
+ hasOwnProperty = ObjProto.hasOwnProperty;
+
+ // All **ECMAScript 5** native function implementations that we hope to use
+ // are declared here.
+ var
+ nativeForEach = ArrayProto.forEach,
+ nativeMap = ArrayProto.map,
+ nativeReduce = ArrayProto.reduce,
+ nativeReduceRight = ArrayProto.reduceRight,
+ nativeFilter = ArrayProto.filter,
+ nativeEvery = ArrayProto.every,
+ nativeSome = ArrayProto.some,
+ nativeIndexOf = ArrayProto.indexOf,
+ nativeLastIndexOf = ArrayProto.lastIndexOf,
+ nativeIsArray = Array.isArray,
+ nativeKeys = Object.keys,
+ nativeBind = FuncProto.bind;
+
+ // Create a safe reference to the Underscore object for use below.
+ var _ = function(obj) {
+ if (obj instanceof _) return obj;
+ if (!(this instanceof _)) return new _(obj);
+ this._wrapped = obj;
+ };
+
+ // Export the Underscore object for **Node.js**, with
+ // backwards-compatibility for the old `require()` API. If we're in
+ // the browser, add `_` as a global object via a string identifier,
+ // for Closure Compiler "advanced" mode.
+ if (typeof exports !== 'undefined') {
+ if (typeof module !== 'undefined' && module.exports) {
+ exports = module.exports = _;
+ }
+ exports._ = _;
+ } else {
+ root._ = _;
+ }
+
+ // Current version.
+ _.VERSION = '1.6.0';
+
+ // Collection Functions
+ // --------------------
+
+ // The cornerstone, an `each` implementation, aka `forEach`.
+ // Handles objects with the built-in `forEach`, arrays, and raw objects.
+ // Delegates to **ECMAScript 5**'s native `forEach` if available.
+ var each = _.each = _.forEach = function(obj, iterator, context) {
+ if (obj == null) return obj;
+ if (nativeForEach && obj.forEach === nativeForEach) {
+ obj.forEach(iterator, context);
+ } else if (obj.length === +obj.length) {
+ for (var i = 0, length = obj.length; i < length; i++) {
+ if (iterator.call(context, obj[i], i, obj) === breaker) return;
+ }
+ } else {
+ var keys = _.keys(obj);
+ for (var i = 0, length = keys.length; i < length; i++) {
+ if (iterator.call(context, obj[keys[i]], keys[i], obj) === breaker) return;
+ }
+ }
+ return obj;
+ };
+
+ // Return the results of applying the iterator to each element.
+ // Delegates to **ECMAScript 5**'s native `map` if available.
+ _.map = _.collect = function(obj, iterator, context) {
+ var results = [];
+ if (obj == null) return results;
+ if (nativeMap && obj.map === nativeMap) return obj.map(iterator, context);
+ each(obj, function(value, index, list) {
+ results.push(iterator.call(context, value, index, list));
+ });
+ return results;
+ };
+
+ var reduceError = 'Reduce of empty array with no initial value';
+
+ // **Reduce** builds up a single result from a list of values, aka `inject`,
+ // or `foldl`. Delegates to **ECMAScript 5**'s native `reduce` if available.
+ _.reduce = _.foldl = _.inject = function(obj, iterator, memo, context) {
+ var initial = arguments.length > 2;
+ if (obj == null) obj = [];
+ if (nativeReduce && obj.reduce === nativeReduce) {
+ if (context) iterator = _.bind(iterator, context);
+ return initial ? obj.reduce(iterator, memo) : obj.reduce(iterator);
+ }
+ each(obj, function(value, index, list) {
+ if (!initial) {
+ memo = value;
+ initial = true;
+ } else {
+ memo = iterator.call(context, memo, value, index, list);
+ }
+ });
+ if (!initial) throw new TypeError(reduceError);
+ return memo;
+ };
+
+ // The right-associative version of reduce, also known as `foldr`.
+ // Delegates to **ECMAScript 5**'s native `reduceRight` if available.
+ _.reduceRight = _.foldr = function(obj, iterator, memo, context) {
+ var initial = arguments.length > 2;
+ if (obj == null) obj = [];
+ if (nativeReduceRight && obj.reduceRight === nativeReduceRight) {
+ if (context) iterator = _.bind(iterator, context);
+ return initial ? obj.reduceRight(iterator, memo) : obj.reduceRight(iterator);
+ }
+ var length = obj.length;
+ if (length !== +length) {
+ var keys = _.keys(obj);
+ length = keys.length;
+ }
+ each(obj, function(value, index, list) {
+ index = keys ? keys[--length] : --length;
+ if (!initial) {
+ memo = obj[index];
+ initial = true;
+ } else {
+ memo = iterator.call(context, memo, obj[index], index, list);
+ }
+ });
+ if (!initial) throw new TypeError(reduceError);
+ return memo;
+ };
+
+ // Return the first value which passes a truth test. Aliased as `detect`.
+ _.find = _.detect = function(obj, predicate, context) {
+ var result;
+ any(obj, function(value, index, list) {
+ if (predicate.call(context, value, index, list)) {
+ result = value;
+ return true;
+ }
+ });
+ return result;
+ };
+
+ // Return all the elements that pass a truth test.
+ // Delegates to **ECMAScript 5**'s native `filter` if available.
+ // Aliased as `select`.
+ _.filter = _.select = function(obj, predicate, context) {
+ var results = [];
+ if (obj == null) return results;
+ if (nativeFilter && obj.filter === nativeFilter) return obj.filter(predicate, context);
+ each(obj, function(value, index, list) {
+ if (predicate.call(context, value, index, list)) results.push(value);
+ });
+ return results;
+ };
+
+ // Return all the elements for which a truth test fails.
+ _.reject = function(obj, predicate, context) {
+ return _.filter(obj, function(value, index, list) {
+ return !predicate.call(context, value, index, list);
+ }, context);
+ };
+
+ // Determine whether all of the elements match a truth test.
+ // Delegates to **ECMAScript 5**'s native `every` if available.
+ // Aliased as `all`.
+ _.every = _.all = function(obj, predicate, context) {
+ predicate || (predicate = _.identity);
+ var result = true;
+ if (obj == null) return result;
+ if (nativeEvery && obj.every === nativeEvery) return obj.every(predicate, context);
+ each(obj, function(value, index, list) {
+ if (!(result = result && predicate.call(context, value, index, list))) return breaker;
+ });
+ return !!result;
+ };
+
+ // Determine if at least one element in the object matches a truth test.
+ // Delegates to **ECMAScript 5**'s native `some` if available.
+ // Aliased as `any`.
+ var any = _.some = _.any = function(obj, predicate, context) {
+ predicate || (predicate = _.identity);
+ var result = false;
+ if (obj == null) return result;
+ if (nativeSome && obj.some === nativeSome) return obj.some(predicate, context);
+ each(obj, function(value, index, list) {
+ if (result || (result = predicate.call(context, value, index, list))) return breaker;
+ });
+ return !!result;
+ };
+
+ // Determine if the array or object contains a given value (using `===`).
+ // Aliased as `include`.
+ _.contains = _.include = function(obj, target) {
+ if (obj == null) return false;
+ if (nativeIndexOf && obj.indexOf === nativeIndexOf) return obj.indexOf(target) != -1;
+ return any(obj, function(value) {
+ return value === target;
+ });
+ };
+
+ // Invoke a method (with arguments) on every item in a collection.
+ _.invoke = function(obj, method) {
+ var args = slice.call(arguments, 2);
+ var isFunc = _.isFunction(method);
+ return _.map(obj, function(value) {
+ return (isFunc ? method : value[method]).apply(value, args);
+ });
+ };
+
+ // Convenience version of a common use case of `map`: fetching a property.
+ _.pluck = function(obj, key) {
+ return _.map(obj, _.property(key));
+ };
+
+ // Convenience version of a common use case of `filter`: selecting only objects
+ // containing specific `key:value` pairs.
+ _.where = function(obj, attrs) {
+ return _.filter(obj, _.matches(attrs));
+ };
+
+ // Convenience version of a common use case of `find`: getting the first object
+ // containing specific `key:value` pairs.
+ _.findWhere = function(obj, attrs) {
+ return _.find(obj, _.matches(attrs));
+ };
+
+ // Return the maximum element or (element-based computation).
+ // Can't optimize arrays of integers longer than 65,535 elements.
+ // See [WebKit Bug 80797](https://bugs.webkit.org/show_bug.cgi?id=80797)
+ _.max = function(obj, iterator, context) {
+ if (!iterator && _.isArray(obj) && obj[0] === +obj[0] && obj.length < 65535) {
+ return Math.max.apply(Math, obj);
+ }
+ var result = -Infinity, lastComputed = -Infinity;
+ each(obj, function(value, index, list) {
+ var computed = iterator ? iterator.call(context, value, index, list) : value;
+ if (computed > lastComputed) {
+ result = value;
+ lastComputed = computed;
+ }
+ });
+ return result;
+ };
+
+ // Return the minimum element (or element-based computation).
+ _.min = function(obj, iterator, context) {
+ if (!iterator && _.isArray(obj) && obj[0] === +obj[0] && obj.length < 65535) {
+ return Math.min.apply(Math, obj);
+ }
+ var result = Infinity, lastComputed = Infinity;
+ each(obj, function(value, index, list) {
+ var computed = iterator ? iterator.call(context, value, index, list) : value;
+ if (computed < lastComputed) {
+ result = value;
+ lastComputed = computed;
+ }
+ });
+ return result;
+ };
+
+ // Shuffle an array, using the modern version of the
+ // [Fisher-Yates shuffle](http://en.wikipedia.org/wiki/Fisher–Yates_shuffle).
+ _.shuffle = function(obj) {
+ var rand;
+ var index = 0;
+ var shuffled = [];
+ each(obj, function(value) {
+ rand = _.random(index++);
+ shuffled[index - 1] = shuffled[rand];
+ shuffled[rand] = value;
+ });
+ return shuffled;
+ };
+
+ // Sample **n** random values from a collection.
+ // If **n** is not specified, returns a single random element.
+ // The internal `guard` argument allows it to work with `map`.
+ _.sample = function(obj, n, guard) {
+ if (n == null || guard) {
+ if (obj.length !== +obj.length) obj = _.values(obj);
+ return obj[_.random(obj.length - 1)];
+ }
+ return _.shuffle(obj).slice(0, Math.max(0, n));
+ };
+
+ // An internal function to generate lookup iterators.
+ var lookupIterator = function(value) {
+ if (value == null) return _.identity;
+ if (_.isFunction(value)) return value;
+ return _.property(value);
+ };
+
+ // Sort the object's values by a criterion produced by an iterator.
+ _.sortBy = function(obj, iterator, context) {
+ iterator = lookupIterator(iterator);
+ return _.pluck(_.map(obj, function(value, index, list) {
+ return {
+ value: value,
+ index: index,
+ criteria: iterator.call(context, value, index, list)
+ };
+ }).sort(function(left, right) {
+ var a = left.criteria;
+ var b = right.criteria;
+ if (a !== b) {
+ if (a > b || a === void 0) return 1;
+ if (a < b || b === void 0) return -1;
+ }
+ return left.index - right.index;
+ }), 'value');
+ };
+
+ // An internal function used for aggregate "group by" operations.
+ var group = function(behavior) {
+ return function(obj, iterator, context) {
+ var result = {};
+ iterator = lookupIterator(iterator);
+ each(obj, function(value, index) {
+ var key = iterator.call(context, value, index, obj);
+ behavior(result, key, value);
+ });
+ return result;
+ };
+ };
+
+ // Groups the object's values by a criterion. Pass either a string attribute
+ // to group by, or a function that returns the criterion.
+ _.groupBy = group(function(result, key, value) {
+ _.has(result, key) ? result[key].push(value) : result[key] = [value];
+ });
+
+ // Indexes the object's values by a criterion, similar to `groupBy`, but for
+ // when you know that your index values will be unique.
+ _.indexBy = group(function(result, key, value) {
+ result[key] = value;
+ });
+
+ // Counts instances of an object that group by a certain criterion. Pass
+ // either a string attribute to count by, or a function that returns the
+ // criterion.
+ _.countBy = group(function(result, key) {
+ _.has(result, key) ? result[key]++ : result[key] = 1;
+ });
+
+ // Use a comparator function to figure out the smallest index at which
+ // an object should be inserted so as to maintain order. Uses binary search.
+ _.sortedIndex = function(array, obj, iterator, context) {
+ iterator = lookupIterator(iterator);
+ var value = iterator.call(context, obj);
+ var low = 0, high = array.length;
+ while (low < high) {
+ var mid = (low + high) >>> 1;
+ iterator.call(context, array[mid]) < value ? low = mid + 1 : high = mid;
+ }
+ return low;
+ };
+
+ // Safely create a real, live array from anything iterable.
+ _.toArray = function(obj) {
+ if (!obj) return [];
+ if (_.isArray(obj)) return slice.call(obj);
+ if (obj.length === +obj.length) return _.map(obj, _.identity);
+ return _.values(obj);
+ };
+
+ // Return the number of elements in an object.
+ _.size = function(obj) {
+ if (obj == null) return 0;
+ return (obj.length === +obj.length) ? obj.length : _.keys(obj).length;
+ };
+
+ // Array Functions
+ // ---------------
+
+ // Get the first element of an array. Passing **n** will return the first N
+ // values in the array. Aliased as `head` and `take`. The **guard** check
+ // allows it to work with `_.map`.
+ _.first = _.head = _.take = function(array, n, guard) {
+ if (array == null) return void 0;
+ if ((n == null) || guard) return array[0];
+ if (n < 0) return [];
+ return slice.call(array, 0, n);
+ };
+
+ // Returns everything but the last entry of the array. Especially useful on
+ // the arguments object. Passing **n** will return all the values in
+ // the array, excluding the last N. The **guard** check allows it to work with
+ // `_.map`.
+ _.initial = function(array, n, guard) {
+ return slice.call(array, 0, array.length - ((n == null) || guard ? 1 : n));
+ };
+
+ // Get the last element of an array. Passing **n** will return the last N
+ // values in the array. The **guard** check allows it to work with `_.map`.
+ _.last = function(array, n, guard) {
+ if (array == null) return void 0;
+ if ((n == null) || guard) return array[array.length - 1];
+ return slice.call(array, Math.max(array.length - n, 0));
+ };
+
+ // Returns everything but the first entry of the array. Aliased as `tail` and `drop`.
+ // Especially useful on the arguments object. Passing an **n** will return
+ // the rest N values in the array. The **guard**
+ // check allows it to work with `_.map`.
+ _.rest = _.tail = _.drop = function(array, n, guard) {
+ return slice.call(array, (n == null) || guard ? 1 : n);
+ };
+
+ // Trim out all falsy values from an array.
+ _.compact = function(array) {
+ return _.filter(array, _.identity);
+ };
+
+ // Internal implementation of a recursive `flatten` function.
+ var flatten = function(input, shallow, output) {
+ if (shallow && _.every(input, _.isArray)) {
+ return concat.apply(output, input);
+ }
+ each(input, function(value) {
+ if (_.isArray(value) || _.isArguments(value)) {
+ shallow ? push.apply(output, value) : flatten(value, shallow, output);
+ } else {
+ output.push(value);
+ }
+ });
+ return output;
+ };
+
+ // Flatten out an array, either recursively (by default), or just one level.
+ _.flatten = function(array, shallow) {
+ return flatten(array, shallow, []);
+ };
+
+ // Return a version of the array that does not contain the specified value(s).
+ _.without = function(array) {
+ return _.difference(array, slice.call(arguments, 1));
+ };
+
+ // Split an array into two arrays: one whose elements all satisfy the given
+ // predicate, and one whose elements all do not satisfy the predicate.
+ _.partition = function(array, predicate) {
+ var pass = [], fail = [];
+ each(array, function(elem) {
+ (predicate(elem) ? pass : fail).push(elem);
+ });
+ return [pass, fail];
+ };
+
+ // Produce a duplicate-free version of the array. If the array has already
+ // been sorted, you have the option of using a faster algorithm.
+ // Aliased as `unique`.
+ _.uniq = _.unique = function(array, isSorted, iterator, context) {
+ if (_.isFunction(isSorted)) {
+ context = iterator;
+ iterator = isSorted;
+ isSorted = false;
+ }
+ var initial = iterator ? _.map(array, iterator, context) : array;
+ var results = [];
+ var seen = [];
+ each(initial, function(value, index) {
+ if (isSorted ? (!index || seen[seen.length - 1] !== value) : !_.contains(seen, value)) {
+ seen.push(value);
+ results.push(array[index]);
+ }
+ });
+ return results;
+ };
+
+ // Produce an array that contains the union: each distinct element from all of
+ // the passed-in arrays.
+ _.union = function() {
+ return _.uniq(_.flatten(arguments, true));
+ };
+
+ // Produce an array that contains every item shared between all the
+ // passed-in arrays.
+ _.intersection = function(array) {
+ var rest = slice.call(arguments, 1);
+ return _.filter(_.uniq(array), function(item) {
+ return _.every(rest, function(other) {
+ return _.contains(other, item);
+ });
+ });
+ };
+
+ // Take the difference between one array and a number of other arrays.
+ // Only the elements present in just the first array will remain.
+ _.difference = function(array) {
+ var rest = concat.apply(ArrayProto, slice.call(arguments, 1));
+ return _.filter(array, function(value){ return !_.contains(rest, value); });
+ };
+
+ // Zip together multiple lists into a single array -- elements that share
+ // an index go together.
+ _.zip = function() {
+ var length = _.max(_.pluck(arguments, 'length').concat(0));
+ var results = new Array(length);
+ for (var i = 0; i < length; i++) {
+ results[i] = _.pluck(arguments, '' + i);
+ }
+ return results;
+ };
+
+ // Converts lists into objects. Pass either a single array of `[key, value]`
+ // pairs, or two parallel arrays of the same length -- one of keys, and one of
+ // the corresponding values.
+ _.object = function(list, values) {
+ if (list == null) return {};
+ var result = {};
+ for (var i = 0, length = list.length; i < length; i++) {
+ if (values) {
+ result[list[i]] = values[i];
+ } else {
+ result[list[i][0]] = list[i][1];
+ }
+ }
+ return result;
+ };
+
+ // If the browser doesn't supply us with indexOf (I'm looking at you, **MSIE**),
+ // we need this function. Return the position of the first occurrence of an
+ // item in an array, or -1 if the item is not included in the array.
+ // Delegates to **ECMAScript 5**'s native `indexOf` if available.
+ // If the array is large and already in sort order, pass `true`
+ // for **isSorted** to use binary search.
+ _.indexOf = function(array, item, isSorted) {
+ if (array == null) return -1;
+ var i = 0, length = array.length;
+ if (isSorted) {
+ if (typeof isSorted == 'number') {
+ i = (isSorted < 0 ? Math.max(0, length + isSorted) : isSorted);
+ } else {
+ i = _.sortedIndex(array, item);
+ return array[i] === item ? i : -1;
+ }
+ }
+ if (nativeIndexOf && array.indexOf === nativeIndexOf) return array.indexOf(item, isSorted);
+ for (; i < length; i++) if (array[i] === item) return i;
+ return -1;
+ };
+
+ // Delegates to **ECMAScript 5**'s native `lastIndexOf` if available.
+ _.lastIndexOf = function(array, item, from) {
+ if (array == null) return -1;
+ var hasIndex = from != null;
+ if (nativeLastIndexOf && array.lastIndexOf === nativeLastIndexOf) {
+ return hasIndex ? array.lastIndexOf(item, from) : array.lastIndexOf(item);
+ }
+ var i = (hasIndex ? from : array.length);
+ while (i--) if (array[i] === item) return i;
+ return -1;
+ };
+
+ // Generate an integer Array containing an arithmetic progression. A port of
+ // the native Python `range()` function. See
+ // [the Python documentation](http://docs.python.org/library/functions.html#range).
+ _.range = function(start, stop, step) {
+ if (arguments.length <= 1) {
+ stop = start || 0;
+ start = 0;
+ }
+ step = arguments[2] || 1;
+
+ var length = Math.max(Math.ceil((stop - start) / step), 0);
+ var idx = 0;
+ var range = new Array(length);
+
+ while(idx < length) {
+ range[idx++] = start;
+ start += step;
+ }
+
+ return range;
+ };
+
+ // Function (ahem) Functions
+ // ------------------
+
+ // Reusable constructor function for prototype setting.
+ var ctor = function(){};
+
+ // Create a function bound to a given object (assigning `this`, and arguments,
+ // optionally). Delegates to **ECMAScript 5**'s native `Function.bind` if
+ // available.
+ _.bind = function(func, context) {
+ var args, bound;
+ if (nativeBind && func.bind === nativeBind) return nativeBind.apply(func, slice.call(arguments, 1));
+ if (!_.isFunction(func)) throw new TypeError;
+ args = slice.call(arguments, 2);
+ return bound = function() {
+ if (!(this instanceof bound)) return func.apply(context, args.concat(slice.call(arguments)));
+ ctor.prototype = func.prototype;
+ var self = new ctor;
+ ctor.prototype = null;
+ var result = func.apply(self, args.concat(slice.call(arguments)));
+ if (Object(result) === result) return result;
+ return self;
+ };
+ };
+
+ // Partially apply a function by creating a version that has had some of its
+ // arguments pre-filled, without changing its dynamic `this` context. _ acts
+ // as a placeholder, allowing any combination of arguments to be pre-filled.
+ _.partial = function(func) {
+ var boundArgs = slice.call(arguments, 1);
+ return function() {
+ var position = 0;
+ var args = boundArgs.slice();
+ for (var i = 0, length = args.length; i < length; i++) {
+ if (args[i] === _) args[i] = arguments[position++];
+ }
+ while (position < arguments.length) args.push(arguments[position++]);
+ return func.apply(this, args);
+ };
+ };
+
+ // Bind a number of an object's methods to that object. Remaining arguments
+ // are the method names to be bound. Useful for ensuring that all callbacks
+ // defined on an object belong to it.
+ _.bindAll = function(obj) {
+ var funcs = slice.call(arguments, 1);
+ if (funcs.length === 0) throw new Error('bindAll must be passed function names');
+ each(funcs, function(f) { obj[f] = _.bind(obj[f], obj); });
+ return obj;
+ };
+
+ // Memoize an expensive function by storing its results.
+ _.memoize = function(func, hasher) {
+ var memo = {};
+ hasher || (hasher = _.identity);
+ return function() {
+ var key = hasher.apply(this, arguments);
+ return _.has(memo, key) ? memo[key] : (memo[key] = func.apply(this, arguments));
+ };
+ };
+
+ // Delays a function for the given number of milliseconds, and then calls
+ // it with the arguments supplied.
+ _.delay = function(func, wait) {
+ var args = slice.call(arguments, 2);
+ return setTimeout(function(){ return func.apply(null, args); }, wait);
+ };
+
+ // Defers a function, scheduling it to run after the current call stack has
+ // cleared.
+ _.defer = function(func) {
+ return _.delay.apply(_, [func, 1].concat(slice.call(arguments, 1)));
+ };
+
+ // Returns a function, that, when invoked, will only be triggered at most once
+ // during a given window of time. Normally, the throttled function will run
+ // as much as it can, without ever going more than once per `wait` duration;
+ // but if you'd like to disable the execution on the leading edge, pass
+ // `{leading: false}`. To disable execution on the trailing edge, ditto.
+ _.throttle = function(func, wait, options) {
+ var context, args, result;
+ var timeout = null;
+ var previous = 0;
+ options || (options = {});
+ var later = function() {
+ previous = options.leading === false ? 0 : _.now();
+ timeout = null;
+ result = func.apply(context, args);
+ context = args = null;
+ };
+ return function() {
+ var now = _.now();
+ if (!previous && options.leading === false) previous = now;
+ var remaining = wait - (now - previous);
+ context = this;
+ args = arguments;
+ if (remaining <= 0) {
+ clearTimeout(timeout);
+ timeout = null;
+ previous = now;
+ result = func.apply(context, args);
+ context = args = null;
+ } else if (!timeout && options.trailing !== false) {
+ timeout = setTimeout(later, remaining);
+ }
+ return result;
+ };
+ };
+
+ // Returns a function, that, as long as it continues to be invoked, will not
+ // be triggered. The function will be called after it stops being called for
+ // N milliseconds. If `immediate` is passed, trigger the function on the
+ // leading edge, instead of the trailing.
+ _.debounce = function(func, wait, immediate) {
+ var timeout, args, context, timestamp, result;
+
+ var later = function() {
+ var last = _.now() - timestamp;
+ if (last < wait) {
+ timeout = setTimeout(later, wait - last);
+ } else {
+ timeout = null;
+ if (!immediate) {
+ result = func.apply(context, args);
+ context = args = null;
+ }
+ }
+ };
+
+ return function() {
+ context = this;
+ args = arguments;
+ timestamp = _.now();
+ var callNow = immediate && !timeout;
+ if (!timeout) {
+ timeout = setTimeout(later, wait);
+ }
+ if (callNow) {
+ result = func.apply(context, args);
+ context = args = null;
+ }
+
+ return result;
+ };
+ };
+
+ // Returns a function that will be executed at most one time, no matter how
+ // often you call it. Useful for lazy initialization.
+ _.once = function(func) {
+ var ran = false, memo;
+ return function() {
+ if (ran) return memo;
+ ran = true;
+ memo = func.apply(this, arguments);
+ func = null;
+ return memo;
+ };
+ };
+
+ // Returns the first function passed as an argument to the second,
+ // allowing you to adjust arguments, run code before and after, and
+ // conditionally execute the original function.
+ _.wrap = function(func, wrapper) {
+ return _.partial(wrapper, func);
+ };
+
+ // Returns a function that is the composition of a list of functions, each
+ // consuming the return value of the function that follows.
+ _.compose = function() {
+ var funcs = arguments;
+ return function() {
+ var args = arguments;
+ for (var i = funcs.length - 1; i >= 0; i--) {
+ args = [funcs[i].apply(this, args)];
+ }
+ return args[0];
+ };
+ };
+
+ // Returns a function that will only be executed after being called N times.
+ _.after = function(times, func) {
+ return function() {
+ if (--times < 1) {
+ return func.apply(this, arguments);
+ }
+ };
+ };
+
+ // Object Functions
+ // ----------------
+
+ // Retrieve the names of an object's properties.
+ // Delegates to **ECMAScript 5**'s native `Object.keys`
+ _.keys = function(obj) {
+ if (!_.isObject(obj)) return [];
+ if (nativeKeys) return nativeKeys(obj);
+ var keys = [];
+ for (var key in obj) if (_.has(obj, key)) keys.push(key);
+ return keys;
+ };
+
+ // Retrieve the values of an object's properties.
+ _.values = function(obj) {
+ var keys = _.keys(obj);
+ var length = keys.length;
+ var values = new Array(length);
+ for (var i = 0; i < length; i++) {
+ values[i] = obj[keys[i]];
+ }
+ return values;
+ };
+
+ // Convert an object into a list of `[key, value]` pairs.
+ _.pairs = function(obj) {
+ var keys = _.keys(obj);
+ var length = keys.length;
+ var pairs = new Array(length);
+ for (var i = 0; i < length; i++) {
+ pairs[i] = [keys[i], obj[keys[i]]];
+ }
+ return pairs;
+ };
+
+ // Invert the keys and values of an object. The values must be serializable.
+ _.invert = function(obj) {
+ var result = {};
+ var keys = _.keys(obj);
+ for (var i = 0, length = keys.length; i < length; i++) {
+ result[obj[keys[i]]] = keys[i];
+ }
+ return result;
+ };
+
+ // Return a sorted list of the function names available on the object.
+ // Aliased as `methods`
+ _.functions = _.methods = function(obj) {
+ var names = [];
+ for (var key in obj) {
+ if (_.isFunction(obj[key])) names.push(key);
+ }
+ return names.sort();
+ };
+
+ // Extend a given object with all the properties in passed-in object(s).
+ _.extend = function(obj) {
+ each(slice.call(arguments, 1), function(source) {
+ if (source) {
+ for (var prop in source) {
+ obj[prop] = source[prop];
+ }
+ }
+ });
+ return obj;
+ };
+
+ // Return a copy of the object only containing the whitelisted properties.
+ _.pick = function(obj) {
+ var copy = {};
+ var keys = concat.apply(ArrayProto, slice.call(arguments, 1));
+ each(keys, function(key) {
+ if (key in obj) copy[key] = obj[key];
+ });
+ return copy;
+ };
+
+ // Return a copy of the object without the blacklisted properties.
+ _.omit = function(obj) {
+ var copy = {};
+ var keys = concat.apply(ArrayProto, slice.call(arguments, 1));
+ for (var key in obj) {
+ if (!_.contains(keys, key)) copy[key] = obj[key];
+ }
+ return copy;
+ };
+
+ // Fill in a given object with default properties.
+ _.defaults = function(obj) {
+ each(slice.call(arguments, 1), function(source) {
+ if (source) {
+ for (var prop in source) {
+ if (obj[prop] === void 0) obj[prop] = source[prop];
+ }
+ }
+ });
+ return obj;
+ };
+
+ // Create a (shallow-cloned) duplicate of an object.
+ _.clone = function(obj) {
+ if (!_.isObject(obj)) return obj;
+ return _.isArray(obj) ? obj.slice() : _.extend({}, obj);
+ };
+
+ // Invokes interceptor with the obj, and then returns obj.
+ // The primary purpose of this method is to "tap into" a method chain, in
+ // order to perform operations on intermediate results within the chain.
+ _.tap = function(obj, interceptor) {
+ interceptor(obj);
+ return obj;
+ };
+
+ // Internal recursive comparison function for `isEqual`.
+ var eq = function(a, b, aStack, bStack) {
+ // Identical objects are equal. `0 === -0`, but they aren't identical.
+ // See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal).
+ if (a === b) return a !== 0 || 1 / a == 1 / b;
+ // A strict comparison is necessary because `null == undefined`.
+ if (a == null || b == null) return a === b;
+ // Unwrap any wrapped objects.
+ if (a instanceof _) a = a._wrapped;
+ if (b instanceof _) b = b._wrapped;
+ // Compare `[[Class]]` names.
+ var className = toString.call(a);
+ if (className != toString.call(b)) return false;
+ switch (className) {
+ // Strings, numbers, dates, and booleans are compared by value.
+ case '[object String]':
+ // Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is
+ // equivalent to `new String("5")`.
+ return a == String(b);
+ case '[object Number]':
+ // `NaN`s are equivalent, but non-reflexive. An `egal` comparison is performed for
+ // other numeric values.
+ return a != +a ? b != +b : (a == 0 ? 1 / a == 1 / b : a == +b);
+ case '[object Date]':
+ case '[object Boolean]':
+ // Coerce dates and booleans to numeric primitive values. Dates are compared by their
+ // millisecond representations. Note that invalid dates with millisecond representations
+ // of `NaN` are not equivalent.
+ return +a == +b;
+ // RegExps are compared by their source patterns and flags.
+ case '[object RegExp]':
+ return a.source == b.source &&
+ a.global == b.global &&
+ a.multiline == b.multiline &&
+ a.ignoreCase == b.ignoreCase;
+ }
+ if (typeof a != 'object' || typeof b != 'object') return false;
+ // Assume equality for cyclic structures. The algorithm for detecting cyclic
+ // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.
+ var length = aStack.length;
+ while (length--) {
+ // Linear search. Performance is inversely proportional to the number of
+ // unique nested structures.
+ if (aStack[length] == a) return bStack[length] == b;
+ }
+ // Objects with different constructors are not equivalent, but `Object`s
+ // from different frames are.
+ var aCtor = a.constructor, bCtor = b.constructor;
+ if (aCtor !== bCtor && !(_.isFunction(aCtor) && (aCtor instanceof aCtor) &&
+ _.isFunction(bCtor) && (bCtor instanceof bCtor))
+ && ('constructor' in a && 'constructor' in b)) {
+ return false;
+ }
+ // Add the first object to the stack of traversed objects.
+ aStack.push(a);
+ bStack.push(b);
+ var size = 0, result = true;
+ // Recursively compare objects and arrays.
+ if (className == '[object Array]') {
+ // Compare array lengths to determine if a deep comparison is necessary.
+ size = a.length;
+ result = size == b.length;
+ if (result) {
+ // Deep compare the contents, ignoring non-numeric properties.
+ while (size--) {
+ if (!(result = eq(a[size], b[size], aStack, bStack))) break;
+ }
+ }
+ } else {
+ // Deep compare objects.
+ for (var key in a) {
+ if (_.has(a, key)) {
+ // Count the expected number of properties.
+ size++;
+ // Deep compare each member.
+ if (!(result = _.has(b, key) && eq(a[key], b[key], aStack, bStack))) break;
+ }
+ }
+ // Ensure that both objects contain the same number of properties.
+ if (result) {
+ for (key in b) {
+ if (_.has(b, key) && !(size--)) break;
+ }
+ result = !size;
+ }
+ }
+ // Remove the first object from the stack of traversed objects.
+ aStack.pop();
+ bStack.pop();
+ return result;
+ };
+
+ // Perform a deep comparison to check if two objects are equal.
+ _.isEqual = function(a, b) {
+ return eq(a, b, [], []);
+ };
+
+ // Is a given array, string, or object empty?
+ // An "empty" object has no enumerable own-properties.
+ _.isEmpty = function(obj) {
+ if (obj == null) return true;
+ if (_.isArray(obj) || _.isString(obj)) return obj.length === 0;
+ for (var key in obj) if (_.has(obj, key)) return false;
+ return true;
+ };
+
+ // Is a given value a DOM element?
+ _.isElement = function(obj) {
+ return !!(obj && obj.nodeType === 1);
+ };
+
+ // Is a given value an array?
+ // Delegates to ECMA5's native Array.isArray
+ _.isArray = nativeIsArray || function(obj) {
+ return toString.call(obj) == '[object Array]';
+ };
+
+ // Is a given variable an object?
+ _.isObject = function(obj) {
+ return obj === Object(obj);
+ };
+
+ // Add some isType methods: isArguments, isFunction, isString, isNumber, isDate, isRegExp.
+ each(['Arguments', 'Function', 'String', 'Number', 'Date', 'RegExp'], function(name) {
+ _['is' + name] = function(obj) {
+ return toString.call(obj) == '[object ' + name + ']';
+ };
+ });
+
+ // Define a fallback version of the method in browsers (ahem, IE), where
+ // there isn't any inspectable "Arguments" type.
+ if (!_.isArguments(arguments)) {
+ _.isArguments = function(obj) {
+ return !!(obj && _.has(obj, 'callee'));
+ };
+ }
+
+ // Optimize `isFunction` if appropriate.
+ if (typeof (/./) !== 'function') {
+ _.isFunction = function(obj) {
+ return typeof obj === 'function';
+ };
+ }
+
+ // Is a given object a finite number?
+ _.isFinite = function(obj) {
+ return isFinite(obj) && !isNaN(parseFloat(obj));
+ };
+
+ // Is the given value `NaN`? (NaN is the only number which does not equal itself).
+ _.isNaN = function(obj) {
+ return _.isNumber(obj) && obj != +obj;
+ };
+
+ // Is a given value a boolean?
+ _.isBoolean = function(obj) {
+ return obj === true || obj === false || toString.call(obj) == '[object Boolean]';
+ };
+
+ // Is a given value equal to null?
+ _.isNull = function(obj) {
+ return obj === null;
+ };
+
+ // Is a given variable undefined?
+ _.isUndefined = function(obj) {
+ return obj === void 0;
+ };
+
+ // Shortcut function for checking if an object has a given property directly
+ // on itself (in other words, not on a prototype).
+ _.has = function(obj, key) {
+ return hasOwnProperty.call(obj, key);
+ };
+
+ // Utility Functions
+ // -----------------
+
+ // Run Underscore.js in *noConflict* mode, returning the `_` variable to its
+ // previous owner. Returns a reference to the Underscore object.
+ _.noConflict = function() {
+ root._ = previousUnderscore;
+ return this;
+ };
+
+ // Keep the identity function around for default iterators.
+ _.identity = function(value) {
+ return value;
+ };
+
+ _.constant = function(value) {
+ return function () {
+ return value;
+ };
+ };
+
+ _.property = function(key) {
+ return function(obj) {
+ return obj[key];
+ };
+ };
+
+ // Returns a predicate for checking whether an object has a given set of `key:value` pairs.
+ _.matches = function(attrs) {
+ return function(obj) {
+ if (obj === attrs) return true; //avoid comparing an object to itself.
+ for (var key in attrs) {
+ if (attrs[key] !== obj[key])
+ return false;
+ }
+ return true;
+ }
+ };
+
+ // Run a function **n** times.
+ _.times = function(n, iterator, context) {
+ var accum = Array(Math.max(0, n));
+ for (var i = 0; i < n; i++) accum[i] = iterator.call(context, i);
+ return accum;
+ };
+
+ // Return a random integer between min and max (inclusive).
+ _.random = function(min, max) {
+ if (max == null) {
+ max = min;
+ min = 0;
+ }
+ return min + Math.floor(Math.random() * (max - min + 1));
+ };
+
+ // A (possibly faster) way to get the current timestamp as an integer.
+ _.now = Date.now || function() { return new Date().getTime(); };
+
+ // List of HTML entities for escaping.
+ var entityMap = {
+ escape: {
+ '&': '&amp;',
+ '<': '&lt;',
+ '>': '&gt;',
+ '"': '&quot;',
+ "'": '&#x27;'
+ }
+ };
+ entityMap.unescape = _.invert(entityMap.escape);
+
+ // Regexes containing the keys and values listed immediately above.
+ var entityRegexes = {
+ escape: new RegExp('[' + _.keys(entityMap.escape).join('') + ']', 'g'),
+ unescape: new RegExp('(' + _.keys(entityMap.unescape).join('|') + ')', 'g')
+ };
+
+ // Functions for escaping and unescaping strings to/from HTML interpolation.
+ _.each(['escape', 'unescape'], function(method) {
+ _[method] = function(string) {
+ if (string == null) return '';
+ return ('' + string).replace(entityRegexes[method], function(match) {
+ return entityMap[method][match];
+ });
+ };
+ });
+
+ // If the value of the named `property` is a function then invoke it with the
+ // `object` as context; otherwise, return it.
+ _.result = function(object, property) {
+ if (object == null) return void 0;
+ var value = object[property];
+ return _.isFunction(value) ? value.call(object) : value;
+ };
+
+ // Add your own custom functions to the Underscore object.
+ _.mixin = function(obj) {
+ each(_.functions(obj), function(name) {
+ var func = _[name] = obj[name];
+ _.prototype[name] = function() {
+ var args = [this._wrapped];
+ push.apply(args, arguments);
+ return result.call(this, func.apply(_, args));
+ };
+ });
+ };
+
+ // Generate a unique integer id (unique within the entire client session).
+ // Useful for temporary DOM ids.
+ var idCounter = 0;
+ _.uniqueId = function(prefix) {
+ var id = ++idCounter + '';
+ return prefix ? prefix + id : id;
+ };
+
+ // By default, Underscore uses ERB-style template delimiters, change the
+ // following template settings to use alternative delimiters.
+ _.templateSettings = {
+ evaluate : /<%([\s\S]+?)%>/g,
+ interpolate : /<%=([\s\S]+?)%>/g,
+ escape : /<%-([\s\S]+?)%>/g
+ };
+
+ // When customizing `templateSettings`, if you don't want to define an
+ // interpolation, evaluation or escaping regex, we need one that is
+ // guaranteed not to match.
+ var noMatch = /(.)^/;
+
+ // Certain characters need to be escaped so that they can be put into a
+ // string literal.
+ var escapes = {
+ "'": "'",
+ '\\': '\\',
+ '\r': 'r',
+ '\n': 'n',
+ '\t': 't',
+ '\u2028': 'u2028',
+ '\u2029': 'u2029'
+ };
+
+ var escaper = /\\|'|\r|\n|\t|\u2028|\u2029/g;
+
+ // JavaScript micro-templating, similar to John Resig's implementation.
+ // Underscore templating handles arbitrary delimiters, preserves whitespace,
+ // and correctly escapes quotes within interpolated code.
+ _.template = function(text, data, settings) {
+ var render;
+ settings = _.defaults({}, settings, _.templateSettings);
+
+ // Combine delimiters into one regular expression via alternation.
+ var matcher = new RegExp([
+ (settings.escape || noMatch).source,
+ (settings.interpolate || noMatch).source,
+ (settings.evaluate || noMatch).source
+ ].join('|') + '|$', 'g');
+
+ // Compile the template source, escaping string literals appropriately.
+ var index = 0;
+ var source = "__p+='";
+ text.replace(matcher, function(match, escape, interpolate, evaluate, offset) {
+ source += text.slice(index, offset)
+ .replace(escaper, function(match) { return '\\' + escapes[match]; });
+
+ if (escape) {
+ source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'";
+ }
+ if (interpolate) {
+ source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'";
+ }
+ if (evaluate) {
+ source += "';\n" + evaluate + "\n__p+='";
+ }
+ index = offset + match.length;
+ return match;
+ });
+ source += "';\n";
+
+ // If a variable is not specified, place data values in local scope.
+ if (!settings.variable) source = 'with(obj||{}){\n' + source + '}\n';
+
+ source = "var __t,__p='',__j=Array.prototype.join," +
+ "print=function(){__p+=__j.call(arguments,'');};\n" +
+ source + "return __p;\n";
+
+ try {
+ render = new Function(settings.variable || 'obj', '_', source);
+ } catch (e) {
+ e.source = source;
+ throw e;
+ }
+
+ if (data) return render(data, _);
+ var template = function(data) {
+ return render.call(this, data, _);
+ };
+
+ // Provide the compiled function source as a convenience for precompilation.
+ template.source = 'function(' + (settings.variable || 'obj') + '){\n' + source + '}';
+
+ return template;
+ };
+
+ // Add a "chain" function, which will delegate to the wrapper.
+ _.chain = function(obj) {
+ return _(obj).chain();
+ };
+
+ // OOP
+ // ---------------
+ // If Underscore is called as a function, it returns a wrapped object that
+ // can be used OO-style. This wrapper holds altered versions of all the
+ // underscore functions. Wrapped objects may be chained.
+
+ // Helper function to continue chaining intermediate results.
+ var result = function(obj) {
+ return this._chain ? _(obj).chain() : obj;
+ };
+
+ // Add all of the Underscore functions to the wrapper object.
+ _.mixin(_);
+
+ // Add all mutator Array functions to the wrapper.
+ each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) {
+ var method = ArrayProto[name];
+ _.prototype[name] = function() {
+ var obj = this._wrapped;
+ method.apply(obj, arguments);
+ if ((name == 'shift' || name == 'splice') && obj.length === 0) delete obj[0];
+ return result.call(this, obj);
+ };
+ });
+
+ // Add all accessor Array functions to the wrapper.
+ each(['concat', 'join', 'slice'], function(name) {
+ var method = ArrayProto[name];
+ _.prototype[name] = function() {
+ return result.call(this, method.apply(this._wrapped, arguments));
+ };
+ });
+
+ _.extend(_.prototype, {
+
+ // Start chaining a wrapped Underscore object.
+ chain: function() {
+ this._chain = true;
+ return this;
+ },
+
+ // Extracts the result from a wrapped and chained object.
+ value: function() {
+ return this._wrapped;
+ }
+
+ });
+
+ // AMD registration happens at the end for compatibility with AMD loaders
+ // that may not enforce next-turn semantics on modules. Even though general
+ // practice for AMD registration is to be anonymous, underscore registers
+ // as a named module because, like jQuery, it is a base library that is
+ // popular enough to be bundled in a third party lib, but not be part of
+ // an AMD load request. Those cases could generate an error when an
+ // anonymous define() is called outside of a loader request.
+ if (typeof define === 'function' && define.amd) {
+ define('underscore', [], function() {
+ return _;
+ });
+ }
+}).call(this);
diff --git a/deps/npm/node_modules/columnify/node_modules/wcwidth.js/package.json b/deps/npm/node_modules/columnify/node_modules/wcwidth.js/package.json
new file mode 100644
index 0000000000..104b707632
--- /dev/null
+++ b/deps/npm/node_modules/columnify/node_modules/wcwidth.js/package.json
@@ -0,0 +1,60 @@
+{
+ "name": "wcwidth.js",
+ "version": "0.0.4",
+ "description": "A JavaScript porting of C's wcwidth() and wcswidth()",
+ "author": {
+ "name": "Woong Jun",
+ "email": "woong.jun@gmail.com",
+ "url": "http://code.woong.org/"
+ },
+ "contributors": [],
+ "homepage": "http://code.woong.org/wcwidth.js",
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/mycoboco/wcwidth.js.git"
+ },
+ "bugs": {
+ "url": "https://github.com/mycoboco/wcwidth.js/issues",
+ "email": "woong.jun@gmail.com"
+ },
+ "main": "wcwidth.js",
+ "dependencies": {
+ "underscore": ">= 1.3.0"
+ },
+ "devDependencies": {},
+ "engines": {
+ "node": ">= 0.8.0"
+ },
+ "licenses": "MIT",
+ "keywords": [
+ "wide character",
+ "wc",
+ "wide character string",
+ "wcs",
+ "terminal",
+ "width",
+ "wcwidth",
+ "wcswidth"
+ ],
+ "_id": "wcwidth.js@0.0.4",
+ "dist": {
+ "shasum": "44298a7c899c17501990fdaddd76ef6bd081be75",
+ "tarball": "http://registry.npmjs.org/wcwidth.js/-/wcwidth.js-0.0.4.tgz"
+ },
+ "_from": "wcwidth.js@~0.0.4",
+ "_npmVersion": "1.3.11",
+ "_npmUser": {
+ "name": "mycoboco",
+ "email": "woong.jun@gmail.com"
+ },
+ "maintainers": [
+ {
+ "name": "mycoboco",
+ "email": "woong.jun@gmail.com"
+ }
+ ],
+ "directories": {},
+ "_shasum": "44298a7c899c17501990fdaddd76ef6bd081be75",
+ "_resolved": "https://registry.npmjs.org/wcwidth.js/-/wcwidth.js-0.0.4.tgz",
+ "readme": "ERROR: No README data found!"
+}
diff --git a/deps/npm/node_modules/columnify/node_modules/wcwidth.js/wcwidth.js b/deps/npm/node_modules/columnify/node_modules/wcwidth.js/wcwidth.js
new file mode 100644
index 0000000000..3ce5b489a4
--- /dev/null
+++ b/deps/npm/node_modules/columnify/node_modules/wcwidth.js/wcwidth.js
@@ -0,0 +1,262 @@
+/*
+ * Javascript porting of Markus Kuhn's wcwidth() implementation
+ *
+ * The following explanation comes from the original C implementation:
+ *
+ * This is an implementation of wcwidth() and wcswidth() (defined in
+ * IEEE Std 1002.1-2001) for Unicode.
+ *
+ * http://www.opengroup.org/onlinepubs/007904975/functions/wcwidth.html
+ * http://www.opengroup.org/onlinepubs/007904975/functions/wcswidth.html
+ *
+ * In fixed-width output devices, Latin characters all occupy a single
+ * "cell" position of equal width, whereas ideographic CJK characters
+ * occupy two such cells. Interoperability between terminal-line
+ * applications and (teletype-style) character terminals using the
+ * UTF-8 encoding requires agreement on which character should advance
+ * the cursor by how many cell positions. No established formal
+ * standards exist at present on which Unicode character shall occupy
+ * how many cell positions on character terminals. These routines are
+ * a first attempt of defining such behavior based on simple rules
+ * applied to data provided by the Unicode Consortium.
+ *
+ * For some graphical characters, the Unicode standard explicitly
+ * defines a character-cell width via the definition of the East Asian
+ * FullWidth (F), Wide (W), Half-width (H), and Narrow (Na) classes.
+ * In all these cases, there is no ambiguity about which width a
+ * terminal shall use. For characters in the East Asian Ambiguous (A)
+ * class, the width choice depends purely on a preference of backward
+ * compatibility with either historic CJK or Western practice.
+ * Choosing single-width for these characters is easy to justify as
+ * the appropriate long-term solution, as the CJK practice of
+ * displaying these characters as double-width comes from historic
+ * implementation simplicity (8-bit encoded characters were displayed
+ * single-width and 16-bit ones double-width, even for Greek,
+ * Cyrillic, etc.) and not any typographic considerations.
+ *
+ * Much less clear is the choice of width for the Not East Asian
+ * (Neutral) class. Existing practice does not dictate a width for any
+ * of these characters. It would nevertheless make sense
+ * typographically to allocate two character cells to characters such
+ * as for instance EM SPACE or VOLUME INTEGRAL, which cannot be
+ * represented adequately with a single-width glyph. The following
+ * routines at present merely assign a single-cell width to all
+ * neutral characters, in the interest of simplicity. This is not
+ * entirely satisfactory and should be reconsidered before
+ * establishing a formal standard in this area. At the moment, the
+ * decision which Not East Asian (Neutral) characters should be
+ * represented by double-width glyphs cannot yet be answered by
+ * applying a simple rule from the Unicode database content. Setting
+ * up a proper standard for the behavior of UTF-8 character terminals
+ * will require a careful analysis not only of each Unicode character,
+ * but also of each presentation form, something the author of these
+ * routines has avoided to do so far.
+ *
+ * http://www.unicode.org/unicode/reports/tr11/
+ *
+ * Markus Kuhn -- 2007-05-26 (Unicode 5.0)
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * for any purpose and without fee is hereby granted. The author
+ * disclaims all warranties with regard to this software.
+ *
+ * Latest version: http://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c
+ */
+
+var _ = require('underscore');
+
+
+// The following two functions define the column width of an ISO 10646 character as follows:
+//
+// - The null character (U+0000) has a column width of 0.
+// - Other C0/C1 control characters and DEL will lead to a return value of -1.
+// - Non-spacing and enclosing combining characters (general category code Mn or Me in the
+// Unicode database) have a column width of 0.
+// - SOFT HYPHEN (U+00AD) has a column width of 1.
+// - Other format characters (general category code Cf in the Unicode database) and ZERO WIDTH
+// SPACE (U+200B) have a column width of 0.
+// - Hangul Jamo medial vowels and final consonants (U+1160-U+11FF) have a column width of 0.
+// - Spacing characters in the East Asian Wide (W) or East Asian Full-width (F) category as
+// defined in Unicode Technical Report #11 have a column width of 2.
+// - All remaining characters (including all printable ISO 8859-1 and WGL4 characters, Unicode
+// control characters, etc.) have a column width of 1.
+//
+// This implementation assumes that characters are encoded in ISO 10646.
+//
+// optional option = { null: width, control: width, monkeypatch: boolean }
+module.exports = wcwidth = function (option) {
+ // sorted list of non-overlapping intervals of non-spacing characters
+ // generated by "uniset +cat=Me +cat=Mn +cat=Cf -00AD +1160-11FF +200B c"
+ var combining = [
+ [ 0x0300, 0x036F ], [ 0x0483, 0x0486 ], [ 0x0488, 0x0489 ],
+ [ 0x0591, 0x05BD ], [ 0x05BF, 0x05BF ], [ 0x05C1, 0x05C2 ],
+ [ 0x05C4, 0x05C5 ], [ 0x05C7, 0x05C7 ], [ 0x0600, 0x0603 ],
+ [ 0x0610, 0x0615 ], [ 0x064B, 0x065E ], [ 0x0670, 0x0670 ],
+ [ 0x06D6, 0x06E4 ], [ 0x06E7, 0x06E8 ], [ 0x06EA, 0x06ED ],
+ [ 0x070F, 0x070F ], [ 0x0711, 0x0711 ], [ 0x0730, 0x074A ],
+ [ 0x07A6, 0x07B0 ], [ 0x07EB, 0x07F3 ], [ 0x0901, 0x0902 ],
+ [ 0x093C, 0x093C ], [ 0x0941, 0x0948 ], [ 0x094D, 0x094D ],
+ [ 0x0951, 0x0954 ], [ 0x0962, 0x0963 ], [ 0x0981, 0x0981 ],
+ [ 0x09BC, 0x09BC ], [ 0x09C1, 0x09C4 ], [ 0x09CD, 0x09CD ],
+ [ 0x09E2, 0x09E3 ], [ 0x0A01, 0x0A02 ], [ 0x0A3C, 0x0A3C ],
+ [ 0x0A41, 0x0A42 ], [ 0x0A47, 0x0A48 ], [ 0x0A4B, 0x0A4D ],
+ [ 0x0A70, 0x0A71 ], [ 0x0A81, 0x0A82 ], [ 0x0ABC, 0x0ABC ],
+ [ 0x0AC1, 0x0AC5 ], [ 0x0AC7, 0x0AC8 ], [ 0x0ACD, 0x0ACD ],
+ [ 0x0AE2, 0x0AE3 ], [ 0x0B01, 0x0B01 ], [ 0x0B3C, 0x0B3C ],
+ [ 0x0B3F, 0x0B3F ], [ 0x0B41, 0x0B43 ], [ 0x0B4D, 0x0B4D ],
+ [ 0x0B56, 0x0B56 ], [ 0x0B82, 0x0B82 ], [ 0x0BC0, 0x0BC0 ],
+ [ 0x0BCD, 0x0BCD ], [ 0x0C3E, 0x0C40 ], [ 0x0C46, 0x0C48 ],
+ [ 0x0C4A, 0x0C4D ], [ 0x0C55, 0x0C56 ], [ 0x0CBC, 0x0CBC ],
+ [ 0x0CBF, 0x0CBF ], [ 0x0CC6, 0x0CC6 ], [ 0x0CCC, 0x0CCD ],
+ [ 0x0CE2, 0x0CE3 ], [ 0x0D41, 0x0D43 ], [ 0x0D4D, 0x0D4D ],
+ [ 0x0DCA, 0x0DCA ], [ 0x0DD2, 0x0DD4 ], [ 0x0DD6, 0x0DD6 ],
+ [ 0x0E31, 0x0E31 ], [ 0x0E34, 0x0E3A ], [ 0x0E47, 0x0E4E ],
+ [ 0x0EB1, 0x0EB1 ], [ 0x0EB4, 0x0EB9 ], [ 0x0EBB, 0x0EBC ],
+ [ 0x0EC8, 0x0ECD ], [ 0x0F18, 0x0F19 ], [ 0x0F35, 0x0F35 ],
+ [ 0x0F37, 0x0F37 ], [ 0x0F39, 0x0F39 ], [ 0x0F71, 0x0F7E ],
+ [ 0x0F80, 0x0F84 ], [ 0x0F86, 0x0F87 ], [ 0x0F90, 0x0F97 ],
+ [ 0x0F99, 0x0FBC ], [ 0x0FC6, 0x0FC6 ], [ 0x102D, 0x1030 ],
+ [ 0x1032, 0x1032 ], [ 0x1036, 0x1037 ], [ 0x1039, 0x1039 ],
+ [ 0x1058, 0x1059 ], [ 0x1160, 0x11FF ], [ 0x135F, 0x135F ],
+ [ 0x1712, 0x1714 ], [ 0x1732, 0x1734 ], [ 0x1752, 0x1753 ],
+ [ 0x1772, 0x1773 ], [ 0x17B4, 0x17B5 ], [ 0x17B7, 0x17BD ],
+ [ 0x17C6, 0x17C6 ], [ 0x17C9, 0x17D3 ], [ 0x17DD, 0x17DD ],
+ [ 0x180B, 0x180D ], [ 0x18A9, 0x18A9 ], [ 0x1920, 0x1922 ],
+ [ 0x1927, 0x1928 ], [ 0x1932, 0x1932 ], [ 0x1939, 0x193B ],
+ [ 0x1A17, 0x1A18 ], [ 0x1B00, 0x1B03 ], [ 0x1B34, 0x1B34 ],
+ [ 0x1B36, 0x1B3A ], [ 0x1B3C, 0x1B3C ], [ 0x1B42, 0x1B42 ],
+ [ 0x1B6B, 0x1B73 ], [ 0x1DC0, 0x1DCA ], [ 0x1DFE, 0x1DFF ],
+ [ 0x200B, 0x200F ], [ 0x202A, 0x202E ], [ 0x2060, 0x2063 ],
+ [ 0x206A, 0x206F ], [ 0x20D0, 0x20EF ], [ 0x302A, 0x302F ],
+ [ 0x3099, 0x309A ], [ 0xA806, 0xA806 ], [ 0xA80B, 0xA80B ],
+ [ 0xA825, 0xA826 ], [ 0xFB1E, 0xFB1E ], [ 0xFE00, 0xFE0F ],
+ [ 0xFE20, 0xFE23 ], [ 0xFEFF, 0xFEFF ], [ 0xFFF9, 0xFFFB ],
+ [ 0x10A01, 0x10A03 ], [ 0x10A05, 0x10A06 ], [ 0x10A0C, 0x10A0F ],
+ [ 0x10A38, 0x10A3A ], [ 0x10A3F, 0x10A3F ], [ 0x1D167, 0x1D169 ],
+ [ 0x1D173, 0x1D182 ], [ 0x1D185, 0x1D18B ], [ 0x1D1AA, 0x1D1AD ],
+ [ 0x1D242, 0x1D244 ], [ 0xE0001, 0xE0001 ], [ 0xE0020, 0xE007F ],
+ [ 0xE0100, 0xE01EF ]
+ ];
+
+ // auxiliary function for binary search in interval table
+ var bisearch = function(ucs) {
+ var min = 0,
+ max = combining.length-1;
+ var mid;
+
+ if (ucs < combining[0][0] || ucs > combining[max][1])
+ return false;
+ while (max >= min) {
+ mid = Math.floor((min + max) / 2);
+ if (ucs > combining[mid][1])
+ min = mid + 1;
+ else if (ucs < combining[mid][0])
+ max = mid - 1;
+ else
+ return true;
+ }
+
+ return false;
+ }
+
+ // ucs = 'character' or charCode
+ var wcwidth = function (ucs) {
+ // test for 8-bit control characters
+ if (ucs === 0)
+ return option.nul;
+ if (ucs < 32 || (ucs >= 0x7f && ucs < 0xa0))
+ return option.control;
+
+ // binary search in table of non-spacing characters
+ if (bisearch(ucs))
+ return 0;
+
+ // if we arrive here, ucs is not a combining or C0/C1 control character
+ return 1 +
+ (ucs >= 0x1100 &&
+ (ucs <= 0x115f || // Hangul Jamo init. consonants
+ ucs == 0x2329 || ucs == 0x232a ||
+ (ucs >= 0x2e80 && ucs <= 0xa4cf &&
+ ucs != 0x303f) || // CJK ... Yi
+ (ucs >= 0xac00 && ucs <= 0xd7a3) || // Hangul Syllables
+ (ucs >= 0xf900 && ucs <= 0xfaff) || // CJK Compatibility Ideographs
+ (ucs >= 0xfe10 && ucs <= 0xfe19) || // Vertical forms
+ (ucs >= 0xfe30 && ucs <= 0xfe6f) || // CJK Compatibility Forms
+ (ucs >= 0xff00 && ucs <= 0xff60) || // Fullwidth Forms
+ (ucs >= 0xffe0 && ucs <= 0xffe6) ||
+ (ucs >= 0x20000 && ucs <= 0x2fffd) ||
+ (ucs >= 0x30000 && ucs <= 0x3fffd)));
+ };
+
+ var wcswidth = function (str) {
+ var i, l, n, s = 0;
+
+ if (_.isString(str))
+ for (i=0, l=str.length; i < l; i++) {
+ if ((n = wcwidth(str.charCodeAt(i))) < 0)
+ return -1;
+ s += n;
+ }
+ else
+ s = wcwidth(str);
+
+ return s;
+ };
+
+ option = _.extend({
+ nul: 0,
+ control: -1,
+ monkeypatch: true
+ }, option);
+
+ if (option.monkeypatch)
+ String.prototype.__defineGetter__('wcwidth', function () {
+ return wcswidth(this);
+ });
+
+ return wcswidth;
+};
+
+
+/*
+(function () {
+ var ww = wcwidth();
+ var test = [
+ '다섯글자임',
+ 'four',
+ 'ten chars',
+ ' \n\t',
+ '\0'
+ ];
+
+ for (var i = 0; i < test.length; i++)
+ console.log(test[i], test[i].length, ww(test[i]), test[i].wcwidth);
+ console.log(ww('한글'));
+ console.log(ww('한'.charCodeAt(0)));
+}());
+*/
+
+
+/*
+(function () {
+ var ww = wcwidth({
+ nul: 1,
+ control: 1,
+ monkeypatch: false
+ });
+ var test = [
+ '다섯글자임',
+ 'four',
+ 'ten chars',
+ ' \n\t',
+ '\0'
+ ];
+
+ for (var i = 0; i < test.length; i++)
+ console.log(test[i], test[i].length, ww(test[i]), test[i].wcwidth);
+ console.log(ww('한글'));
+ console.log(ww('한'.charCodeAt(0)));
+}());
+*/
+
+// end of wcwidth.js
diff --git a/deps/npm/node_modules/columnify/package.json b/deps/npm/node_modules/columnify/package.json
index 5ad3d4a720..ba3124f147 100644
--- a/deps/npm/node_modules/columnify/package.json
+++ b/deps/npm/node_modules/columnify/package.json
@@ -1,18 +1,19 @@
{
"name": "columnify",
- "version": "0.1.2",
+ "version": "1.1.0",
"description": "Render data in text columns, supports in-column text-wrap.",
"main": "index.js",
"scripts": {
- "test": "tap test"
+ "test": "faucet"
},
"author": {
"name": "Tim Oxley"
},
"license": "MIT",
"devDependencies": {
- "tape": "~2.3.0",
- "tap": "~0.4.6"
+ "chalk": "^0.4.0",
+ "faucet": "0.0.1",
+ "tape": "~2.12.3"
},
"repository": {
"type": "git",
@@ -31,13 +32,17 @@
"url": "https://github.com/timoxley/columnify/issues"
},
"homepage": "https://github.com/timoxley/columnify",
- "_id": "columnify@0.1.2",
- "dist": {
- "shasum": "ab1a1f1e37b26ba4b87c6920fb717fe51c827042",
- "tarball": "http://registry.npmjs.org/columnify/-/columnify-0.1.2.tgz"
+ "dependencies": {
+ "strip-ansi": "^0.2.1",
+ "wcwidth.js": "~0.0.4"
+ },
+ "directories": {
+ "test": "test"
},
- "_from": "columnify@0.1.2",
- "_npmVersion": "1.3.23",
+ "_id": "columnify@1.1.0",
+ "_shasum": "0b908e6d4f1c80194358a1933aaf9dc49271c679",
+ "_from": "columnify@latest",
+ "_npmVersion": "1.4.10",
"_npmUser": {
"name": "timoxley",
"email": "secoif@gmail.com"
@@ -48,7 +53,10 @@
"email": "secoif@gmail.com"
}
],
- "directories": {},
- "_shasum": "ab1a1f1e37b26ba4b87c6920fb717fe51c827042",
- "_resolved": "https://registry.npmjs.org/columnify/-/columnify-0.1.2.tgz"
+ "dist": {
+ "shasum": "0b908e6d4f1c80194358a1933aaf9dc49271c679",
+ "tarball": "http://registry.npmjs.org/columnify/-/columnify-1.1.0.tgz"
+ },
+ "_resolved": "https://registry.npmjs.org/columnify/-/columnify-1.1.0.tgz",
+ "readme": "ERROR: No README data found!"
}
diff --git a/deps/npm/node_modules/columnify/utils.js b/deps/npm/node_modules/columnify/utils.js
index bd7641da42..12c4f003c5 100644
--- a/deps/npm/node_modules/columnify/utils.js
+++ b/deps/npm/node_modules/columnify/utils.js
@@ -1,3 +1,7 @@
+"use strict"
+
+var wcwidth = require('./width')
+
/**
* Pad `str` up to total length `max` with `chr`.
* If `str` is longer than `max`, padRight will return `str` unaltered.
@@ -11,15 +15,33 @@
function padRight(str, max, chr) {
str = str != null ? str : ''
str = String(str)
- var length = 1 + max - str.length
+ var length = 1 + max - wcwidth(str)
if (length <= 0) return str
return str + Array.apply(null, {length: length})
.join(chr || ' ')
}
/**
+ * Pad `str` up to total length `max` with `chr`, on the left.
+ * If `str` is longer than `max`, padRight will return `str` unaltered.
+ *
+ * @param String str string to pad
+ * @param Number max total length of output string
+ * @param String chr optional. Character to pad with. default: ' '
+ * @return String padded str
+ */
+
+function padLeft(str, max, chr) {
+ str = str != null ? str : ''
+ str = String(str)
+ var length = 1 + max - wcwidth(str)
+ if (length <= 0) return str
+ return Array.apply(null, {length: length}).join(chr || ' ') + str
+}
+
+/**
* Split a String `str` into lines of maxiumum length `max`.
- * Splits on word boundaries.
+ * Splits on word boundaries. Preserves existing new lines.
*
* @param String str string to split
* @param Number max length of each line
@@ -27,16 +49,23 @@ function padRight(str, max, chr) {
*/
function splitIntoLines(str, max) {
- return str.trim().split(' ').reduce(function(lines, word) {
- var line = lines[lines.length - 1]
- if (line && line.join(' ').length + word.length < max) {
- lines[lines.length - 1].push(word) // add to line
- }
- else lines.push([word]) // new line
- return lines
- }, []).map(function(l) {
- return l.join(' ')
- })
+ function _splitIntoLines(str, max) {
+ return str.trim().split(' ').reduce(function(lines, word) {
+ var line = lines[lines.length - 1]
+ if (line && wcwidth(line.join(' ')) + wcwidth(word) < max) {
+ lines[lines.length - 1].push(word) // add to line
+ }
+ else lines.push([word]) // new line
+ return lines
+ }, []).map(function(l) {
+ return l.join(' ')
+ })
+ }
+ return str.split('\n').map(function(str) {
+ return _splitIntoLines(str, max)
+ }).reduce(function(lines, line) {
+ return lines.concat(line)
+ }, [])
}
/**
@@ -55,22 +84,67 @@ function splitLongWords(str, max, truncationChar, result) {
if (!str) return result.join(' ') || ''
var words = str.split(' ')
var word = words.shift() || str
+ if (wcwidth(word) > max) {
+ // slice is based on length no wcwidth
+ var i = 0
+ var wwidth = 0
+ var limit = max - wcwidth(truncationChar)
+ while (i < word.length) {
+ var w = wcwidth(word.charAt(i))
+ if(w + wwidth > limit)
+ break
+ wwidth += w
+ ++i
+ }
- if (word.length > max) {
- var remainder = word.slice(max - truncationChar.length) // get remainder
+ var remainder = word.slice(i) // get remainder
words.unshift(remainder) // save remainder for next loop
- word = word.slice(0, max - truncationChar.length) // grab truncated word
+ word = word.slice(0, i) // grab truncated word
word += truncationChar // add trailing … or whatever
}
result.push(word)
return splitLongWords(words.join(' '), max, truncationChar, result)
}
+
+/**
+ * Truncate `str` into total width `max`
+ * If `str` is shorter than `max`, will return `str` unaltered.
+ *
+ * @param String str string to truncated
+ * @param Number max total wcwidth of output string
+ * @return String truncated str
+ */
+
+function truncateString(str, max) {
+
+ str = str != null ? str : ''
+ str = String(str)
+
+ if(max == Infinity) return str
+
+ var i = 0
+ var wwidth = 0
+ while (i < str.length) {
+ var w = wcwidth(str.charAt(i))
+ if(w + wwidth > max)
+ break
+ wwidth += w
+ ++i
+ }
+ return str.slice(0, i)
+}
+
+
+
/**
* Exports
*/
module.exports.padRight = padRight
+module.exports.padLeft = padLeft
module.exports.splitIntoLines = splitIntoLines
module.exports.splitLongWords = splitLongWords
+module.exports.truncateString = truncateString
+
diff --git a/deps/npm/node_modules/columnify/width.js b/deps/npm/node_modules/columnify/width.js
new file mode 100644
index 0000000000..8498f40838
--- /dev/null
+++ b/deps/npm/node_modules/columnify/width.js
@@ -0,0 +1,6 @@
+var stripAnsi = require('strip-ansi')
+var wcwidth = require('wcwidth.js')({ monkeypatch: false, control: 0 })
+
+module.exports = function(str) {
+ return wcwidth(stripAnsi(str))
+}