pax_global_header 0000666 0000000 0000000 00000000064 13427152270 0014515 g ustar 00root root 0000000 0000000 52 comment=3c1f1a745f8b3affcbdc394cf586da0d9c387b45
d3-dsv-1.1.1/ 0000775 0000000 0000000 00000000000 13427152270 0012615 5 ustar 00root root 0000000 0000000 d3-dsv-1.1.1/.eslintrc.json 0000664 0000000 0000000 00000000342 13427152270 0015410 0 ustar 00root root 0000000 0000000 {
"extends": "eslint:recommended",
"parserOptions": {
"sourceType": "module",
"ecmaVersion": 8
},
"env": {
"es6": true,
"node": true,
"browser": true
},
"rules": {
"no-cond-assign": 0
}
}
d3-dsv-1.1.1/.gitignore 0000664 0000000 0000000 00000000077 13427152270 0014611 0 ustar 00root root 0000000 0000000 *.sublime-workspace
.DS_Store
dist/
node_modules
npm-debug.log
d3-dsv-1.1.1/.npmignore 0000664 0000000 0000000 00000000042 13427152270 0014610 0 ustar 00root root 0000000 0000000 *.sublime-*
dist/*.zip
img/
test/
d3-dsv-1.1.1/LICENSE 0000664 0000000 0000000 00000002703 13427152270 0013624 0 ustar 00root root 0000000 0000000 Copyright 2013-2016 Mike Bostock
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of the author nor the names of contributors may be used to
endorse or promote products derived from this software without specific prior
written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "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 COPYRIGHT OWNER 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.
d3-dsv-1.1.1/README.md 0000664 0000000 0000000 00000056076 13427152270 0014112 0 ustar 00root root 0000000 0000000 # d3-dsv
This module provides a parser and formatter for delimiter-separated values, most commonly [comma-](https://en.wikipedia.org/wiki/Comma-separated_values) (CSV) or tab-separated values (TSV). These tabular formats are popular with spreadsheet programs such as Microsoft Excel, and are often more space-efficient than JSON. This implementation is based on [RFC 4180](http://tools.ietf.org/html/rfc4180).
Comma (CSV) and tab (TSV) delimiters are built-in. For example, to parse:
```js
d3.csvParse("foo,bar\n1,2"); // [{foo: "1", bar: "2"}, columns: ["foo", "bar"]]
d3.tsvParse("foo\tbar\n1\t2"); // [{foo: "1", bar: "2"}, columns: ["foo", "bar"]]
```
Or to format:
```js
d3.csvFormat([{foo: "1", bar: "2"}]); // "foo,bar\n1,2"
d3.tsvFormat([{foo: "1", bar: "2"}]); // "foo\tbar\n1\t2"
```
To use a different delimiter, such as “|” for pipe-separated values, use [d3.dsvFormat](#dsvFormat):
```js
var psv = d3.dsvFormat("|");
console.log(psv.parse("foo|bar\n1|2")); // [{foo: "1", bar: "2"}, columns: ["foo", "bar"]]
```
For easy loading of DSV files in a browser, see [d3-fetch](https://github.com/d3/d3-fetch)’s [d3.csv](https://github.com/d3/d3-fetch/blob/master/README.md#csv) and [d3.tsv](https://github.com/d3/d3-fetch/blob/master/README.md#tsv) methods.
## Installing
If you use NPM, `npm install d3-dsv`. Otherwise, download the [latest release](https://github.com/d3/d3-dsv/releases/latest). You can also load directly from [d3js.org](https://d3js.org), either as a [standalone library](https://d3js.org/d3-dsv.v1.min.js) or as part of [D3](https://github.com/d3/d3). AMD, CommonJS, and vanilla environments are supported. In vanilla, a `d3` global is exported:
```html
```
[Try d3-dsv in your browser.](https://tonicdev.com/npm/d3-dsv)
## API Reference
# d3.csvParse(string[, row]) [<>](https://github.com/d3/d3-dsv/blob/master/src/csv.js "Source")
Equivalent to [dsvFormat](#dsvFormat)(",").[parse](#dsv_parse).
# d3.csvParseRows(string[, row]) [<>](https://github.com/d3/d3-dsv/blob/master/src/csv.js "Source")
Equivalent to [dsvFormat](#dsvFormat)(",").[parseRows](#dsv_parseRows).
# d3.csvFormat(rows[, columns]) [<>](https://github.com/d3/d3-dsv/blob/master/src/csv.js "Source")
Equivalent to [dsvFormat](#dsvFormat)(",").[format](#dsv_format).
# d3.csvFormatBody(rows[, columns]) [<>](https://github.com/d3/d3-dsv/blob/master/src/csv.js "Source")
Equivalent to [dsvFormat](#dsvFormat)(",").[formatBody](#dsv_formatBody).
# d3.csvFormatRows(rows) [<>](https://github.com/d3/d3-dsv/blob/master/src/csv.js "Source")
Equivalent to [dsvFormat](#dsvFormat)(",").[formatRows](#dsv_formatRows).
# d3.tsvParse(string[, row]) [<>](https://github.com/d3/d3-dsv/blob/master/src/tsv.js "Source")
Equivalent to [dsvFormat](#dsvFormat)("\t").[parse](#dsv_parse).
# d3.tsvParseRows(string[, row]) [<>](https://github.com/d3/d3-dsv/blob/master/src/tsv.js "Source")
Equivalent to [dsvFormat](#dsvFormat)("\t").[parseRows](#dsv_parseRows).
# d3.tsvFormat(rows[, columns]) [<>](https://github.com/d3/d3-dsv/blob/master/src/tsv.js "Source")
Equivalent to [dsvFormat](#dsvFormat)("\t").[format](#dsv_format).
# d3.tsvFormatBody(rows[, columns]) [<>](https://github.com/d3/d3-dsv/blob/master/src/tsv.js "Source")
Equivalent to [dsvFormat](#dsvFormat)("\t").[formatBody](#dsv_formatBody).
# d3.tsvFormatRows(rows) [<>](https://github.com/d3/d3-dsv/blob/master/src/tsv.js "Source")
Equivalent to [dsvFormat](#dsvFormat)("\t").[formatRows](#dsv_formatRows).
# d3.dsvFormat(delimiter) [<>](https://github.com/d3/d3-dsv/blob/master/src/dsv.js)
Constructs a new DSV parser and formatter for the specified *delimiter*. The *delimiter* must be a single character (*i.e.*, a single 16-bit code unit); so, ASCII delimiters are fine, but emoji delimiters are not.
# *dsv*.parse(string[, row]) [<>](https://github.com/d3/d3-dsv/blob/master/src/dsv.js "Source")
Parses the specified *string*, which must be in the delimiter-separated values format with the appropriate delimiter, returning an array of objects representing the parsed rows.
Unlike [*dsv*.parseRows](#dsv_parseRows), this method requires that the first line of the DSV content contains a delimiter-separated list of column names; these column names become the attributes on the returned objects. For example, consider the following CSV file:
```
Year,Make,Model,Length
1997,Ford,E350,2.34
2000,Mercury,Cougar,2.38
```
The resulting JavaScript array is:
```js
[
{"Year": "1997", "Make": "Ford", "Model": "E350", "Length": "2.34"},
{"Year": "2000", "Make": "Mercury", "Model": "Cougar", "Length": "2.38"}
]
```
The returned array also exposes a `columns` property containing the column names in input order (in contrast to Object.keys, whose iteration order is arbitrary). For example:
```js
data.columns; // ["Year", "Make", "Model", "Length"]
```
If a *row* conversion function is not specified, field values are strings. For safety, there is no automatic conversion to numbers, dates, or other types. In some cases, JavaScript may coerce strings to numbers for you automatically (for example, using the `+` operator), but better is to specify a *row* conversion function.
If a *row* conversion function is specified, the specified function is invoked for each row, being passed an object representing the current row (`d`), the index (`i`) starting at zero for the first non-header row, and the array of column names. If the returned value is null or undefined, the row is skipped and will be omitted from the array returned by *dsv*.parse; otherwise, the returned value defines the corresponding row object. For example:
```js
var data = d3.csvParse(string, function(d) {
return {
year: new Date(+d.Year, 0, 1), // lowercase and convert "Year" to Date
make: d.Make, // lowercase
model: d.Model, // lowercase
length: +d.Length // lowercase and convert "Length" to number
};
});
```
Note: using `+` rather than [parseInt](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/parseInt) or [parseFloat](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/parseFloat) is typically faster, though more restrictive. For example, `"30px"` when coerced using `+` returns `NaN`, while parseInt and parseFloat return `30`.
# dsv.parseRows(string[, row]) [<>](https://github.com/d3/d3-dsv/blob/master/src/dsv.js "Source")
Parses the specified *string*, which must be in the delimiter-separated values format with the appropriate delimiter, returning an array of arrays representing the parsed rows.
Unlike [*dsv*.parse](#dsv_parse), this method treats the header line as a standard row, and should be used whenever DSV content does not contain a header. Each row is represented as an array rather than an object. Rows may have variable length. For example, consider the following CSV file, which notably lacks a header line:
```
1997,Ford,E350,2.34
2000,Mercury,Cougar,2.38
```
The resulting JavaScript array is:
```js
[
["1997", "Ford", "E350", "2.34"],
["2000", "Mercury", "Cougar", "2.38"]
]
```
If a *row* conversion function is not specified, field values are strings. For safety, there is no automatic conversion to numbers, dates, or other types. In some cases, JavaScript may coerce strings to numbers for you automatically (for example, using the `+` operator), but better is to specify a *row* conversion function.
If a *row* conversion function is specified, the specified function is invoked for each row, being passed an array representing the current row (`d`), the index (`i`) starting at zero for the first row, and the array of column names. If the returned value is null or undefined, the row is skipped and will be omitted from the array returned by *dsv*.parse; otherwise, the returned value defines the corresponding row object. For example:
```js
var data = d3.csvParseRows(string, function(d, i) {
return {
year: new Date(+d[0], 0, 1), // convert first colum column to Date
make: d[1],
model: d[2],
length: +d[3] // convert fourth column to number
};
});
```
In effect, *row* is similar to applying a [map](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/map) and [filter](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/filter) operator to the returned rows.
# dsv.format(rows[, columns]) [<>](https://github.com/d3/d3-dsv/blob/master/src/dsv.js "Source")
Formats the specified array of object *rows* as delimiter-separated values, returning a string. This operation is the inverse of [*dsv*.parse](#dsv_parse). Each row will be separated by a newline (`\n`), and each column within each row will be separated by the delimiter (such as a comma, `,`). Values that contain either the delimiter, a double-quote (`"`) or a newline will be escaped using double-quotes.
If *columns* is not specified, the list of column names that forms the header row is determined by the union of all properties on all objects in *rows*; the order of columns is nondeterministic. If *columns* is specified, it is an array of strings representing the column names. For example:
```js
var string = d3.csvFormat(data, ["year", "make", "model", "length"]);
```
All fields on each row object will be coerced to strings. If the field value is null or undefined, the empty string is used. If the field value is a Date, the [ECMAScript date-time string format](https://www.ecma-international.org/ecma-262/9.0/index.html#sec-date-time-string-format) (a subset of ISO 8601) is used: for example, dates at UTC midnight are formatted as `YYYY-MM-DD`. For more control over which and how fields are formatted, first map *rows* to an array of array of string, and then use [*dsv*.formatRows](#dsv_formatRows).
# dsv.formatBody(rows[, columns]) [<>](https://github.com/d3/d3-dsv/blob/master/src/dsv.js "Source")
Equivalent to [*dsv*.format](#dsv_format), but omits the header row. This is useful, for example, when appending rows to an existing file.
# dsv.formatRows(rows) [<>](https://github.com/d3/d3-dsv/blob/master/src/dsv.js "Source")
Formats the specified array of array of string *rows* as delimiter-separated values, returning a string. This operation is the reverse of [*dsv*.parseRows](#dsv_parseRows). Each row will be separated by a newline (`\n`), and each column within each row will be separated by the delimiter (such as a comma, `,`). Values that contain either the delimiter, a double-quote (") or a newline will be escaped using double-quotes.
To convert an array of objects to an array of arrays while explicitly specifying the columns, use [*array*.map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map). For example:
```js
var string = d3.csvFormatRows(data.map(function(d, i) {
return [
d.year.getFullYear(), // Assuming d.year is a Date object.
d.make,
d.model,
d.length
];
}));
```
If you like, you can also [*array*.concat](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/concat) this result with an array of column names to generate the first row:
```js
var string = d3.csvFormatRows([[
"year",
"make",
"model",
"length"
]].concat(data.map(function(d, i) {
return [
d.year.getFullYear(), // Assuming d.year is a Date object.
d.make,
d.model,
d.length
];
})));
```
# d3.autoType(object) [<>](https://github.com/d3/d3-dsv/blob/master/src/autoType.js "Source")
Given an *object* (or array) representing a parsed row, infers the types of values on the *object* and coerces them accordingly, returning the mutated *object*. This function is intended to be used as a *row* accessor function in conjunction with [*dsv*.parse](#dsv_parse) and [*dsv*.parseRows](#dsv_parseRow). For example, consider the following CSV file:
```
Year,Make,Model,Length
1997,Ford,E350,2.34
2000,Mercury,Cougar,2.38
```
When used with [d3.csvParse](#csvParse),
```js
d3.csvParse(string, d3.autoType)
```
the resulting JavaScript array is:
```js
[
{"Year": 1997, "Make": "Ford", "Model": "E350", "Length": 2.34},
{"Year": 2000, "Make": "Mercury", "Model": "Cougar", "Length": 2.38}
]
```
Type inference works as follows. For each *value* in the given *object*, the [trimmed](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/Trim) value is computed; the value is then re-assigned as follows:
1. If empty, then `null`.
1. If exactly `"true"`, then `true`.
1. If exactly `"false"`, then `false`.
1. If exactly `"NaN"`, then `NaN`.
1. Otherwise, if [coercible to a number](https://www.ecma-international.org/ecma-262/9.0/index.html#sec-tonumber-applied-to-the-string-type), then a number.
1. Otherwise, if a [date-only or date-time string](https://www.ecma-international.org/ecma-262/9.0/index.html#sec-date-time-string-format), then a Date.
1. Otherwise, a string (the original untrimmed value).
Values with leading zeroes may be coerced to numbers; for example `"08904"` coerces to `8904`. However, extra characters such as commas or units (*e.g.*, `"$1.00"`, `"(123)"`, `"1,234"` or `"32px"`) will prevent number coercion, resulting in a string.
Date strings must be in ECMAScript’s subset of the [ISO 8601 format](https://en.wikipedia.org/wiki/ISO_8601). When a date-only string such as YYYY-MM-DD is specified, the inferred time is midnight UTC; however, if a date-time string such as YYYY-MM-DDTHH:MM is specified without a time zone, it is assumed to be local time.
Automatic type inference is primarily intended to provide safe, predictable behavior in conjunction with [*dsv*.format](#dsv_format) and [*dsv*.formatRows](#dsv_formatRows) for common JavaScript types. If you need different behavior, you should implement your own row accessor function.
For more, see [the d3.autoType notebook](https://beta.observablehq.com/@d3/d3-autotype).
### Content Security Policy
If a [content security policy](http://www.w3.org/TR/CSP/) is in place, note that [*dsv*.parse](#dsv_parse) requires `unsafe-eval` in the `script-src` directive, due to the (safe) use of dynamic code generation for fast parsing. (See [source](https://github.com/d3/d3-dsv/blob/master/src/dsv.js).) Alternatively, use [*dsv*.parseRows](#dsv_parseRows).
### Byte-Order Marks
DSV files sometimes begin with a [byte order mark (BOM)](https://en.wikipedia.org/wiki/Byte_order_mark); saving a spreadsheet in CSV UTF-8 format from Microsoft Excel, for example, will include a BOM. On the web this is not usually a problem because the [UTF-8 decode algorithm](https://encoding.spec.whatwg.org/#utf-8-decode) specified in the Encoding standard removes the BOM. Node.js, on the other hand, [does not remove the BOM](https://github.com/nodejs/node-v0.x-archive/issues/1918) when decoding UTF-8.
If the BOM is not removed, the first character of the text is a zero-width non-breaking space. So if a CSV file with a BOM is parsed by [d3.csvParse](#csvParse), the first column’s name will begin with a zero-width non-breaking space. This can be hard to spot since this character is usually invisible when printed.
To remove the BOM before parsing, consider using [strip-bom](https://www.npmjs.com/package/strip-bom).
## Command Line Reference
### dsv2dsv
# dsv2dsv [options…] [file]
Converts the specified DSV input *file* to DSV (typically with a different delimiter or encoding). If *file* is not specified, defaults to reading from stdin. For example, to convert to CSV to TSV:
```
csv2tsv < example.csv > example.tsv
```
To convert windows-1252 CSV to utf-8 CSV:
```
dsv2dsv --input-encoding windows-1252 < latin1.csv > utf8.csv
```
# dsv2dsv -h
# dsv2dsv --help
Output usage information.
# dsv2dsv -V
# dsv2dsv --version
Output the version number.
# dsv2dsv -o file
# dsv2dsv --out file
Specify the output file name. Defaults to “-” for stdout.
# dsv2dsv -r delimiter
# dsv2dsv --input-delimiter delimiter
Specify the input delimiter character. Defaults to “,” for reading CSV. (You can enter a tab on the command line by typing ⌃V.)
# dsv2dsv --input-encoding encoding
Specify the input character encoding. Defaults to “utf8”.
# dsv2dsv -w delimiter
# dsv2dsv --output-delimiter delimiter
Specify the output delimiter character. Defaults to “,” for writing CSV. (You can enter a tab on the command line by typing ⌃V.)
# dsv2dsv --output-encoding encoding
Specify the output character encoding. Defaults to “utf8”.
# csv2tsv [options…] [file]
Equivalent to [dsv2dsv](#dsv2dsv), but the [output delimiter](#dsv2dsv_output_delimiter) defaults to the tab character (\t).
# tsv2csv [options…] [file]
Equivalent to [dsv2dsv](#dsv2dsv), but the [input delimiter](#dsv2dsv_output_delimiter) defaults to the tab character (\t).
### dsv2json
# dsv2json [options…] [file]
Converts the specified DSV input *file* to JSON. If *file* is not specified, defaults to reading from stdin. For example, to convert to CSV to JSON:
```
csv2json < example.csv > example.json
```
Or to convert CSV to a newline-delimited JSON stream:
```
csv2json -n < example.csv > example.ndjson
```
# dsv2json -h
# dsv2json --help
Output usage information.
# dsv2json -V
# dsv2json --version
Output the version number.
# dsv2json -o file
# dsv2json --out file
Specify the output file name. Defaults to “-” for stdout.
# dsv2json -r delimiter
# dsv2json --input-delimiter delimiter
Specify the input delimiter character. Defaults to “,” for reading CSV. (You can enter a tab on the command line by typing ⌃V.)
# dsv2json --input-encoding encoding
Specify the input character encoding. Defaults to “utf8”.
# dsv2json -r encoding
# dsv2json --output-encoding encoding
Specify the output character encoding. Defaults to “utf8”.
# dsv2json -n
# dsv2json --newline-delimited
Output [newline-delimited JSON](https://github.com/mbostock/ndjson-cli) instead of a single JSON array.
# csv2json [options…] [file]
Equivalent to [dsv2json](#dsv2json).
# tsv2json [options…] [file]
Equivalent to [dsv2json](#dsv2json), but the [input delimiter](#dsv2json_input_delimiter) defaults to the tab character (\t).
### json2dsv
# json2dsv [options…] [file]
Converts the specified JSON input *file* to DSV. If *file* is not specified, defaults to reading from stdin. For example, to convert to JSON to CSV:
```
json2csv < example.json > example.csv
```
Or to convert a newline-delimited JSON stream to CSV:
```
json2csv -n < example.ndjson > example.csv
```
# json2dsv -h
# json2dsv --help
Output usage information.
# json2dsv -V
# json2dsv --version
Output the version number.
# json2dsv -o file
# json2dsv --out file
Specify the output file name. Defaults to “-” for stdout.
# json2dsv --input-encoding encoding
Specify the input character encoding. Defaults to “utf8”.
# json2dsv -w delimiter
# json2dsv --output-delimiter delimiter
Specify the output delimiter character. Defaults to “,” for writing CSV. (You can enter a tab on the command line by typing ⌃V.)
# json2dsv --output-encoding encoding
Specify the output character encoding. Defaults to “utf8”.
# json2dsv -n
# json2dsv --newline-delimited
Read [newline-delimited JSON](https://github.com/mbostock/ndjson-cli) instead of a single JSON array.
# csv2json [options…] [file]
Equivalent to [json2dsv](#json2dsv).
# tsv2json [options…] [file]
Equivalent to [json2dsv](#json2dsv), but the [output delimiter](#json2dsv_output_delimiter) defaults to the tab character (\t).
d3-dsv-1.1.1/bin/ 0000775 0000000 0000000 00000000000 13427152270 0013365 5 ustar 00root root 0000000 0000000 d3-dsv-1.1.1/bin/dsv2dsv 0000775 0000000 0000000 00000002576 13427152270 0014720 0 ustar 00root root 0000000 0000000 #!/usr/bin/env node
var os = require("os"),
rw = require("rw").dash,
path = require("path"),
iconv = require("iconv-lite"),
commander = require("commander"),
dsv = require("../");
var program = path.basename(process.argv[1]),
defaultInDelimiter = program.slice(0, 3) === "tsv" ? "\t" : ",",
defaultOutDelimiter = program.slice(-3) === "tsv" ? "\t" : ",";
commander
.version(require("../package.json").version)
.usage("[options] [file]")
.option("-o, --out ", "output file name; defaults to “-” for stdout", "-")
.option("-r, --input-delimiter ", "input delimiter character", defaultInDelimiter)
.option("-w, --output-delimiter ", "output delimiter character", defaultOutDelimiter)
.option("--input-encoding ", "input character encoding; defaults to “utf8”", "utf8")
.option("--output-encoding ", "output character encoding; defaults to “utf8”", "utf8")
.parse(process.argv);
var inFormat = dsv.dsvFormat(commander.inputDelimiter),
outFormat = dsv.dsvFormat(commander.outputDelimiter);
rw.readFile(commander.args[0] || "-", function(error, text) {
if (error) throw error;
rw.writeFile("-", iconv.encode(outFormat.format(inFormat.parse(iconv.decode(text, commander.inputEncoding))) + os.EOL, commander.outputEncoding), function(error) {
if (error) throw error;
});
});
d3-dsv-1.1.1/bin/dsv2json 0000775 0000000 0000000 00000002563 13427152270 0015071 0 ustar 00root root 0000000 0000000 #!/usr/bin/env node
var os = require("os"),
rw = require("rw").dash,
path = require("path"),
iconv = require("iconv-lite"),
commander = require("commander"),
dsv = require("../");
var program = path.basename(process.argv[1]),
defaultInDelimiter = program.slice(0, 3) === "tsv" ? "\t" : ",";
commander
.version(require("../package.json").version)
.usage("[options] [file]")
.option("-o, --out ", "output file name; defaults to “-” for stdout", "-")
.option("-r, --input-delimiter ", "input delimiter character", defaultInDelimiter)
.option("-n, --newline-delimited", "output newline-delimited JSON")
.option("--input-encoding ", "input character encoding; defaults to “utf8”", "utf8")
.option("--output-encoding ", "output character encoding; defaults to “utf8”", "utf8")
.parse(process.argv);
var inFormat = dsv.dsvFormat(commander.inputDelimiter);
rw.readFile(commander.args[0] || "-", function(error, text) {
if (error) throw error;
var rows = inFormat.parse(iconv.decode(text, commander.inputEncoding));
rw.writeFile(commander.out, iconv.encode(commander.newlineDelimited
? rows.map(function(row) { return JSON.stringify(row); }).join("\n") + "\n"
: JSON.stringify(rows) + os.EOL, commander.outputEncoding), function(error) {
if (error) throw error;
});
});
d3-dsv-1.1.1/bin/json2dsv 0000775 0000000 0000000 00000002564 13427152270 0015072 0 ustar 00root root 0000000 0000000 #!/usr/bin/env node
var os = require("os"),
rw = require("rw").dash,
path = require("path"),
iconv = require("iconv-lite"),
commander = require("commander"),
dsv = require("../");
var program = path.basename(process.argv[1]),
defaultOutDelimiter = program.slice(-3) === "tsv" ? "\t" : ",";
commander
.version(require("../package.json").version)
.usage("[options] [file]")
.option("-o, --out ", "output file name; defaults to “-” for stdout", "-")
.option("-w, --output-delimiter ", "output delimiter character", defaultOutDelimiter)
.option("-n, --newline-delimited", "accept newline-delimited JSON")
.option("--input-encoding ", "input character encoding; defaults to “utf8”", "utf8")
.option("--output-encoding ", "output character encoding; defaults to “utf8”", "utf8")
.parse(process.argv);
var outFormat = dsv.dsvFormat(commander.outputDelimiter);
rw.readFile(commander.args[0] || "-", function(error, text) {
if (error) throw error;
text = iconv.decode(text, commander.inputEncoding);
rw.writeFile(commander.out, iconv.encode(outFormat.format(commander.newlineDelimited
? text.trim().split(/\r?\n/g).map(function(line) { return JSON.parse(line); })
: JSON.parse(text)) + os.EOL, commander.outputEncoding), function(error) {
if (error) throw error;
});
});
d3-dsv-1.1.1/d3-dsv.sublime-project 0000664 0000000 0000000 00000000524 13427152270 0016744 0 ustar 00root root 0000000 0000000 {
"folders": [
{
"path": ".",
"file_exclude_patterns": ["*.sublime-workspace"],
"folder_exclude_patterns": ["dist"]
}
],
"build_systems": [
{
"name": "yarn test",
"cmd": ["yarn", "test"],
"file_regex": "\\((...*?):([0-9]*):([0-9]*)\\)",
"working_dir": "$project_path"
}
]
}
d3-dsv-1.1.1/package.json 0000664 0000000 0000000 00000003556 13427152270 0015114 0 ustar 00root root 0000000 0000000 {
"name": "d3-dsv",
"version": "1.1.1",
"description": "A parser and formatter for delimiter-separated values, such as CSV and TSV",
"keywords": [
"d3",
"d3-module",
"dsv",
"csv",
"tsv"
],
"homepage": "https://d3js.org/d3-dsv/",
"license": "BSD-3-Clause",
"author": {
"name": "Mike Bostock",
"url": "http://bost.ocks.org/mike"
},
"main": "dist/d3-dsv.js",
"unpkg": "dist/d3-dsv.min.js",
"jsdelivr": "dist/d3-dsv.min.js",
"module": "src/index.js",
"bin": {
"csv2json": "bin/dsv2json",
"csv2tsv": "bin/dsv2dsv",
"dsv2dsv": "bin/dsv2dsv",
"dsv2json": "bin/dsv2json",
"json2csv": "bin/json2dsv",
"json2dsv": "bin/json2dsv",
"json2tsv": "bin/json2dsv",
"tsv2csv": "bin/dsv2dsv",
"tsv2json": "bin/dsv2json"
},
"repository": {
"type": "git",
"url": "https://github.com/d3/d3-dsv.git"
},
"scripts": {
"pretest": "rollup -c",
"test": "tape 'test/**/*-test.js' && eslint src test",
"prepublishOnly": "rm -rf dist && yarn test",
"postpublish": "git push && git push --tags && cd ../d3.github.com && git pull && cp ../${npm_package_name}/dist/${npm_package_name}.js ${npm_package_name}.v${npm_package_version%%.*}.js && cp ../${npm_package_name}/dist/${npm_package_name}.min.js ${npm_package_name}.v${npm_package_version%%.*}.min.js && git add ${npm_package_name}.v${npm_package_version%%.*}.js ${npm_package_name}.v${npm_package_version%%.*}.min.js && git commit -m \"${npm_package_name} ${npm_package_version}\" && git push && cd - && zip -j dist/${npm_package_name}.zip -- LICENSE README.md dist/${npm_package_name}.js dist/${npm_package_name}.min.js"
},
"dependencies": {
"commander": "2",
"iconv-lite": "0.4",
"rw": "1"
},
"devDependencies": {
"csv-spectrum": "1",
"eslint": "5",
"rollup": "0.64",
"rollup-plugin-terser": "1",
"tape": "4"
}
}
d3-dsv-1.1.1/rollup.config.js 0000664 0000000 0000000 00000001545 13427152270 0015741 0 ustar 00root root 0000000 0000000 import {terser} from "rollup-plugin-terser";
import * as meta from "./package.json";
const config = {
input: "src/index.js",
external: Object.keys(meta.dependencies || {}).filter(key => /^d3-/.test(key)),
output: {
file: `dist/${meta.name}.js`,
name: "d3",
format: "umd",
indent: false,
extend: true,
banner: `// ${meta.homepage} v${meta.version} Copyright ${(new Date).getFullYear()} ${meta.author.name}`,
globals: Object.assign({}, ...Object.keys(meta.dependencies || {}).filter(key => /^d3-/.test(key)).map(key => ({[key]: "d3"})))
},
plugins: []
};
export default [
config,
{
...config,
output: {
...config.output,
file: `dist/${meta.name}.min.js`
},
plugins: [
...config.plugins,
terser({
output: {
preamble: config.output.banner
}
})
]
}
];
d3-dsv-1.1.1/src/ 0000775 0000000 0000000 00000000000 13427152270 0013404 5 ustar 00root root 0000000 0000000 d3-dsv-1.1.1/src/autoType.js 0000664 0000000 0000000 00000001042 13427152270 0015551 0 ustar 00root root 0000000 0000000 export default function autoType(object) {
for (var key in object) {
var value = object[key].trim(), number;
if (!value) value = null;
else if (value === "true") value = true;
else if (value === "false") value = false;
else if (value === "NaN") value = NaN;
else if (!isNaN(number = +value)) value = number;
else if (/^([-+]\d{2})?\d{4}(-\d{2}(-\d{2})?)?(T\d{2}:\d{2}(:\d{2}(\.\d{3})?)?(Z|[-+]\d{2}:\d{2})?)?$/.test(value)) value = new Date(value);
else continue;
object[key] = value;
}
return object;
}
d3-dsv-1.1.1/src/csv.js 0000664 0000000 0000000 00000000362 13427152270 0014536 0 ustar 00root root 0000000 0000000 import dsv from "./dsv";
var csv = dsv(",");
export var csvParse = csv.parse;
export var csvParseRows = csv.parseRows;
export var csvFormat = csv.format;
export var csvFormatBody = csv.formatBody;
export var csvFormatRows = csv.formatRows;
d3-dsv-1.1.1/src/dsv.js 0000664 0000000 0000000 00000011246 13427152270 0014542 0 ustar 00root root 0000000 0000000 var EOL = {},
EOF = {},
QUOTE = 34,
NEWLINE = 10,
RETURN = 13;
function objectConverter(columns) {
return new Function("d", "return {" + columns.map(function(name, i) {
return JSON.stringify(name) + ": d[" + i + "]";
}).join(",") + "}");
}
function customConverter(columns, f) {
var object = objectConverter(columns);
return function(row, i) {
return f(object(row), i, columns);
};
}
// Compute unique columns in order of discovery.
function inferColumns(rows) {
var columnSet = Object.create(null),
columns = [];
rows.forEach(function(row) {
for (var column in row) {
if (!(column in columnSet)) {
columns.push(columnSet[column] = column);
}
}
});
return columns;
}
function pad(value, width) {
var s = value + "", length = s.length;
return length < width ? new Array(width - length + 1).join(0) + s : s;
}
function formatYear(year) {
return year < 0 ? "-" + pad(-year, 6)
: year > 9999 ? "+" + pad(year, 6)
: pad(year, 4);
}
function formatDate(date) {
var hours = date.getUTCHours(),
minutes = date.getUTCMinutes(),
seconds = date.getUTCSeconds(),
milliseconds = date.getUTCMilliseconds();
return isNaN(date) ? "Invalid Date"
: formatYear(date.getUTCFullYear(), 4) + "-" + pad(date.getUTCMonth() + 1, 2) + "-" + pad(date.getUTCDate(), 2)
+ (milliseconds ? "T" + pad(hours, 2) + ":" + pad(minutes, 2) + ":" + pad(seconds, 2) + "." + pad(milliseconds, 3) + "Z"
: seconds ? "T" + pad(hours, 2) + ":" + pad(minutes, 2) + ":" + pad(seconds, 2) + "Z"
: minutes || hours ? "T" + pad(hours, 2) + ":" + pad(minutes, 2) + "Z"
: "");
}
export default function(delimiter) {
var reFormat = new RegExp("[\"" + delimiter + "\n\r]"),
DELIMITER = delimiter.charCodeAt(0);
function parse(text, f) {
var convert, columns, rows = parseRows(text, function(row, i) {
if (convert) return convert(row, i - 1);
columns = row, convert = f ? customConverter(row, f) : objectConverter(row);
});
rows.columns = columns || [];
return rows;
}
function parseRows(text, f) {
var rows = [], // output rows
N = text.length,
I = 0, // current character index
n = 0, // current line number
t, // current token
eof = N <= 0, // current token followed by EOF?
eol = false; // current token followed by EOL?
// Strip the trailing newline.
if (text.charCodeAt(N - 1) === NEWLINE) --N;
if (text.charCodeAt(N - 1) === RETURN) --N;
function token() {
if (eof) return EOF;
if (eol) return eol = false, EOL;
// Unescape quotes.
var i, j = I, c;
if (text.charCodeAt(j) === QUOTE) {
while (I++ < N && text.charCodeAt(I) !== QUOTE || text.charCodeAt(++I) === QUOTE);
if ((i = I) >= N) eof = true;
else if ((c = text.charCodeAt(I++)) === NEWLINE) eol = true;
else if (c === RETURN) { eol = true; if (text.charCodeAt(I) === NEWLINE) ++I; }
return text.slice(j + 1, i - 1).replace(/""/g, "\"");
}
// Find next delimiter or newline.
while (I < N) {
if ((c = text.charCodeAt(i = I++)) === NEWLINE) eol = true;
else if (c === RETURN) { eol = true; if (text.charCodeAt(I) === NEWLINE) ++I; }
else if (c !== DELIMITER) continue;
return text.slice(j, i);
}
// Return last token before EOF.
return eof = true, text.slice(j, N);
}
while ((t = token()) !== EOF) {
var row = [];
while (t !== EOL && t !== EOF) row.push(t), t = token();
if (f && (row = f(row, n++)) == null) continue;
rows.push(row);
}
return rows;
}
function preformatBody(rows, columns) {
return rows.map(function(row) {
return columns.map(function(column) {
return formatValue(row[column]);
}).join(delimiter);
});
}
function format(rows, columns) {
if (columns == null) columns = inferColumns(rows);
return [columns.map(formatValue).join(delimiter)].concat(preformatBody(rows, columns)).join("\n");
}
function formatBody(rows, columns) {
if (columns == null) columns = inferColumns(rows);
return preformatBody(rows, columns).join("\n");
}
function formatRows(rows) {
return rows.map(formatRow).join("\n");
}
function formatRow(row) {
return row.map(formatValue).join(delimiter);
}
function formatValue(value) {
return value == null ? ""
: value instanceof Date ? formatDate(value)
: reFormat.test(value += "") ? "\"" + value.replace(/"/g, "\"\"") + "\""
: value;
}
return {
parse: parse,
parseRows: parseRows,
format: format,
formatBody: formatBody,
formatRows: formatRows
};
}
d3-dsv-1.1.1/src/index.js 0000664 0000000 0000000 00000000412 13427152270 0015046 0 ustar 00root root 0000000 0000000 export {default as dsvFormat} from "./dsv";
export {csvParse, csvParseRows, csvFormat, csvFormatBody, csvFormatRows} from "./csv";
export {tsvParse, tsvParseRows, tsvFormat, tsvFormatBody, tsvFormatRows} from "./tsv";
export {default as autoType} from "./autoType";
d3-dsv-1.1.1/src/tsv.js 0000664 0000000 0000000 00000000363 13427152270 0014560 0 ustar 00root root 0000000 0000000 import dsv from "./dsv";
var tsv = dsv("\t");
export var tsvParse = tsv.parse;
export var tsvParseRows = tsv.parseRows;
export var tsvFormat = tsv.format;
export var tsvFormatBody = tsv.formatBody;
export var tsvFormatRows = tsv.formatRows;
d3-dsv-1.1.1/test/ 0000775 0000000 0000000 00000000000 13427152270 0013574 5 ustar 00root root 0000000 0000000 d3-dsv-1.1.1/test/autoType-test.js 0000664 0000000 0000000 00000011506 13427152270 0016724 0 ustar 00root root 0000000 0000000 var tape = require("tape"),
dsv = require("../");
tape("autoType(object) mutates in-place", function(test) {
var object = {foo: "4.2"};
test.strictEqual(dsv.autoType(object), object);
test.deepEqual(object, {foo: 4.2});
test.end();
});
tape("autoType(object) detects numbers", function(test) {
test.deepEqual(dsv.autoType({foo: "4.2"}), {foo: 4.2});
test.deepEqual(dsv.autoType({foo: "04.2"}), {foo: 4.2});
test.deepEqual(dsv.autoType({foo: "-4.2"}), {foo: -4.2});
test.deepEqual(dsv.autoType({foo: "1e4"}), {foo: 10000});
test.end();
});
tape("autoType(object) detects NaN", function(test) {
test.equal(Number.isNaN(dsv.autoType({foo: "NaN"}).foo), true);
test.end();
});
// https://www.ecma-international.org/ecma-262/9.0/index.html#sec-date-time-string-format
// When the time zone offset is absent, date-only forms are interpreted as a UTC time and date-time forms are interpreted as a local time.
// YYYY is ambiguous with number, so the number takes priority.
tape("autoType(object) detects dates", function(test) {
test.deepEqual(dsv.autoType({foo: "2018-01"}), {foo: new Date("2018-01-01T00:00:00.000Z")});
test.deepEqual(dsv.autoType({foo: "2018-01-01"}), {foo: new Date("2018-01-01T00:00:00.000Z")});
test.end();
});
tape("autoType(object) detects extended years", function(test) {
test.deepEqual(dsv.autoType({foo: "-010001-01-01T00:00:00Z"}), {foo: new Date("-010001-01-01T00:00:00Z")});
test.deepEqual(dsv.autoType({foo: "+010001-01-01T00:00:00Z"}), {foo: new Date("+010001-01-01T00:00:00Z")});
test.end();
});
tape("autoType(object) detects date-times", function(test) {
test.deepEqual(dsv.autoType({foo: "2018T00:00Z"}), {foo: new Date("2018-01-01T00:00:00.000Z")});
test.deepEqual(dsv.autoType({foo: "2018T00:00+08:00"}), {foo: new Date("2017-12-31T16:00:00.000Z")});
test.deepEqual(dsv.autoType({foo: "2018-01T12:23"}), {foo: new Date("2018-01-01T12:23:00.000")});
test.deepEqual(dsv.autoType({foo: "2018-01T12:23Z"}), {foo: new Date("2018-01-01T12:23:00.000Z")});
test.deepEqual(dsv.autoType({foo: "2018-01T12:23+00:00"}), {foo: new Date("2018-01-01T12:23:00.000Z")});
test.deepEqual(dsv.autoType({foo: "2018-01-01T00:00"}), {foo: new Date("2018-01-01T00:00:00.000")});
test.deepEqual(dsv.autoType({foo: "2018-01-01T00:00+00:00"}), {foo: new Date("2018-01-01T00:00:00.000Z")});
test.deepEqual(dsv.autoType({foo: "2018-01-01T00:00-00:00"}), {foo: new Date("2018-01-01T00:00:00.000Z")});
test.end();
});
tape("autoType(object) detects booleans", function(test) {
test.deepEqual(dsv.autoType({foo: "true"}), {foo: true});
test.deepEqual(dsv.autoType({foo: "false"}), {foo: false});
test.end();
});
tape("autoType(object) detects null", function(test) {
test.deepEqual(dsv.autoType({foo: ""}), {foo: null});
test.end();
});
tape("autoType(object) detects strings", function(test) {
test.deepEqual(dsv.autoType({foo: "yes"}), {foo: "yes"});
test.deepEqual(dsv.autoType({foo: "no"}), {foo: "no"});
test.deepEqual(dsv.autoType({foo: "01/01/2018"}), {foo: "01/01/2018"});
test.deepEqual(dsv.autoType({foo: "January 1, 2018"}), {foo: "January 1, 2018"});
test.deepEqual(dsv.autoType({foo: "1,431"}), {foo: "1,431"});
test.deepEqual(dsv.autoType({foo: "$1.00"}), {foo: "$1.00"});
test.deepEqual(dsv.autoType({foo: "(1.00)"}), {foo: "(1.00)"});
test.deepEqual(dsv.autoType({foo: "Nan"}), {foo: "Nan"});
test.deepEqual(dsv.autoType({foo: "True"}), {foo: "True"});
test.deepEqual(dsv.autoType({foo: "False"}), {foo: "False"});
test.deepEqual(dsv.autoType({foo: "TRUE"}), {foo: "TRUE"});
test.deepEqual(dsv.autoType({foo: "FALSE"}), {foo: "FALSE"});
test.deepEqual(dsv.autoType({foo: "NAN"}), {foo: "NAN"});
test.deepEqual(dsv.autoType({foo: "nan"}), {foo: "nan"});
test.deepEqual(dsv.autoType({foo: "NA"}), {foo: "NA"});
test.deepEqual(dsv.autoType({foo: "na"}), {foo: "na"});
test.end();
});
tape("autoType(object) ignores leading and trailing whitespace", function(test) {
test.deepEqual(dsv.autoType({foo: " 4.2 "}), {foo: 4.2});
test.deepEqual(dsv.autoType({foo: " -4.2 "}), {foo: -4.2});
test.deepEqual(dsv.autoType({foo: " 1e4 "}), {foo: 10000});
test.deepEqual(dsv.autoType({foo: " 2018-01 "}), {foo: new Date("2018-01-01T00:00:00.000Z")});
test.deepEqual(dsv.autoType({foo: " 2018T00:00Z "}), {foo: new Date("2018-01-01T00:00:00.000Z")});
test.equal(Number.isNaN(dsv.autoType({foo: " NaN "}).foo), true);
test.deepEqual(dsv.autoType({foo: " true "}), {foo: true});
test.deepEqual(dsv.autoType({foo: " "}), {foo: null});
test.end();
});
tape("autoType(array) mutates in-place", function(test) {
var array = ["4.2"];
test.strictEqual(dsv.autoType(array), array);
test.deepEqual(array, [4.2]);
test.end();
});
tape("autoType(array) can take an array", function(test) {
test.deepEqual(dsv.autoType(["4.2", " 2018-01 "]), [4.2, new Date("2018-01-01T00:00:00.000Z")]);
test.end();
});
d3-dsv-1.1.1/test/csv-test.js 0000664 0000000 0000000 00000037306 13427152270 0015713 0 ustar 00root root 0000000 0000000 var tape = require("tape"),
dsv = require("../"),
fs = require("fs"),
table = require("./table"),
spectrum = require("csv-spectrum");
tape("csvParse(string) returns the expected objects", function(test) {
test.deepEqual(dsv.csvParse("a,b,c\n1,2,3\n"), table([{a: "1", b: "2", c: "3"}], ["a", "b", "c"]));
test.deepEqual(dsv.csvParse(fs.readFileSync("test/data/sample.csv", "utf-8")), table([{Hello: "42", World: "\"fish\""}], ["Hello", "World"]));
test.end();
});
tape("csvParse(string) does not strip whitespace", function(test) {
test.deepEqual(dsv.csvParse("a,b,c\n 1, 2 ,3 "), table([{a: " 1", b: " 2 ", c: "3 "}], ["a", "b", "c"]));
test.end();
});
tape("csvParse(string) treats empty fields as the empty string", function(test) {
test.deepEqual(dsv.csvParse("a,b,c\n1,,3"), table([{a: "1", b: "", c: "3"}], ["a", "b", "c"]));
test.end();
});
tape("csvParse(string) treats a trailing empty field as the empty string", function(test) {
test.deepEqual(dsv.csvParse("a,b,c\n1,2,\n1,2,\n"), table([{a: "1", b: "2", c: ""}, {a: "1", b: "2", c: ""}], ["a", "b", "c"]));
test.end();
});
tape("csvParse(string) treats a trailing empty field on the last line as the empty string", function(test) {
test.deepEqual(dsv.csvParse("a,b,c\n1,2,\n1,2,"), table([{a: "1", b: "2", c: ""}, {a: "1", b: "2", c: ""}], ["a", "b", "c"]));
test.end();
});
tape("csvParse(string) treats quoted empty strings as the empty string", function(test) {
test.deepEqual(dsv.csvParse("a,b,c\n1,\"\",3"), table([{a: "1", b: "", c: "3"}], ["a", "b", "c"]));
test.end();
});
tape("csvParse(string) allows the last field to have unterminated quotes", function(test) {
test.deepEqual(dsv.csvParse("a,b,c\n1,2,\"3"), table([{a: "1", b: "2", c: "3"}], ["a", "b", "c"]));
test.deepEqual(dsv.csvParse("a,b,c\n1,2,\""), table([{a: "1", b: "2", c: ""}], ["a", "b", "c"]));
test.end();
});
tape("csvParse(string) ignores a blank last line", function(test) {
test.deepEqual(dsv.csvParse("a,b,c\n1,2,3\n"), table([{a: "1", b: "2", c: "3"}], ["a", "b", "c"]));
test.end();
});
tape("csvParse(string) treats a blank non-last line as a single-column empty string", function(test) {
test.deepEqual(dsv.csvParse("a,b,c\n1,2,3\n\n"), table([{a: "1", b: "2", c: "3"}, {a: "", b: undefined, c: undefined}], ["a", "b", "c"]));
test.end();
});
tape("csvParse(string) returns undefined values for missing columns", function(test) {
test.deepEqual(dsv.csvParse("a,b,c\n1\n1,2"), table([{a: "1", b: undefined, c: undefined}, {a: "1", b: "2", c: undefined}], ["a", "b", "c"]));
test.end();
});
tape("csvParse(string) does not ignore a whitespace-only last line", function(test) {
test.deepEqual(dsv.csvParse("a,b,c\n1,2,3\n "), table([{a: "1", b: "2", c: "3"}, {a: " ", b: undefined, c: undefined}], ["a", "b", "c"]));
test.end();
});
tape("csvParse(string) parses quoted values", function(test) {
test.deepEqual(dsv.csvParse("a,b,c\n\"1\",2,3"), table([{a: "1", b: "2", c: "3"}], ["a", "b", "c"]));
test.deepEqual(dsv.csvParse("a,b,c\n\"1\",2,3\n"), table([{a: "1", b: "2", c: "3"}], ["a", "b", "c"]));
test.end();
});
tape("csvParse(string) parses quoted values with quotes", function(test) {
test.deepEqual(dsv.csvParse("a\n\"\"\"hello\"\"\""), table([{a: "\"hello\""}], ["a"]));
test.end();
});
tape("csvParse(string) parses quoted values with newlines", function(test) {
test.deepEqual(dsv.csvParse("a\n\"new\nline\""), table([{a: "new\nline"}], ["a"]));
test.deepEqual(dsv.csvParse("a\n\"new\rline\""), table([{a: "new\rline"}], ["a"]));
test.deepEqual(dsv.csvParse("a\n\"new\r\nline\""), table([{a: "new\r\nline"}], ["a"]));
test.end();
});
tape("csvParse(string) observes Unix, Mac and DOS newlines", function(test) {
test.deepEqual(dsv.csvParse("a,b,c\n1,2,3\n4,5,\"6\"\n7,8,9"), table([{a: "1", b: "2", c: "3"}, {a: "4", b: "5", c: "6"}, {a: "7", b: "8", c: "9"}], ["a", "b", "c"]));
test.deepEqual(dsv.csvParse("a,b,c\r1,2,3\r4,5,\"6\"\r7,8,9"), table([{a: "1", b: "2", c: "3"}, {a: "4", b: "5", c: "6"}, {a: "7", b: "8", c: "9"}], ["a", "b", "c"]));
test.deepEqual(dsv.csvParse("a,b,c\r\n1,2,3\r\n4,5,\"6\"\r\n7,8,9"), table([{a: "1", b: "2", c: "3"}, {a: "4", b: "5", c: "6"}, {a: "7", b: "8", c: "9"}], ["a", "b", "c"]));
test.end();
});
tape("csvParse(string) returns columns in the input order", function(test) {
test.deepEqual(dsv.csvParse("a,b,c\n").columns, ["a", "b", "c"]);
test.deepEqual(dsv.csvParse("a,c,b\n").columns, ["a", "c", "b"]);
test.deepEqual(dsv.csvParse("a,0,1\n").columns, ["a", "0", "1"]);
test.deepEqual(dsv.csvParse("1,0,a\n").columns, ["1", "0", "a"]);
test.end();
});
tape("csvParse(string) passes the csv-spectrum test suite", function(test) {
spectrum(function(error, samples) {
samples.forEach(function(sample) {
var actual = dsv.csvParse(sample.csv.toString()),
expected = JSON.parse(sample.json.toString());
delete actual.columns;
test.deepEqual(actual, expected);
});
test.end();
});
});
tape("csvParse(string, row) returns the expected converted objects", function(test) {
function row(d) { d.Hello = -d.Hello; return d; }
test.deepEqual(dsv.csvParse(fs.readFileSync("test/data/sample.csv", "utf-8"), row), table([{Hello: -42, World: "\"fish\""}], ["Hello", "World"]));
test.deepEqual(dsv.csvParse("a,b,c\n1,2,3\n", function(d) { return d; }), table([{a: "1", b: "2", c: "3"}], ["a", "b", "c"]));
test.end();
});
tape("csvParse(string, row) skips rows if row returns null or undefined", function(test) {
function row(d, i) { return [d, null, undefined, false][i]; }
test.deepEqual(dsv.csvParse("field\n42\n\n\n\n", row), table([{field: "42"}, false], ["field"]));
test.deepEqual(dsv.csvParse("a,b,c\n1,2,3\n2,3,4", function(d) { return d.a & 1 ? null : d; }), table([{a: "2", b: "3", c: "4"}], ["a", "b", "c"]));
test.deepEqual(dsv.csvParse("a,b,c\n1,2,3\n2,3,4", function(d) { return d.a & 1 ? undefined : d; }), table([{a: "2", b: "3", c: "4"}], ["a", "b", "c"]));
test.end();
});
tape("csvParse(string, row) calls row(d, i) for each row d, in order", function(test) {
var rows = [];
dsv.csvParse("a\n1\n2\n3\n4", function(d, i) { rows.push({d: d, i: i}); });
test.deepEqual(rows, [{d: {a: "1"}, i: 0}, {d: {a: "2"}, i: 1}, {d: {a: "3"}, i: 2}, {d: {a: "4"}, i: 3}]);
test.end();
});
tape("csvParseRows(string) returns the expected array of array of string", function(test) {
test.deepEqual(dsv.csvParseRows("a,b,c"), [["a", "b", "c"]]);
test.deepEqual(dsv.csvParseRows("a,b,c\n1,2,3"), [["a", "b", "c"], ["1", "2", "3"]]);
test.end();
});
tape("csvParseRows(string) does not strip whitespace", function(test) {
test.deepEqual(dsv.csvParseRows(" 1, 2 ,3 "), [[" 1", " 2 ", "3 "]]);
test.end();
});
tape("csvParseRows(string) treats empty fields as the empty string", function(test) {
test.deepEqual(dsv.csvParseRows("1,,3"), [["1", "", "3"]]);
test.end();
});
tape("csvParseRows(string) treats a trailing empty field as the empty string", function(test) {
test.deepEqual(dsv.csvParseRows("1,2,\n1,2,3"), [["1", "2", ""], ["1", "2", "3"]]);
test.end();
});
tape("csvParseRows(string) treats a trailing empty field on the last line as the empty string", function(test) {
test.deepEqual(dsv.csvParseRows("1,2,\n"), [["1", "2", ""]]);
test.deepEqual(dsv.csvParseRows("1,2,"), [["1", "2", ""]]);
test.end();
});
tape("csvParseRows(string) treats quoted empty strings as the empty string", function(test) {
test.deepEqual(dsv.csvParseRows("\"\",2,3"), [["", "2", "3"]]);
test.deepEqual(dsv.csvParseRows("1,\"\",3"), [["1", "", "3"]]);
test.deepEqual(dsv.csvParseRows("1,2,\"\""), [["1", "2", ""]]);
test.end();
});
tape("csvParseRows(string) allows the last field to have unterminated quotes", function(test) {
test.deepEqual(dsv.csvParseRows("1,2,\"3"), [["1", "2", "3"]]);
test.deepEqual(dsv.csvParseRows("1,2,\""), [["1", "2", ""]]);
test.end();
});
tape("csvParseRows(string) ignores a blank last line", function(test) {
test.deepEqual(dsv.csvParseRows("1,2,3\n"), [["1", "2", "3"]]);
test.end();
});
tape("csvParseRows(string) treats a blank non-last line as a single-column empty string", function(test) {
test.deepEqual(dsv.csvParseRows("1,2,3\n\n"), [["1", "2", "3"], [""]]);
test.deepEqual(dsv.csvParseRows("1,2,3\n\"\"\n"), [["1", "2", "3"], [""]]);
test.end();
});
tape("csvParseRows(string) can return rows of varying length", function(test) {
test.deepEqual(dsv.csvParseRows("1\n1,2\n1,2,3"), [["1"], ["1", "2"], ["1", "2", "3"]]);
test.end();
});
tape("csvParseRows(string) does not ignore a whitespace-only last line", function(test) {
test.deepEqual(dsv.csvParseRows("1,2,3\n "), [["1", "2", "3"], [" "]]);
test.end();
});
tape("csvParseRows(string) parses quoted values", function(test) {
test.deepEqual(dsv.csvParseRows("\"1\",2,3\n"), [["1", "2", "3"]]);
test.deepEqual(dsv.csvParseRows("\"hello\""), [["hello"]]);
test.end();
});
tape("csvParseRows(string) parses quoted values with quotes", function(test) {
test.deepEqual(dsv.csvParseRows("\"\"\"hello\"\"\""), [["\"hello\""]]);
test.end();
});
tape("csvParseRows(string) parses quoted values with newlines", function(test) {
test.deepEqual(dsv.csvParseRows("\"new\nline\""), [["new\nline"]]);
test.deepEqual(dsv.csvParseRows("\"new\rline\""), [["new\rline"]]);
test.deepEqual(dsv.csvParseRows("\"new\r\nline\""), [["new\r\nline"]]);
test.end();
});
tape("csvParseRows(string) parses Unix, Mac and DOS newlines", function(test) {
test.deepEqual(dsv.csvParseRows("a,b,c\n1,2,3\n4,5,\"6\"\n7,8,9"), [["a", "b", "c"], ["1", "2", "3"], ["4", "5", "6"], ["7", "8", "9"]]);
test.deepEqual(dsv.csvParseRows("a,b,c\r1,2,3\r4,5,\"6\"\r7,8,9"), [["a", "b", "c"], ["1", "2", "3"], ["4", "5", "6"], ["7", "8", "9"]]);
test.deepEqual(dsv.csvParseRows("a,b,c\r\n1,2,3\r\n4,5,\"6\"\r\n7,8,9"), [["a", "b", "c"], ["1", "2", "3"], ["4", "5", "6"], ["7", "8", "9"]]);
test.end();
});
tape("csvParseRows(\"\") returns the empty array", function(test) {
test.deepEqual(dsv.csvParseRows(""), []);
test.end();
});
tape("csvParseRows(\"\n\") returns an array of one empty string", function(test) {
test.deepEqual(dsv.csvParseRows("\n"), [[""]]);
test.deepEqual(dsv.csvParseRows("\r"), [[""]]);
test.deepEqual(dsv.csvParseRows("\r\n"), [[""]]);
test.end();
});
tape("csvParseRows(\"\n\n\") returns an array of two empty strings", function(test) {
test.deepEqual(dsv.csvParseRows("\n\n"), [[""], [""]]);
test.end();
});
tape("csvParseRows(string, row) returns the expected converted array of array of string", function(test) {
function row(d, i) { if (i) d[0] = -d[0]; return d; }
test.deepEqual(dsv.csvParseRows(fs.readFileSync("test/data/sample.csv", "utf-8"), row), [["Hello", "World"], [-42, "\"fish\""]]);
test.deepEqual(dsv.csvParseRows("a,b,c\n1,2,3\n", function(d) { return d; }), [["a", "b", "c"], ["1", "2", "3"]]);
test.end();
});
tape("csvParseRows(string, row) skips rows if row returns null or undefined", function(test) {
function row(d, i) { return [d, null, undefined, false][i]; }
test.deepEqual(dsv.csvParseRows("field\n42\n\n\n", row), [["field"], false]);
test.deepEqual(dsv.csvParseRows("a,b,c\n1,2,3\n2,3,4", function(d, i) { return i & 1 ? null : d; }), [["a", "b", "c"], ["2", "3", "4"]]);
test.deepEqual(dsv.csvParseRows("a,b,c\n1,2,3\n2,3,4", function(d, i) { return i & 1 ? undefined : d; }), [["a", "b", "c"], ["2", "3", "4"]]);
test.end();
});
tape("csvParseRows(string, row) invokes row(d, i) for each row d, in order", function(test) {
var rows = [];
dsv.csvParseRows("a\n1\n2\n3\n4", function(d, i) { rows.push({d: d, i: i}); });
test.deepEqual(rows, [{d: ["a"], i: 0}, {d: ["1"], i: 1}, {d: ["2"], i: 2}, {d: ["3"], i: 3}, {d: ["4"], i: 4}]);
test.end();
});
tape("csvFormat(array) takes an array of objects as input", function(test) {
test.deepEqual(dsv.csvFormat([{a: 1, b: 2, c: 3}]), "a,b,c\n1,2,3");
test.end();
});
tape("csvFormat(array) converts dates to ISO 8601", function(test) {
test.deepEqual(dsv.csvFormat([{date: new Date(Date.UTC(2018, 0, 1))}]), "date\n2018-01-01");
test.deepEqual(dsv.csvFormat([{date: new Date(2018, 0, 1)}]), "date\n2018-01-01T08:00Z");
test.end();
});
tape("csvFormat(array) escapes field names and values containing delimiters", function(test) {
test.deepEqual(dsv.csvFormat([{"foo,bar": true}]), "\"foo,bar\"\ntrue");
test.deepEqual(dsv.csvFormat([{field: "foo,bar"}]), "field\n\"foo,bar\"");
test.end();
});
tape("csvFormat(array) computes the union of all fields", function(test) {
test.deepEqual(dsv.csvFormat([{a: 1}, {a: 1, b: 2}, {a: 1, b: 2, c: 3}, {b: 1, c: 2}, {c: 1}]), "a,b,c\n1,,\n1,2,\n1,2,3\n,1,2\n,,1");
test.end();
});
tape("csvFormat(array) orders fields by first-seen", function(test) {
test.deepEqual(dsv.csvFormat([{a: 1, b: 2}, {c: 3, b: 4}, {c: 5, a: 1, b: 2}]), "a,b,c\n1,2,\n,4,3\n1,2,5");
test.end();
});
tape("csvFormat(array, columns) observes the specified array of column names", function(test) {
test.deepEqual(dsv.csvFormat([{a: 1, b: 2, c: 3}], ["c", "b", "a"]), "c,b,a\n3,2,1");
test.deepEqual(dsv.csvFormat([{a: 1, b: 2, c: 3}], ["c", "a"]), "c,a\n3,1");
test.deepEqual(dsv.csvFormat([{a: 1, b: 2, c: 3}], []), "\n");
test.deepEqual(dsv.csvFormat([{a: 1, b: 2, c: 3}], ["d"]), "d\n");
test.end();
});
tape("csvFormat(array, columns) coerces column names to strings", function(test) {
test.deepEqual(dsv.csvFormat([{a: 1, b: 2, "\"fish\"": 3}], [{toString: function() { return "\"fish\""; }}]), "\"\"\"fish\"\"\"\n3");
test.deepEqual(dsv.csvFormat([{a: 1, b: 2, c: 3}], ["a", null, "b", undefined, "c"]), "a,,b,,c\n1,,2,,3");
test.end();
});
tape("csvFormat(array, columns) coerces field values to strings", function(test) {
test.deepEqual(dsv.csvFormat([{a: {toString: function() { return "\"fish\""; }}}]), "a\n\"\"\"fish\"\"\"");
test.deepEqual(dsv.csvFormat([{a: null, b: undefined, c: 3}]), "a,b,c\n,,3");
test.end();
});
tape("csvFormatBody(array) omits the header row", function(test) {
test.deepEqual(dsv.csvFormatBody([{a: 1, b: 2}, {c: 3, b: 4}, {c: 5, a: 1, b: 2}]), "1,2,\n,4,3\n1,2,5");
test.end();
});
tape("csvFormatBody(array, columns) omits the header row", function(test) {
test.deepEqual(dsv.csvFormatBody([{a: 1, b: 2}, {c: 3, b: 4}, {c: 5, a: 1, b: 2}], ["a", "b"]), "1,2\n,4\n1,2");
test.end();
});
tape("csvFormatRows(array) takes an array of array of string as input", function(test) {
test.deepEqual(dsv.csvFormatRows([["a", "b", "c"], ["1", "2", "3"]]), "a,b,c\n1,2,3");
test.end();
});
tape("csvFormatRows(array) separates lines using Unix newline", function(test) {
test.deepEqual(dsv.csvFormatRows([[], []]), "\n");
test.end();
});
tape("csvFormatRows(array) converts dates to ISO 8601", function(test) {
test.deepEqual(dsv.csvFormatRows([[new Date(Date.UTC(2018, 0, 1))]]), "2018-01-01");
test.deepEqual(dsv.csvFormatRows([[new Date(2018, 0, 1)]]), "2018-01-01T08:00Z");
test.end();
});
tape("csvFormatRows(array) does not strip whitespace", function(test) {
test.deepEqual(dsv.csvFormatRows([["a ", " b", "c"], ["1", "2", "3 "]]), "a , b,c\n1,2,3 ");
test.end();
});
tape("csvFormatRows(array) does not quote simple values", function(test) {
test.deepEqual(dsv.csvFormatRows([["a"], [1]]), "a\n1");
test.end();
});
tape("csvFormatRows(array) escapes double quotes", function(test) {
test.deepEqual(dsv.csvFormatRows([["\"fish\""]]), "\"\"\"fish\"\"\"");
test.end();
});
tape("csvFormatRows(array) escapes Unix newlines", function(test) {
test.deepEqual(dsv.csvFormatRows([["new\nline"]]), "\"new\nline\"");
test.end();
});
tape("csvFormatRows(array) escapes Windows newlines", function(test) {
test.deepEqual(dsv.csvFormatRows([["new\rline"]]), "\"new\rline\"");
test.end();
});
tape("csvFormatRows(array) escapes values containing delimiters", function(test) {
test.deepEqual(dsv.csvFormatRows([["oxford,comma"]]), "\"oxford,comma\"");
test.end();
});
d3-dsv-1.1.1/test/data/ 0000775 0000000 0000000 00000000000 13427152270 0014505 5 ustar 00root root 0000000 0000000 d3-dsv-1.1.1/test/data/sample.csv 0000664 0000000 0000000 00000000032 13427152270 0016476 0 ustar 00root root 0000000 0000000 Hello,World
42,"""fish"""
d3-dsv-1.1.1/test/data/sample.psv 0000664 0000000 0000000 00000000032 13427152270 0016513 0 ustar 00root root 0000000 0000000 Hello|World
42|"""fish"""
d3-dsv-1.1.1/test/data/sample.tsv 0000664 0000000 0000000 00000000032 13427152270 0016517 0 ustar 00root root 0000000 0000000 Hello World
42 """fish"""
d3-dsv-1.1.1/test/data/sample2.csv 0000664 0000000 0000000 00000000042 13427152270 0016561 0 ustar 00root root 0000000 0000000 Hello,World
42,"""fish"""
foo,bar
d3-dsv-1.1.1/test/data/sample2.tsv 0000664 0000000 0000000 00000000042 13427152270 0016602 0 ustar 00root root 0000000 0000000 Hello World
42 """fish"""
foo bar
d3-dsv-1.1.1/test/dsv-test.js 0000664 0000000 0000000 00000021406 13427152270 0015706 0 ustar 00root root 0000000 0000000 var tape = require("tape"),
dsv = require("../"),
fs = require("fs"),
table = require("./table");
var psv = dsv.dsvFormat("|");
tape("dsv(\"|\").parse(string) returns the expected objects", function(test) {
test.deepEqual(psv.parse("a|b|c\n1|2|3\n"), table([{a: "1", b: "2", c: "3"}], ["a", "b", "c"]));
test.deepEqual(psv.parse(fs.readFileSync("test/data/sample.psv", "utf-8")), table([{Hello: "42", World: "\"fish\""}], ["Hello", "World"]));
test.end();
});
tape("dsv(\"|\").parse(string) does not strip whitespace", function(test) {
test.deepEqual(psv.parse("a|b|c\n 1| 2|3\n"), table([{a: " 1", b: " 2", c: "3"}], ["a", "b", "c"]));
test.end();
});
tape("dsv(\"|\").parse(string) parses quoted values", function(test) {
test.deepEqual(psv.parse("a|b|c\n\"1\"|2|3"), table([{a: "1", b: "2", c: "3"}], ["a", "b", "c"]));
test.deepEqual(psv.parse("a|b|c\n\"1\"|2|3\n"), table([{a: "1", b: "2", c: "3"}], ["a", "b", "c"]));
test.end();
});
tape("dsv(\"|\").parse(string) parses quoted values with quotes", function(test) {
test.deepEqual(psv.parse("a\n\"\"\"hello\"\"\""), table([{a: "\"hello\""}], ["a"]));
test.end();
});
tape("dsv(\"|\").parse(string) parses quoted values with newlines", function(test) {
test.deepEqual(psv.parse("a\n\"new\nline\""), table([{a: "new\nline"}], ["a"]));
test.deepEqual(psv.parse("a\n\"new\rline\""), table([{a: "new\rline"}], ["a"]));
test.deepEqual(psv.parse("a\n\"new\r\nline\""), table([{a: "new\r\nline"}], ["a"]));
test.end();
});
tape("dsv(\"|\").parse(string) observes Unix, Mac and DOS newlines", function(test) {
test.deepEqual(psv.parse("a|b|c\n1|2|3\n4|5|\"6\"\n7|8|9"), table([{a: "1", b: "2", c: "3"}, {a: "4", b: "5", c: "6"}, {a: "7", b: "8", c: "9"}], ["a", "b", "c"]));
test.deepEqual(psv.parse("a|b|c\r1|2|3\r4|5|\"6\"\r7|8|9"), table([{a: "1", b: "2", c: "3"}, {a: "4", b: "5", c: "6"}, {a: "7", b: "8", c: "9"}], ["a", "b", "c"]));
test.deepEqual(psv.parse("a|b|c\r\n1|2|3\r\n4|5|\"6\"\r\n7|8|9"), table([{a: "1", b: "2", c: "3"}, {a: "4", b: "5", c: "6"}, {a: "7", b: "8", c: "9"}], ["a", "b", "c"]));
test.end();
});
tape("dsv(\"|\").parse(string, row) returns the expected converted objects", function(test) {
function row(d) { d.Hello = -d.Hello; return d; }
test.deepEqual(psv.parse(fs.readFileSync("test/data/sample.psv", "utf-8"), row), table([{Hello: -42, World: "\"fish\""}], ["Hello", "World"]));
test.deepEqual(psv.parse("a|b|c\n1|2|3\n", function(d) { return d; }), table([{a: "1", b: "2", c: "3"}], ["a", "b", "c"]));
test.end();
});
tape("dsv(\"|\").parse(string, row) skips rows if row returns null or undefined", function(test) {
function row(d, i) { return [d, null, undefined, false][i]; }
test.deepEqual(psv.parse("field\n42\n\n\n\n", row), table([{field: "42"}, false], ["field"]));
test.deepEqual(psv.parse("a|b|c\n1|2|3\n2|3|4", function(d) { return d.a & 1 ? null : d; }), table([{a: "2", b: "3", c: "4"}], ["a", "b", "c"]));
test.deepEqual(psv.parse("a|b|c\n1|2|3\n2|3|4", function(d) { return d.a & 1 ? undefined : d; }), table([{a: "2", b: "3", c: "4"}], ["a", "b", "c"]));
test.end();
});
tape("dsv(\"|\").parse(string, row) invokes row(d, i, columns) for each row d, in order", function(test) {
var rows = [];
psv.parse("a\n1\n2\n3\n4", function(d, i, columns) { rows.push({d: d, i: i, columns: columns}); });
test.deepEqual(rows, [{d: {a: "1"}, i: 0, columns: ["a"]}, {d: {a: "2"}, i: 1, columns: ["a"]}, {d: {a: "3"}, i: 2, columns: ["a"]}, {d: {a: "4"}, i: 3, columns: ["a"]}]);
test.end();
});
tape("dsv(\"|\").parseRows(string) returns the expected array of array of string", function(test) {
test.deepEqual(psv.parseRows("a|b|c\n"), [["a", "b", "c"]]);
test.end();
});
tape("dsv(\"|\").parseRows(string) parses quoted values", function(test) {
test.deepEqual(psv.parseRows("\"1\"|2|3\n"), [["1", "2", "3"]]);
test.deepEqual(psv.parseRows("\"hello\""), [["hello"]]);
test.end();
});
tape("dsv(\"|\").parseRows(string) parses quoted values with quotes", function(test) {
test.deepEqual(psv.parseRows("\"\"\"hello\"\"\""), [["\"hello\""]]);
test.end();
});
tape("dsv(\"|\").parseRows(string) parses quoted values with newlines", function(test) {
test.deepEqual(psv.parseRows("\"new\nline\""), [["new\nline"]]);
test.deepEqual(psv.parseRows("\"new\rline\""), [["new\rline"]]);
test.deepEqual(psv.parseRows("\"new\r\nline\""), [["new\r\nline"]]);
test.end();
});
tape("dsv(\"|\").parseRows(string) parses Unix, Mac and DOS newlines", function(test) {
test.deepEqual(psv.parseRows("a|b|c\n1|2|3\n4|5|\"6\"\n7|8|9"), [["a", "b", "c"], ["1", "2", "3"], ["4", "5", "6"], ["7", "8", "9"]]);
test.deepEqual(psv.parseRows("a|b|c\r1|2|3\r4|5|\"6\"\r7|8|9"), [["a", "b", "c"], ["1", "2", "3"], ["4", "5", "6"], ["7", "8", "9"]]);
test.deepEqual(psv.parseRows("a|b|c\r\n1|2|3\r\n4|5|\"6\"\r\n7|8|9"), [["a", "b", "c"], ["1", "2", "3"], ["4", "5", "6"], ["7", "8", "9"]]);
test.end();
});
tape("dsv(\"|\").parseRows(string, row) returns the expected converted array of array of string", function(test) {
function row(d, i) { if (i) d[0] = -d[0]; return d; }
test.deepEqual(psv.parseRows(fs.readFileSync("test/data/sample.psv", "utf-8"), row), [["Hello", "World"], [-42, "\"fish\""]]);
test.deepEqual(psv.parseRows("a|b|c\n1|2|3\n", function(d) { return d; }), [["a", "b", "c"], ["1", "2", "3"]]);
test.end();
});
tape("dsv(\"|\").parseRows(string, row) skips rows if row returns null or undefined", function(test) {
function row(d, i) { return [d, null, undefined, false][i]; }
test.deepEqual(psv.parseRows("field\n42\n\n\n", row), [["field"], false]);
test.deepEqual(psv.parseRows("a|b|c\n1|2|3\n2|3|4", function(d, i) { return i & 1 ? null : d; }), [["a", "b", "c"], ["2", "3", "4"]]);
test.deepEqual(psv.parseRows("a|b|c\n1|2|3\n2|3|4", function(d, i) { return i & 1 ? undefined : d; }), [["a", "b", "c"], ["2", "3", "4"]]);
test.end();
});
tape("dsv(\"|\").parseRows(string, row) invokes row(d, i) for each row d, in order", function(test) {
var rows = [];
psv.parseRows("a\n1\n2\n3\n4", function(d, i) { rows.push({d: d, i: i}); });
test.deepEqual(rows, [{d: ["a"], i: 0}, {d: ["1"], i: 1}, {d: ["2"], i: 2}, {d: ["3"], i: 3}, {d: ["4"], i: 4}]);
test.end();
});
tape("dsv(\"|\").format(array) takes an array of objects as input", function(test) {
test.deepEqual(psv.format([{a: 1, b: 2, c: 3}]), "a|b|c\n1|2|3");
test.end();
});
tape("dsv(\"|\").format(array) escapes field names and values containing delimiters", function(test) {
test.deepEqual(psv.format([{"foo|bar": true}]), "\"foo|bar\"\ntrue");
test.deepEqual(psv.format([{field: "foo|bar"}]), "field\n\"foo|bar\"");
test.end();
});
tape("dsv(\"|\").format(array) computes the union of all fields", function(test) {
test.deepEqual(psv.format([{a: 1}, {a: 1, b: 2}, {a: 1, b: 2, c: 3}, {b: 1, c: 2}, {c: 1}]), "a|b|c\n1||\n1|2|\n1|2|3\n|1|2\n||1");
test.end();
});
tape("dsv(\"|\").format(array) orders fields by first-seen", function(test) {
test.deepEqual(psv.format([{a: 1, b: 2}, {c: 3, b: 4}, {c: 5, a: 1, b: 2}]), "a|b|c\n1|2|\n|4|3\n1|2|5");
test.end();
});
tape("dsv(\"|\").format(array, columns) observes the specified array of column names", function(test) {
test.deepEqual(psv.format([{a: 1, b: 2, c: 3}], ["c", "b", "a"]), "c|b|a\n3|2|1");
test.deepEqual(psv.format([{a: 1, b: 2, c: 3}], ["c", "a"]), "c|a\n3|1");
test.deepEqual(psv.format([{a: 1, b: 2, c: 3}], []), "\n");
test.deepEqual(psv.format([{a: 1, b: 2, c: 3}], ["d"]), "d\n");
test.end();
});
tape("dsv(\"|\").formatRows(array) takes an array of array of string as input", function(test) {
test.deepEqual(psv.formatRows([["a", "b", "c"], ["1", "2", "3"]]), "a|b|c\n1|2|3");
test.end();
});
tape("dsv(\"|\").formatRows(array) separates lines using Unix newline", function(test) {
test.deepEqual(psv.formatRows([[], []]), "\n");
test.end();
});
tape("dsv(\"|\").formatRows(array) does not strip whitespace", function(test) {
test.deepEqual(psv.formatRows([["a ", " b", "c"], ["1", "2", "3 "]]), "a | b|c\n1|2|3 ");
test.end();
});
tape("dsv(\"|\").formatRows(array) does not quote simple values", function(test) {
test.deepEqual(psv.formatRows([["a"], [1]]), "a\n1");
test.end();
});
tape("dsv(\"|\").formatRows(array) escapes double quotes", function(test) {
test.deepEqual(psv.formatRows([["\"fish\""]]), "\"\"\"fish\"\"\"");
test.end();
});
tape("dsv(\"|\").formatRows(array) escapes Unix newlines", function(test) {
test.deepEqual(psv.formatRows([["new\nline"]]), "\"new\nline\"");
test.end();
});
tape("dsv(\"|\").formatRows(array) escapes Windows newlines", function(test) {
test.deepEqual(psv.formatRows([["new\rline"]]), "\"new\rline\"");
test.end();
});
tape("dsv(\"|\").formatRows(array) escapes values containing delimiters", function(test) {
test.deepEqual(psv.formatRows([["oxford|tab"]]), "\"oxford|tab\"");
test.end();
});
d3-dsv-1.1.1/test/table.js 0000664 0000000 0000000 00000000127 13427152270 0015221 0 ustar 00root root 0000000 0000000 module.exports = function(rows, columns) {
rows.columns = columns;
return rows;
};
d3-dsv-1.1.1/test/tsv-test.js 0000664 0000000 0000000 00000021274 13427152270 0015731 0 ustar 00root root 0000000 0000000 var tape = require("tape"),
dsv = require("../"),
fs = require("fs"),
table = require("./table");
tape("tsvParse(string) returns the expected objects", function(test) {
test.deepEqual(dsv.tsvParse("a\tb\tc\n1\t2\t3\n"), table([{a: "1", b: "2", c: "3"}], ["a", "b", "c"]));
test.deepEqual(dsv.tsvParse(fs.readFileSync("test/data/sample.tsv", "utf-8")), table([{Hello: "42", World: "\"fish\""}], ["Hello", "World"]));
test.end();
});
tape("tsvParse(string) does not strip whitespace", function(test) {
test.deepEqual(dsv.tsvParse("a\tb\tc\n 1\t 2\t3\n"), table([{a: " 1", b: " 2", c: "3"}], ["a", "b", "c"]));
test.end();
});
tape("tsvParse(string) parses quoted values", function(test) {
test.deepEqual(dsv.tsvParse("a\tb\tc\n\"1\"\t2\t3"), table([{a: "1", b: "2", c: "3"}], ["a", "b", "c"]));
test.deepEqual(dsv.tsvParse("a\tb\tc\n\"1\"\t2\t3\n"), table([{a: "1", b: "2", c: "3"}], ["a", "b", "c"]));
test.end();
});
tape("tsvParse(string) parses quoted values with quotes", function(test) {
test.deepEqual(dsv.tsvParse("a\n\"\"\"hello\"\"\""), table([{a: "\"hello\""}], ["a"]));
test.end();
});
tape("tsvParse(string) parses quoted values with newlines", function(test) {
test.deepEqual(dsv.tsvParse("a\n\"new\nline\""), table([{a: "new\nline"}], ["a"]));
test.deepEqual(dsv.tsvParse("a\n\"new\rline\""), table([{a: "new\rline"}], ["a"]));
test.deepEqual(dsv.tsvParse("a\n\"new\r\nline\""), table([{a: "new\r\nline"}], ["a"]));
test.end();
});
tape("tsvParse(string) observes Unix, Mac and DOS newlines", function(test) {
test.deepEqual(dsv.tsvParse("a\tb\tc\n1\t2\t3\n4\t5\t\"6\"\n7\t8\t9"), table([{a: "1", b: "2", c: "3"}, {a: "4", b: "5", c: "6"}, {a: "7", b: "8", c: "9"}], ["a", "b", "c"]));
test.deepEqual(dsv.tsvParse("a\tb\tc\r1\t2\t3\r4\t5\t\"6\"\r7\t8\t9"), table([{a: "1", b: "2", c: "3"}, {a: "4", b: "5", c: "6"}, {a: "7", b: "8", c: "9"}], ["a", "b", "c"]));
test.deepEqual(dsv.tsvParse("a\tb\tc\r\n1\t2\t3\r\n4\t5\t\"6\"\r\n7\t8\t9"), table([{a: "1", b: "2", c: "3"}, {a: "4", b: "5", c: "6"}, {a: "7", b: "8", c: "9"}], ["a", "b", "c"]));
test.end();
});
tape("tsvParse(string, row) returns the expected converted objects", function(test) {
function row(d) { d.Hello = -d.Hello; return d; }
test.deepEqual(dsv.tsvParse(fs.readFileSync("test/data/sample.tsv", "utf-8"), row), table([{Hello: -42, World: "\"fish\""}], ["Hello", "World"]));
test.deepEqual(dsv.tsvParse("a\tb\tc\n1\t2\t3\n", function(d) { return d; }), table([{a: "1", b: "2", c: "3"}], ["a", "b", "c"]));
test.end();
});
tape("tsvParse(string, row) skips rows if row returns null or undefined", function(test) {
function row(d, i) { return [d, null, undefined, false][i]; }
test.deepEqual(dsv.tsvParse("field\n42\n\n\n\n", row), table([{field: "42"}, false], ["field"]));
test.deepEqual(dsv.tsvParse("a\tb\tc\n1\t2\t3\n2\t3\t4", function(d) { return d.a & 1 ? null : d; }), table([{a: "2", b: "3", c: "4"}], ["a", "b", "c"]));
test.deepEqual(dsv.tsvParse("a\tb\tc\n1\t2\t3\n2\t3\t4", function(d) { return d.a & 1 ? undefined : d; }), table([{a: "2", b: "3", c: "4"}], ["a", "b", "c"]));
test.end();
});
tape("tsvParse(string, row) invokes row(d, i) for each row d, in order", function(test) {
var rows = [];
dsv.tsvParse("a\n1\n2\n3\n4", function(d, i) { rows.push({d: d, i: i}); });
test.deepEqual(rows, [{d: {a: "1"}, i: 0}, {d: {a: "2"}, i: 1}, {d: {a: "3"}, i: 2}, {d: {a: "4"}, i: 3}]);
test.end();
});
tape("tsvParseRows(string) returns the expected array of array of string", function(test) {
test.deepEqual(dsv.tsvParseRows("a\tb\tc\n"), [["a", "b", "c"]]);
test.end();
});
tape("tsvParseRows(string) parses quoted values", function(test) {
test.deepEqual(dsv.tsvParseRows("\"1\"\t2\t3\n"), [["1", "2", "3"]]);
test.deepEqual(dsv.tsvParseRows("\"hello\""), [["hello"]]);
test.end();
});
tape("tsvParseRows(string) parses quoted values with quotes", function(test) {
test.deepEqual(dsv.tsvParseRows("\"\"\"hello\"\"\""), [["\"hello\""]]);
test.end();
});
tape("tsvParseRows(string) parses quoted values with newlines", function(test) {
test.deepEqual(dsv.tsvParseRows("\"new\nline\""), [["new\nline"]]);
test.deepEqual(dsv.tsvParseRows("\"new\rline\""), [["new\rline"]]);
test.deepEqual(dsv.tsvParseRows("\"new\r\nline\""), [["new\r\nline"]]);
test.end();
});
tape("tsvParseRows(string) parses Unix, Mac and DOS newlines", function(test) {
test.deepEqual(dsv.tsvParseRows("a\tb\tc\n1\t2\t3\n4\t5\t\"6\"\n7\t8\t9"), [["a", "b", "c"], ["1", "2", "3"], ["4", "5", "6"], ["7", "8", "9"]]);
test.deepEqual(dsv.tsvParseRows("a\tb\tc\r1\t2\t3\r4\t5\t\"6\"\r7\t8\t9"), [["a", "b", "c"], ["1", "2", "3"], ["4", "5", "6"], ["7", "8", "9"]]);
test.deepEqual(dsv.tsvParseRows("a\tb\tc\r\n1\t2\t3\r\n4\t5\t\"6\"\r\n7\t8\t9"), [["a", "b", "c"], ["1", "2", "3"], ["4", "5", "6"], ["7", "8", "9"]]);
test.end();
});
tape("tsvParseRows(string, row) returns the expected converted array of array of string", function(test) {
function row(d, i) { if (i) d[0] = -d[0]; return d; }
test.deepEqual(dsv.tsvParseRows(fs.readFileSync("test/data/sample.tsv", "utf-8"), row), [["Hello", "World"], [-42, "\"fish\""]]);
test.deepEqual(dsv.tsvParseRows("a\tb\tc\n1\t2\t3\n", function(d) { return d; }), [["a", "b", "c"], ["1", "2", "3"]]);
test.end();
});
tape("tsvParseRows(string, row) skips rows if row returns null or undefined", function(test) {
function row(d, i) { return [d, null, undefined, false][i]; }
test.deepEqual(dsv.tsvParseRows("field\n42\n\n\n", row), [["field"], false]);
test.deepEqual(dsv.tsvParseRows("a\tb\tc\n1\t2\t3\n2\t3\t4", function(d, i) { return i & 1 ? null : d; }), [["a", "b", "c"], ["2", "3", "4"]]);
test.deepEqual(dsv.tsvParseRows("a\tb\tc\n1\t2\t3\n2\t3\t4", function(d, i) { return i & 1 ? undefined : d; }), [["a", "b", "c"], ["2", "3", "4"]]);
test.end();
});
tape("tsvParseRows(string, row) invokes row(d, i) for each row d, in order", function(test) {
var rows = [];
dsv.tsvParseRows("a\n1\n2\n3\n4", function(d, i) { rows.push({d: d, i: i}); });
test.deepEqual(rows, [{d: ["a"], i: 0}, {d: ["1"], i: 1}, {d: ["2"], i: 2}, {d: ["3"], i: 3}, {d: ["4"], i: 4}]);
test.end();
});
tape("tsvFormat(array) takes an array of objects as input", function(test) {
test.deepEqual(dsv.tsvFormat([{a: 1, b: 2, c: 3}]), "a\tb\tc\n1\t2\t3");
test.end();
});
tape("tsvFormat(array) escapes field names and values containing delimiters", function(test) {
test.deepEqual(dsv.tsvFormat([{"foo\tbar": true}]), "\"foo\tbar\"\ntrue");
test.deepEqual(dsv.tsvFormat([{field: "foo\tbar"}]), "field\n\"foo\tbar\"");
test.end();
});
tape("tsvFormat(array) computes the union of all fields", function(test) {
test.deepEqual(dsv.tsvFormat([{a: 1}, {a: 1, b: 2}, {a: 1, b: 2, c: 3}, {b: 1, c: 2}, {c: 1}]), "a\tb\tc\n1\t\t\n1\t2\t\n1\t2\t3\n\t1\t2\n\t\t1");
test.end();
});
tape("tsvFormat(array) orders fields by first-seen", function(test) {
test.deepEqual(dsv.tsvFormat([{a: 1, b: 2}, {c: 3, b: 4}, {c: 5, a: 1, b: 2}]), "a\tb\tc\n1\t2\t\n\t4\t3\n1\t2\t5");
test.end();
});
tape("tsvFormat(array, columns) observes the specified array of column names", function(test) {
test.deepEqual(dsv.tsvFormat([{a: 1, b: 2, c: 3}], ["c", "b", "a"]), "c\tb\ta\n3\t2\t1");
test.deepEqual(dsv.tsvFormat([{a: 1, b: 2, c: 3}], ["c", "a"]), "c\ta\n3\t1");
test.deepEqual(dsv.tsvFormat([{a: 1, b: 2, c: 3}], []), "\n");
test.deepEqual(dsv.tsvFormat([{a: 1, b: 2, c: 3}], ["d"]), "d\n");
test.end();
});
tape("tsvFormatRows(array) takes an array of array of string as input", function(test) {
test.deepEqual(dsv.tsvFormatRows([["a", "b", "c"], ["1", "2", "3"]]), "a\tb\tc\n1\t2\t3");
test.end();
});
tape("tsvFormatRows(array) separates lines using Unix newline", function(test) {
test.deepEqual(dsv.tsvFormatRows([[], []]), "\n");
test.end();
});
tape("tsvFormatRows(array) does not strip whitespace", function(test) {
test.deepEqual(dsv.tsvFormatRows([["a ", " b", "c"], ["1", "2", "3 "]]), "a \t b\tc\n1\t2\t3 ");
test.end();
});
tape("tsvFormatRows(array) does not quote simple values", function(test) {
test.deepEqual(dsv.tsvFormatRows([["a"], [1]]), "a\n1");
test.end();
});
tape("tsvFormatRows(array) escapes double quotes", function(test) {
test.deepEqual(dsv.tsvFormatRows([["\"fish\""]]), "\"\"\"fish\"\"\"");
test.end();
});
tape("tsvFormatRows(array) escapes Unix newlines", function(test) {
test.deepEqual(dsv.tsvFormatRows([["new\nline"]]), "\"new\nline\"");
test.end();
});
tape("tsvFormatRows(array) escapes Windows newlines", function(test) {
test.deepEqual(dsv.tsvFormatRows([["new\rline"]]), "\"new\rline\"");
test.end();
});
tape("tsvFormatRows(array) escapes values containing delimiters", function(test) {
test.deepEqual(dsv.tsvFormatRows([["oxford\ttab"]]), "\"oxford\ttab\"");
test.end();
});
d3-dsv-1.1.1/yarn.lock 0000664 0000000 0000000 00000077413 13427152270 0014454 0 ustar 00root root 0000000 0000000 # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
"@babel/code-frame@^7.0.0-beta.47":
version "7.0.0-rc.3"
resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.0.0-rc.3.tgz#d77a587401f818a3168700f596e41cd6905947b2"
dependencies:
"@babel/highlight" "7.0.0-rc.3"
"@babel/highlight@7.0.0-rc.3":
version "7.0.0-rc.3"
resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.0.0-rc.3.tgz#c2ee83f8e5c0c387279a8c48e06fef2e32027004"
dependencies:
chalk "^2.0.0"
esutils "^2.0.2"
js-tokens "^4.0.0"
"@types/estree@0.0.39":
version "0.0.39"
resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.39.tgz#e177e699ee1b8c22d23174caaa7422644389509f"
"@types/node@*":
version "10.9.1"
resolved "https://registry.yarnpkg.com/@types/node/-/node-10.9.1.tgz#06f002136fbcf51e730995149050bb3c45ee54e6"
acorn-jsx@^4.1.1:
version "4.1.1"
resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-4.1.1.tgz#e8e41e48ea2fe0c896740610ab6a4ffd8add225e"
dependencies:
acorn "^5.0.3"
acorn@^5.0.3, acorn@^5.6.0:
version "5.7.2"
resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.7.2.tgz#91fa871883485d06708800318404e72bfb26dcc5"
ajv-keywords@^3.0.0:
version "3.2.0"
resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-3.2.0.tgz#e86b819c602cf8821ad637413698f1dec021847a"
ajv@^6.0.1, ajv@^6.5.0:
version "6.5.3"
resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.5.3.tgz#71a569d189ecf4f4f321224fecb166f071dd90f9"
dependencies:
fast-deep-equal "^2.0.1"
fast-json-stable-stringify "^2.0.0"
json-schema-traverse "^0.4.1"
uri-js "^4.2.2"
ansi-escapes@^3.0.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.1.0.tgz#f73207bb81207d75fd6c83f125af26eea378ca30"
ansi-regex@^2.0.0:
version "2.1.1"
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df"
ansi-regex@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998"
ansi-styles@^2.2.1:
version "2.2.1"
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe"
ansi-styles@^3.2.1:
version "3.2.1"
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d"
dependencies:
color-convert "^1.9.0"
argparse@^1.0.7:
version "1.0.10"
resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911"
dependencies:
sprintf-js "~1.0.2"
array-union@^1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/array-union/-/array-union-1.0.2.tgz#9a34410e4f4e3da23dea375be5be70f24778ec39"
dependencies:
array-uniq "^1.0.1"
array-uniq@^1.0.1:
version "1.0.3"
resolved "https://registry.yarnpkg.com/array-uniq/-/array-uniq-1.0.3.tgz#af6ac877a25cc7f74e058894753858dfdb24fdb6"
arrify@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d"
babel-code-frame@^6.26.0:
version "6.26.0"
resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b"
dependencies:
chalk "^1.1.3"
esutils "^2.0.2"
js-tokens "^3.0.2"
balanced-match@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767"
brace-expansion@^1.1.7:
version "1.1.11"
resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd"
dependencies:
balanced-match "^1.0.0"
concat-map "0.0.1"
buffer-from@^1.0.0:
version "1.1.1"
resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef"
caller-path@^0.1.0:
version "0.1.0"
resolved "https://registry.yarnpkg.com/caller-path/-/caller-path-0.1.0.tgz#94085ef63581ecd3daa92444a8fe94e82577751f"
dependencies:
callsites "^0.2.0"
callsites@^0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/callsites/-/callsites-0.2.0.tgz#afab96262910a7f33c19a5775825c69f34e350ca"
chalk@^1.1.3:
version "1.1.3"
resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98"
dependencies:
ansi-styles "^2.2.1"
escape-string-regexp "^1.0.2"
has-ansi "^2.0.0"
strip-ansi "^3.0.0"
supports-color "^2.0.0"
chalk@^2.0.0, chalk@^2.1.0:
version "2.4.1"
resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.1.tgz#18c49ab16a037b6eb0152cc83e3471338215b66e"
dependencies:
ansi-styles "^3.2.1"
escape-string-regexp "^1.0.5"
supports-color "^5.3.0"
chardet@^0.4.0:
version "0.4.2"
resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.4.2.tgz#b5473b33dc97c424e5d98dc87d55d4d8a29c8bf2"
circular-json@^0.3.1:
version "0.3.3"
resolved "https://registry.yarnpkg.com/circular-json/-/circular-json-0.3.3.tgz#815c99ea84f6809529d2f45791bdf82711352d66"
cli-cursor@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-2.1.0.tgz#b35dac376479facc3e94747d41d0d0f5238ffcb5"
dependencies:
restore-cursor "^2.0.0"
cli-width@^2.0.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.2.0.tgz#ff19ede8a9a5e579324147b0c11f0fbcbabed639"
color-convert@^1.9.0:
version "1.9.2"
resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.2.tgz#49881b8fba67df12a96bdf3f56c0aab9e7913147"
dependencies:
color-name "1.1.1"
color-name@1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.1.tgz#4b1415304cf50028ea81643643bd82ea05803689"
commander@2:
version "2.17.1"
resolved "https://registry.yarnpkg.com/commander/-/commander-2.17.1.tgz#bd77ab7de6de94205ceacc72f1716d29f20a77bf"
commander@~2.16.0:
version "2.16.0"
resolved "https://registry.yarnpkg.com/commander/-/commander-2.16.0.tgz#f16390593996ceb4f3eeb020b31d78528f7f8a50"
concat-map@0.0.1:
version "0.0.1"
resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
cross-spawn@^6.0.5:
version "6.0.5"
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4"
dependencies:
nice-try "^1.0.4"
path-key "^2.0.1"
semver "^5.5.0"
shebang-command "^1.2.0"
which "^1.2.9"
csv-spectrum@1:
version "1.0.0"
resolved "https://registry.yarnpkg.com/csv-spectrum/-/csv-spectrum-1.0.0.tgz#591ac9ff48ad4f3eb4338457bc9801b349e3d628"
debug@^3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261"
dependencies:
ms "2.0.0"
deep-equal@~1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-1.0.1.tgz#f5d260292b660e084eff4cdbc9f08ad3247448b5"
deep-is@~0.1.3:
version "0.1.3"
resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34"
define-properties@^1.1.2:
version "1.1.3"
resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.3.tgz#cf88da6cbee26fe6db7094f61d870cbd84cee9f1"
dependencies:
object-keys "^1.0.12"
defined@~1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/defined/-/defined-1.0.0.tgz#c98d9bcef75674188e110969151199e39b1fa693"
del@^2.0.2:
version "2.2.2"
resolved "https://registry.yarnpkg.com/del/-/del-2.2.2.tgz#c12c981d067846c84bcaf862cff930d907ffd1a8"
dependencies:
globby "^5.0.0"
is-path-cwd "^1.0.0"
is-path-in-cwd "^1.0.0"
object-assign "^4.0.1"
pify "^2.0.0"
pinkie-promise "^2.0.0"
rimraf "^2.2.8"
doctrine@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-2.1.0.tgz#5cd01fc101621b42c4cd7f5d1a66243716d3f39d"
dependencies:
esutils "^2.0.2"
es-abstract@^1.5.0:
version "1.12.0"
resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.12.0.tgz#9dbbdd27c6856f0001421ca18782d786bf8a6165"
dependencies:
es-to-primitive "^1.1.1"
function-bind "^1.1.1"
has "^1.0.1"
is-callable "^1.1.3"
is-regex "^1.0.4"
es-to-primitive@^1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.1.1.tgz#45355248a88979034b6792e19bb81f2b7975dd0d"
dependencies:
is-callable "^1.1.1"
is-date-object "^1.0.1"
is-symbol "^1.0.1"
escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5:
version "1.0.5"
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4"
eslint-scope@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-4.0.0.tgz#50bf3071e9338bcdc43331794a0cb533f0136172"
dependencies:
esrecurse "^4.1.0"
estraverse "^4.1.1"
eslint-utils@^1.3.1:
version "1.3.1"
resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-1.3.1.tgz#9a851ba89ee7c460346f97cf8939c7298827e512"
eslint-visitor-keys@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#3f3180fb2e291017716acb4c9d6d5b5c34a6a81d"
eslint@5:
version "5.4.0"
resolved "https://registry.yarnpkg.com/eslint/-/eslint-5.4.0.tgz#d068ec03006bb9e06b429dc85f7e46c1b69fac62"
dependencies:
ajv "^6.5.0"
babel-code-frame "^6.26.0"
chalk "^2.1.0"
cross-spawn "^6.0.5"
debug "^3.1.0"
doctrine "^2.1.0"
eslint-scope "^4.0.0"
eslint-utils "^1.3.1"
eslint-visitor-keys "^1.0.0"
espree "^4.0.0"
esquery "^1.0.1"
esutils "^2.0.2"
file-entry-cache "^2.0.0"
functional-red-black-tree "^1.0.1"
glob "^7.1.2"
globals "^11.7.0"
ignore "^4.0.2"
imurmurhash "^0.1.4"
inquirer "^5.2.0"
is-resolvable "^1.1.0"
js-yaml "^3.11.0"
json-stable-stringify-without-jsonify "^1.0.1"
levn "^0.3.0"
lodash "^4.17.5"
minimatch "^3.0.4"
mkdirp "^0.5.1"
natural-compare "^1.4.0"
optionator "^0.8.2"
path-is-inside "^1.0.2"
pluralize "^7.0.0"
progress "^2.0.0"
regexpp "^2.0.0"
require-uncached "^1.0.3"
semver "^5.5.0"
strip-ansi "^4.0.0"
strip-json-comments "^2.0.1"
table "^4.0.3"
text-table "^0.2.0"
espree@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/espree/-/espree-4.0.0.tgz#253998f20a0f82db5d866385799d912a83a36634"
dependencies:
acorn "^5.6.0"
acorn-jsx "^4.1.1"
esprima@^4.0.0:
version "4.0.1"
resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71"
esquery@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.0.1.tgz#406c51658b1f5991a5f9b62b1dc25b00e3e5c708"
dependencies:
estraverse "^4.0.0"
esrecurse@^4.1.0:
version "4.2.1"
resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.2.1.tgz#007a3b9fdbc2b3bb87e4879ea19c92fdbd3942cf"
dependencies:
estraverse "^4.1.0"
estraverse@^4.0.0, estraverse@^4.1.0, estraverse@^4.1.1:
version "4.2.0"
resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.2.0.tgz#0dee3fed31fcd469618ce7342099fc1afa0bdb13"
esutils@^2.0.2:
version "2.0.2"
resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b"
external-editor@^2.1.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-2.2.0.tgz#045511cfd8d133f3846673d1047c154e214ad3d5"
dependencies:
chardet "^0.4.0"
iconv-lite "^0.4.17"
tmp "^0.0.33"
fast-deep-equal@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz#7b05218ddf9667bf7f370bf7fdb2cb15fdd0aa49"
fast-json-stable-stringify@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2"
fast-levenshtein@~2.0.4:
version "2.0.6"
resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917"
figures@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/figures/-/figures-2.0.0.tgz#3ab1a2d2a62c8bfb431a0c94cb797a2fce27c962"
dependencies:
escape-string-regexp "^1.0.5"
file-entry-cache@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-2.0.0.tgz#c392990c3e684783d838b8c84a45d8a048458361"
dependencies:
flat-cache "^1.2.1"
object-assign "^4.0.1"
flat-cache@^1.2.1:
version "1.3.0"
resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-1.3.0.tgz#d3030b32b38154f4e3b7e9c709f490f7ef97c481"
dependencies:
circular-json "^0.3.1"
del "^2.0.2"
graceful-fs "^4.1.2"
write "^0.2.1"
for-each@~0.3.3:
version "0.3.3"
resolved "https://registry.yarnpkg.com/for-each/-/for-each-0.3.3.tgz#69b447e88a0a5d32c3e7084f3f1710034b21376e"
dependencies:
is-callable "^1.1.3"
fs.realpath@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f"
function-bind@^1.0.2, function-bind@^1.1.1, function-bind@~1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d"
functional-red-black-tree@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327"
glob@^7.0.3, glob@^7.0.5, glob@^7.1.2, glob@~7.1.2:
version "7.1.2"
resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15"
dependencies:
fs.realpath "^1.0.0"
inflight "^1.0.4"
inherits "2"
minimatch "^3.0.4"
once "^1.3.0"
path-is-absolute "^1.0.0"
globals@^11.7.0:
version "11.7.0"
resolved "https://registry.yarnpkg.com/globals/-/globals-11.7.0.tgz#a583faa43055b1aca771914bf68258e2fc125673"
globby@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/globby/-/globby-5.0.0.tgz#ebd84667ca0dbb330b99bcfc68eac2bc54370e0d"
dependencies:
array-union "^1.0.1"
arrify "^1.0.0"
glob "^7.0.3"
object-assign "^4.0.1"
pify "^2.0.0"
pinkie-promise "^2.0.0"
graceful-fs@^4.1.2:
version "4.1.11"
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658"
has-ansi@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91"
dependencies:
ansi-regex "^2.0.0"
has-flag@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd"
has@^1.0.1, has@~1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796"
dependencies:
function-bind "^1.1.1"
iconv-lite@0.4, iconv-lite@^0.4.17:
version "0.4.24"
resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b"
dependencies:
safer-buffer ">= 2.1.2 < 3"
ignore@^4.0.2:
version "4.0.6"
resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc"
imurmurhash@^0.1.4:
version "0.1.4"
resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea"
inflight@^1.0.4:
version "1.0.6"
resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9"
dependencies:
once "^1.3.0"
wrappy "1"
inherits@2, inherits@~2.0.3:
version "2.0.3"
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de"
inquirer@^5.2.0:
version "5.2.0"
resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-5.2.0.tgz#db350c2b73daca77ff1243962e9f22f099685726"
dependencies:
ansi-escapes "^3.0.0"
chalk "^2.0.0"
cli-cursor "^2.1.0"
cli-width "^2.0.0"
external-editor "^2.1.0"
figures "^2.0.0"
lodash "^4.3.0"
mute-stream "0.0.7"
run-async "^2.2.0"
rxjs "^5.5.2"
string-width "^2.1.0"
strip-ansi "^4.0.0"
through "^2.3.6"
is-callable@^1.1.1, is-callable@^1.1.3:
version "1.1.4"
resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.4.tgz#1e1adf219e1eeb684d691f9d6a05ff0d30a24d75"
is-date-object@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.1.tgz#9aa20eb6aeebbff77fbd33e74ca01b33581d3a16"
is-fullwidth-code-point@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f"
is-path-cwd@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/is-path-cwd/-/is-path-cwd-1.0.0.tgz#d225ec23132e89edd38fda767472e62e65f1106d"
is-path-in-cwd@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/is-path-in-cwd/-/is-path-in-cwd-1.0.1.tgz#5ac48b345ef675339bd6c7a48a912110b241cf52"
dependencies:
is-path-inside "^1.0.0"
is-path-inside@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-1.0.1.tgz#8ef5b7de50437a3fdca6b4e865ef7aa55cb48036"
dependencies:
path-is-inside "^1.0.1"
is-promise@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-2.1.0.tgz#79a2a9ece7f096e80f36d2b2f3bc16c1ff4bf3fa"
is-regex@^1.0.4:
version "1.0.4"
resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.0.4.tgz#5517489b547091b0930e095654ced25ee97e9491"
dependencies:
has "^1.0.1"
is-resolvable@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/is-resolvable/-/is-resolvable-1.1.0.tgz#fb18f87ce1feb925169c9a407c19318a3206ed88"
is-symbol@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.1.tgz#3cc59f00025194b6ab2e38dbae6689256b660572"
isexe@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10"
js-tokens@^3.0.2:
version "3.0.2"
resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b"
js-tokens@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499"
js-yaml@^3.11.0:
version "3.12.0"
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.12.0.tgz#eaed656ec8344f10f527c6bfa1b6e2244de167d1"
dependencies:
argparse "^1.0.7"
esprima "^4.0.0"
json-schema-traverse@^0.4.1:
version "0.4.1"
resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660"
json-stable-stringify-without-jsonify@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651"
levn@^0.3.0, levn@~0.3.0:
version "0.3.0"
resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee"
dependencies:
prelude-ls "~1.1.2"
type-check "~0.3.2"
lodash@^4.17.4, lodash@^4.17.5, lodash@^4.3.0:
version "4.17.10"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.10.tgz#1b7793cf7259ea38fb3661d4d38b3260af8ae4e7"
mimic-fn@^1.0.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.2.0.tgz#820c86a39334640e99516928bd03fca88057d022"
minimatch@^3.0.4:
version "3.0.4"
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083"
dependencies:
brace-expansion "^1.1.7"
minimist@0.0.8:
version "0.0.8"
resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d"
minimist@~1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284"
mkdirp@^0.5.1:
version "0.5.1"
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903"
dependencies:
minimist "0.0.8"
ms@2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8"
mute-stream@0.0.7:
version "0.0.7"
resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab"
natural-compare@^1.4.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7"
nice-try@^1.0.4:
version "1.0.4"
resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.4.tgz#d93962f6c52f2c1558c0fbda6d512819f1efe1c4"
object-assign@^4.0.1:
version "4.1.1"
resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863"
object-inspect@~1.6.0:
version "1.6.0"
resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.6.0.tgz#c70b6cbf72f274aab4c34c0c82f5167bf82cf15b"
object-keys@^1.0.12:
version "1.0.12"
resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.0.12.tgz#09c53855377575310cca62f55bb334abff7b3ed2"
once@^1.3.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1"
dependencies:
wrappy "1"
onetime@^2.0.0:
version "2.0.1"
resolved "https://registry.yarnpkg.com/onetime/-/onetime-2.0.1.tgz#067428230fd67443b2794b22bba528b6867962d4"
dependencies:
mimic-fn "^1.0.0"
optionator@^0.8.2:
version "0.8.2"
resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.2.tgz#364c5e409d3f4d6301d6c0b4c05bba50180aeb64"
dependencies:
deep-is "~0.1.3"
fast-levenshtein "~2.0.4"
levn "~0.3.0"
prelude-ls "~1.1.2"
type-check "~0.3.2"
wordwrap "~1.0.0"
os-tmpdir@~1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274"
path-is-absolute@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f"
path-is-inside@^1.0.1, path-is-inside@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53"
path-key@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40"
path-parse@^1.0.5:
version "1.0.6"
resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c"
pify@^2.0.0:
version "2.3.0"
resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c"
pinkie-promise@^2.0.0:
version "2.0.1"
resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa"
dependencies:
pinkie "^2.0.0"
pinkie@^2.0.0:
version "2.0.4"
resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870"
pluralize@^7.0.0:
version "7.0.0"
resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-7.0.0.tgz#298b89df8b93b0221dbf421ad2b1b1ea23fc6777"
prelude-ls@~1.1.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54"
progress@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.0.tgz#8a1be366bf8fc23db2bd23f10c6fe920b4389d1f"
punycode@^2.1.0:
version "2.1.1"
resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec"
regexpp@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-2.0.0.tgz#b2a7534a85ca1b033bcf5ce9ff8e56d4e0755365"
require-uncached@^1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/require-uncached/-/require-uncached-1.0.3.tgz#4e0d56d6c9662fd31e43011c4b95aa49955421d3"
dependencies:
caller-path "^0.1.0"
resolve-from "^1.0.0"
resolve-from@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-1.0.1.tgz#26cbfe935d1aeeeabb29bc3fe5aeb01e93d44226"
resolve@~1.7.1:
version "1.7.1"
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.7.1.tgz#aadd656374fd298aee895bc026b8297418677fd3"
dependencies:
path-parse "^1.0.5"
restore-cursor@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf"
dependencies:
onetime "^2.0.0"
signal-exit "^3.0.2"
resumer@~0.0.0:
version "0.0.0"
resolved "https://registry.yarnpkg.com/resumer/-/resumer-0.0.0.tgz#f1e8f461e4064ba39e82af3cdc2a8c893d076759"
dependencies:
through "~2.3.4"
rimraf@^2.2.8:
version "2.6.2"
resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.2.tgz#2ed8150d24a16ea8651e6d6ef0f47c4158ce7a36"
dependencies:
glob "^7.0.5"
rollup-plugin-terser@1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/rollup-plugin-terser/-/rollup-plugin-terser-1.0.1.tgz#ba5f497cbc9aa38ba19d3ee2167c04ea3ed279af"
dependencies:
"@babel/code-frame" "^7.0.0-beta.47"
terser "^3.7.5"
rollup@0.64:
version "0.64.1"
resolved "https://registry.yarnpkg.com/rollup/-/rollup-0.64.1.tgz#9188ee368e5fcd43ffbc00ec414e72eeb5de87ba"
dependencies:
"@types/estree" "0.0.39"
"@types/node" "*"
run-async@^2.2.0:
version "2.3.0"
resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.3.0.tgz#0371ab4ae0bdd720d4166d7dfda64ff7a445a6c0"
dependencies:
is-promise "^2.1.0"
rw@1:
version "1.3.3"
resolved "https://registry.yarnpkg.com/rw/-/rw-1.3.3.tgz#3f862dfa91ab766b14885ef4d01124bfda074fb4"
rxjs@^5.5.2:
version "5.5.11"
resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-5.5.11.tgz#f733027ca43e3bec6b994473be4ab98ad43ced87"
dependencies:
symbol-observable "1.0.1"
"safer-buffer@>= 2.1.2 < 3":
version "2.1.2"
resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a"
semver@^5.5.0:
version "5.5.1"
resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.1.tgz#7dfdd8814bdb7cabc7be0fb1d734cfb66c940477"
shebang-command@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea"
dependencies:
shebang-regex "^1.0.0"
shebang-regex@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3"
signal-exit@^3.0.2:
version "3.0.2"
resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d"
slice-ansi@1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-1.0.0.tgz#044f1a49d8842ff307aad6b505ed178bd950134d"
dependencies:
is-fullwidth-code-point "^2.0.0"
source-map-support@~0.5.6:
version "0.5.9"
resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.9.tgz#41bc953b2534267ea2d605bccfa7bfa3111ced5f"
dependencies:
buffer-from "^1.0.0"
source-map "^0.6.0"
source-map@^0.6.0, source-map@~0.6.1:
version "0.6.1"
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263"
sprintf-js@~1.0.2:
version "1.0.3"
resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c"
string-width@^2.1.0, string-width@^2.1.1:
version "2.1.1"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e"
dependencies:
is-fullwidth-code-point "^2.0.0"
strip-ansi "^4.0.0"
string.prototype.trim@~1.1.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/string.prototype.trim/-/string.prototype.trim-1.1.2.tgz#d04de2c89e137f4d7d206f086b5ed2fae6be8cea"
dependencies:
define-properties "^1.1.2"
es-abstract "^1.5.0"
function-bind "^1.0.2"
strip-ansi@^3.0.0:
version "3.0.1"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf"
dependencies:
ansi-regex "^2.0.0"
strip-ansi@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f"
dependencies:
ansi-regex "^3.0.0"
strip-json-comments@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a"
supports-color@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7"
supports-color@^5.3.0:
version "5.5.0"
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f"
dependencies:
has-flag "^3.0.0"
symbol-observable@1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.0.1.tgz#8340fc4702c3122df5d22288f88283f513d3fdd4"
table@^4.0.3:
version "4.0.3"
resolved "https://registry.yarnpkg.com/table/-/table-4.0.3.tgz#00b5e2b602f1794b9acaf9ca908a76386a7813bc"
dependencies:
ajv "^6.0.1"
ajv-keywords "^3.0.0"
chalk "^2.1.0"
lodash "^4.17.4"
slice-ansi "1.0.0"
string-width "^2.1.1"
tape@4:
version "4.9.1"
resolved "https://registry.yarnpkg.com/tape/-/tape-4.9.1.tgz#1173d7337e040c76fbf42ec86fcabedc9b3805c9"
dependencies:
deep-equal "~1.0.1"
defined "~1.0.0"
for-each "~0.3.3"
function-bind "~1.1.1"
glob "~7.1.2"
has "~1.0.3"
inherits "~2.0.3"
minimist "~1.2.0"
object-inspect "~1.6.0"
resolve "~1.7.1"
resumer "~0.0.0"
string.prototype.trim "~1.1.2"
through "~2.3.8"
terser@^3.7.5:
version "3.8.1"
resolved "https://registry.yarnpkg.com/terser/-/terser-3.8.1.tgz#cb70070ac9e0a71add169dfb63c0a64fca2738ac"
dependencies:
commander "~2.16.0"
source-map "~0.6.1"
source-map-support "~0.5.6"
text-table@^0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4"
through@^2.3.6, through@~2.3.4, through@~2.3.8:
version "2.3.8"
resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5"
tmp@^0.0.33:
version "0.0.33"
resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9"
dependencies:
os-tmpdir "~1.0.2"
type-check@~0.3.2:
version "0.3.2"
resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72"
dependencies:
prelude-ls "~1.1.2"
uri-js@^4.2.2:
version "4.2.2"
resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.2.2.tgz#94c540e1ff772956e2299507c010aea6c8838eb0"
dependencies:
punycode "^2.1.0"
which@^1.2.9:
version "1.3.1"
resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a"
dependencies:
isexe "^2.0.0"
wordwrap@~1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb"
wrappy@1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"
write@^0.2.1:
version "0.2.1"
resolved "https://registry.yarnpkg.com/write/-/write-0.2.1.tgz#5fc03828e264cea3fe91455476f7a3c566cb0757"
dependencies:
mkdirp "^0.5.1"