Skip to content

Commit

Permalink
begin adding conver tests; change dbf dep
Browse files Browse the repository at this point in the history
  • Loading branch information
mhkeller committed Oct 4, 2017
1 parent 2c4ec09 commit 1460608
Show file tree
Hide file tree
Showing 7 changed files with 180 additions and 124 deletions.
14 changes: 7 additions & 7 deletions dist/indian-ocean.browser.es6.js
Original file line number Diff line number Diff line change
Expand Up @@ -6448,7 +6448,7 @@ var structure$1 = function structure(data, meta) {
view.setUint8(0, 0x03);
// date of last update
view.setUint8(1, now.getFullYear() - 1900);
view.setUint8(2, now.getMonth());
view.setUint8(2, now.getMonth() + 1);
view.setUint8(3, now.getDate());
// number of records
view.setUint32(4, data.length, true);
Expand All @@ -6464,7 +6464,7 @@ var structure$1 = function structure(data, meta) {

field_meta.forEach(function (f, i) {
// field name
f.name.split('').slice(0, 8).forEach(function (c, x) {
f.name.split('').slice(0, 10).forEach(function (c, x) {
view.setInt8(32 + i * 32 + x, c.charCodeAt(0));
});
// field type
Expand All @@ -6474,7 +6474,7 @@ var structure$1 = function structure(data, meta) {
if (f.type == 'N') view.setInt8(32 + i * 32 + 17, 3);
});

offset = fieldDescLength + 32;
var offset = fieldDescLength + 32;

data.forEach(function (row, num) {
// delete flag: this is not deleted
Expand Down Expand Up @@ -8727,18 +8727,18 @@ formatsList.forEach(function (format) {
});

/**
* Given a `filePath` return a parser that can read that file as json. Parses as text if format not supported by a built-in parser. If given a delimter string as the second argument, return a parser for that delimiter regardless of `filePath`. Used internally by {@link readData} and {@link readDataSync}.
* Given a `filePath` return a parser that can read that file as json. Parses as text if format not supported by a built-in parser. If given a delimiter string as the second argument, return a parser for that delimiter regardless of `filePath`. Used internally by {@link readData} and {@link readDataSync}.
*
* @function discernParser
* @param {String} [filePath] Input file path
* @param {String} [delimiter] Alternative usage is to pass a delimiter string. Delegates to `dsv.dsvFormat`.
* @returns {Function} A parser that can read the file
* @returns {Function} A parser that can parse a file string into json
*
* @example
* var parser = io.discernParser('path/to/data.csv')
* var json = parser('path/to/data.csv')
* var json = parser('name,price\nApple,120\nPear,300')
* var parser = io.discernParser(null, '_')
* var json = parser('path/to/data.usv')
* var json = parser('name_price\nApple_120\nPear_300')
*/
function discernParser(filePath, delimiter) {
if (delimiter) {
Expand Down
14 changes: 7 additions & 7 deletions dist/indian-ocean.js
Original file line number Diff line number Diff line change
Expand Up @@ -6454,7 +6454,7 @@ var structure$1 = function structure(data, meta) {
view.setUint8(0, 0x03);
// date of last update
view.setUint8(1, now.getFullYear() - 1900);
view.setUint8(2, now.getMonth());
view.setUint8(2, now.getMonth() + 1);
view.setUint8(3, now.getDate());
// number of records
view.setUint32(4, data.length, true);
Expand All @@ -6470,7 +6470,7 @@ var structure$1 = function structure(data, meta) {

field_meta.forEach(function (f, i) {
// field name
f.name.split('').slice(0, 8).forEach(function (c, x) {
f.name.split('').slice(0, 10).forEach(function (c, x) {
view.setInt8(32 + i * 32 + x, c.charCodeAt(0));
});
// field type
Expand All @@ -6480,7 +6480,7 @@ var structure$1 = function structure(data, meta) {
if (f.type == 'N') view.setInt8(32 + i * 32 + 17, 3);
});

offset = fieldDescLength + 32;
var offset = fieldDescLength + 32;

data.forEach(function (row, num) {
// delete flag: this is not deleted
Expand Down Expand Up @@ -8733,18 +8733,18 @@ formatsList.forEach(function (format) {
});

/**
* Given a `filePath` return a parser that can read that file as json. Parses as text if format not supported by a built-in parser. If given a delimter string as the second argument, return a parser for that delimiter regardless of `filePath`. Used internally by {@link readData} and {@link readDataSync}.
* Given a `filePath` return a parser that can read that file as json. Parses as text if format not supported by a built-in parser. If given a delimiter string as the second argument, return a parser for that delimiter regardless of `filePath`. Used internally by {@link readData} and {@link readDataSync}.
*
* @function discernParser
* @param {String} [filePath] Input file path
* @param {String} [delimiter] Alternative usage is to pass a delimiter string. Delegates to `dsv.dsvFormat`.
* @returns {Function} A parser that can read the file
* @returns {Function} A parser that can parse a file string into json
*
* @example
* var parser = io.discernParser('path/to/data.csv')
* var json = parser('path/to/data.csv')
* var json = parser('name,price\nApple,120\nPear,300')
* var parser = io.discernParser(null, '_')
* var json = parser('path/to/data.usv')
* var json = parser('name_price\nApple_120\nPear_300')
*/
function discernParser(filePath, delimiter) {
if (delimiter) {
Expand Down
6 changes: 3 additions & 3 deletions dist/indian-ocean.min.js

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions dist/indian-ocean.node.js
Original file line number Diff line number Diff line change
Expand Up @@ -5831,18 +5831,18 @@ formatsList.forEach(function (format) {
});

/**
* Given a `filePath` return a parser that can read that file as json. Parses as text if format not supported by a built-in parser. If given a delimter string as the second argument, return a parser for that delimiter regardless of `filePath`. Used internally by {@link readData} and {@link readDataSync}.
* Given a `filePath` return a parser that can read that file as json. Parses as text if format not supported by a built-in parser. If given a delimiter string as the second argument, return a parser for that delimiter regardless of `filePath`. Used internally by {@link readData} and {@link readDataSync}.
*
* @function discernParser
* @param {String} [filePath] Input file path
* @param {String} [delimiter] Alternative usage is to pass a delimiter string. Delegates to `dsv.dsvFormat`.
* @returns {Function} A parser that can read the file
* @returns {Function} A parser that can parse a file string into json
*
* @example
* var parser = io.discernParser('path/to/data.csv')
* var json = parser('path/to/data.csv')
* var json = parser('name,price\nApple,120\nPear,300')
* var parser = io.discernParser(null, '_')
* var json = parser('path/to/data.usv')
* var json = parser('name_price\nApple_120\nPear_300')
*/
function discernParser(filePath, delimiter) {
if (delimiter) {
Expand Down Expand Up @@ -6584,7 +6584,7 @@ var structure$1 = function structure(data, meta) {
view.setUint8(0, 0x03);
// date of last update
view.setUint8(1, now.getFullYear() - 1900);
view.setUint8(2, now.getMonth());
view.setUint8(2, now.getMonth() + 1);
view.setUint8(3, now.getDate());
// number of records
view.setUint32(4, data.length, true);
Expand All @@ -6600,7 +6600,7 @@ var structure$1 = function structure(data, meta) {

field_meta.forEach(function (f, i) {
// field name
f.name.split('').slice(0, 8).forEach(function (c, x) {
f.name.split('').slice(0, 10).forEach(function (c, x) {
view.setInt8(32 + i * 32 + x, c.charCodeAt(0));
});
// field type
Expand All @@ -6610,7 +6610,7 @@ var structure$1 = function structure(data, meta) {
if (f.type == 'N') view.setInt8(32 + i * 32 + 17, 3);
});

offset = fieldDescLength + 32;
var offset = fieldDescLength + 32;

data.forEach(function (row, num) {
// delete flag: this is not deleted
Expand Down

0 comments on commit 1460608

Please sign in to comment.