Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

d3-dsv

Package Overview
Dependencies
Maintainers
1
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

d3-dsv - npm Package Compare versions

Comparing version 0.1.8 to 0.1.9

2

build/bundle.js

@@ -1,1 +0,1 @@

var version = "0.1.8"; export * from "../index"; export {version};
var version = "0.1.9"; export * from "../index"; export {version};

@@ -8,8 +8,12 @@ (function (global, factory) {

function dsv(delimiter) {
return new Dsv(delimiter);
}
function Dsv(delimiter) {
var reFormat = new RegExp("[\"" + delimiter + "\n]"),
delimiterCode = delimiter.charCodeAt(0);
function parse(text, f) {
this.parse = function(text, f) {
var o;
return parseRows(text, function(row, i) {
return this.parseRows(text, function(row, i) {
if (o) return o(row, i - 1);

@@ -21,5 +25,5 @@ var a = new Function("d", "return {" + row.map(function(name, i) {

});
}
};
function parseRows(text, f) {
this.parseRows = function(text, f) {
var EOL = {}, // sentinel value for end-of-line

@@ -85,4 +89,4 @@ EOF = {}, // sentinel value for end-of-file

function format(rows) {
if (Array.isArray(rows[0])) return formatRows(rows); // deprecated; use formatRows
this.format = function(rows) {
if (Array.isArray(rows[0])) return this.formatRows(rows); // deprecated; use formatRows
var fieldSet = Object.create(null), fields = [];

@@ -104,7 +108,7 @@

})).join("\n");
}
};
function formatRows(rows) {
this.formatRows = function(rows) {
return rows.map(formatRow).join("\n");
}
};

@@ -118,15 +122,10 @@ function formatRow(row) {

}
return {
parse: parse,
parseRows: parseRows,
format: format,
formatRows: formatRows
};
};
dsv.prototype = Dsv.prototype;
var csv = dsv(",");
var tsv = dsv("\t");
var version = "0.1.8";
var version = "0.1.9";

@@ -133,0 +132,0 @@ exports.version = version;

@@ -1,1 +0,1 @@

!function(r,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define("d3-dsv",["exports"],n):n(r.d3_dsv={})}(this,function(r){"use strict";function n(r){function n(r,n){var t;return e(r,function(r,e){if(t)return t(r,e-1);var o=new Function("d","return {"+r.map(function(r,n){return JSON.stringify(r)+": d["+n+"]"}).join(",")+"}");t=n?function(r,e){return n(o(r),e)}:o})}function e(r,n){function e(){if(s>=a)return u;if(o)return o=!1,i;var n=s;if(34===r.charCodeAt(n)){for(var e=n;e++<a;)if(34===r.charCodeAt(e)){if(34!==r.charCodeAt(e+1))break;++e}s=e+2;var t=r.charCodeAt(e+1);return 13===t?(o=!0,10===r.charCodeAt(e+2)&&++s):10===t&&(o=!0),r.slice(n+1,e).replace(/""/g,'"')}for(;a>s;){var t=r.charCodeAt(s++),f=1;if(10===t)o=!0;else if(13===t)o=!0,10===r.charCodeAt(s)&&(++s,++f);else if(t!==c)continue;return r.slice(n,s-f)}return r.slice(n)}for(var t,o,i={},u={},f=[],a=r.length,s=0,d=0;(t=e())!==u;){for(var p=[];t!==i&&t!==u;)p.push(t),t=e();n&&null==(p=n(p,d++))||f.push(p)}return f}function t(n){if(Array.isArray(n[0]))return o(n);var e=Object.create(null),t=[];return n.forEach(function(r){for(var n in r)(n+="")in e||t.push(e[n]=n)}),[t.map(u).join(r)].concat(n.map(function(n){return t.map(function(r){return u(n[r])}).join(r)})).join("\n")}function o(r){return r.map(i).join("\n")}function i(n){return n.map(u).join(r)}function u(r){return f.test(r)?'"'+r.replace(/\"/g,'""')+'"':r}var f=new RegExp('["'+r+"\n]"),c=r.charCodeAt(0);return{parse:n,parseRows:e,format:t,formatRows:o}}var e=n(","),t=n(" "),o="0.1.8";r.version=o,r.dsv=n,r.csv=e,r.tsv=t});
!function(r,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define("d3-dsv",["exports"],n):n(r.d3_dsv={})}(this,function(r){"use strict";function n(r){return new t(r)}function t(r){function n(n){return n.map(t).join(r)}function t(r){return e.test(r)?'"'+r.replace(/\"/g,'""')+'"':r}var e=new RegExp('["'+r+"\n]"),o=r.charCodeAt(0);this.parse=function(r,n){var t;return this.parseRows(r,function(r,e){if(t)return t(r,e-1);var o=new Function("d","return {"+r.map(function(r,n){return JSON.stringify(r)+": d["+n+"]"}).join(",")+"}");t=n?function(r,t){return n(o(r),t)}:o})},this.parseRows=function(r,n){function t(){if(s>=c)return f;if(i)return i=!1,u;var n=s;if(34===r.charCodeAt(n)){for(var t=n;t++<c;)if(34===r.charCodeAt(t)){if(34!==r.charCodeAt(t+1))break;++t}s=t+2;var e=r.charCodeAt(t+1);return 13===e?(i=!0,10===r.charCodeAt(t+2)&&++s):10===e&&(i=!0),r.slice(n+1,t).replace(/""/g,'"')}for(;c>s;){var e=r.charCodeAt(s++),a=1;if(10===e)i=!0;else if(13===e)i=!0,10===r.charCodeAt(s)&&(++s,++a);else if(e!==o)continue;return r.slice(n,s-a)}return r.slice(n)}for(var e,i,u={},f={},a=[],c=r.length,s=0,p=0;(e=t())!==f;){for(var d=[];e!==u&&e!==f;)d.push(e),e=t();n&&null==(d=n(d,p++))||a.push(d)}return a},this.format=function(n){if(Array.isArray(n[0]))return this.formatRows(n);var e=Object.create(null),o=[];return n.forEach(function(r){for(var n in r)(n+="")in e||o.push(e[n]=n)}),[o.map(t).join(r)].concat(n.map(function(n){return o.map(function(r){return t(n[r])}).join(r)})).join("\n")},this.formatRows=function(r){return r.map(n).join("\n")}}n.prototype=t.prototype;var e=n(","),o=n(" "),i="0.1.9";r.version=i,r.dsv=n,r.csv=e,r.tsv=o});
{
"name": "d3-dsv",
"version": "0.1.8",
"version": "0.1.9",
"description": "A parser and formatter for delimiter-separated values, such as CSV and TSV",

@@ -5,0 +5,0 @@ "keywords": [

@@ -1,8 +0,12 @@

export default function(delimiter) {
function dsv(delimiter) {
return new Dsv(delimiter);
}
function Dsv(delimiter) {
var reFormat = new RegExp("[\"" + delimiter + "\n]"),
delimiterCode = delimiter.charCodeAt(0);
function parse(text, f) {
this.parse = function(text, f) {
var o;
return parseRows(text, function(row, i) {
return this.parseRows(text, function(row, i) {
if (o) return o(row, i - 1);

@@ -14,5 +18,5 @@ var a = new Function("d", "return {" + row.map(function(name, i) {

});
}
};
function parseRows(text, f) {
this.parseRows = function(text, f) {
var EOL = {}, // sentinel value for end-of-line

@@ -78,4 +82,4 @@ EOF = {}, // sentinel value for end-of-file

function format(rows) {
if (Array.isArray(rows[0])) return formatRows(rows); // deprecated; use formatRows
this.format = function(rows) {
if (Array.isArray(rows[0])) return this.formatRows(rows); // deprecated; use formatRows
var fieldSet = Object.create(null), fields = [];

@@ -97,7 +101,7 @@

})).join("\n");
}
};
function formatRows(rows) {
this.formatRows = function(rows) {
return rows.map(formatRow).join("\n");
}
};

@@ -111,9 +115,6 @@ function formatRow(row) {

}
};
return {
parse: parse,
parseRows: parseRows,
format: format,
formatRows: formatRows
};
};
dsv.prototype = Dsv.prototype;
export default dsv;
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc