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

d3-fetch

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

d3-fetch - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

6

dist/d3-fetch.js

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

// https://d3js.org/d3-fetch/ Version 1.0.0. Copyright 2018 Mike Bostock.
// https://d3js.org/d3-fetch/ Version 1.0.1. Copyright 2018 Mike Bostock.
(function (global, factory) {

@@ -9,2 +9,3 @@ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('d3-dsv')) :

function responseBlob(response) {
if (!response.ok) throw new Error(response.status + " " + response.statusText);
return response.blob();

@@ -18,2 +19,3 @@ }

function responseArrayBuffer(response) {
if (!response.ok) throw new Error(response.status + " " + response.statusText);
return response.arrayBuffer();

@@ -27,2 +29,3 @@ }

function responseText(response) {
if (!response.ok) throw new Error(response.status + " " + response.statusText);
return response.text();

@@ -66,2 +69,3 @@ }

function responseJson(response) {
if (!response.ok) throw new Error(response.status + " " + response.statusText);
return response.json();

@@ -68,0 +72,0 @@ }

4

dist/d3-fetch.min.js

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

// https://d3js.org/d3-fetch/ Version 1.0.0. Copyright 2018 Mike Bostock.
!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("d3-dsv")):"function"==typeof define&&define.amd?define(["exports","d3-dsv"],t):t(n.d3=n.d3||{},n.d3)}(this,function(n,t){"use strict";function e(n){return n.blob()}function r(n){return n.arrayBuffer()}function o(n){return n.text()}function u(n,t){return fetch(n,t).then(o)}function f(n){return function(t,e,r){return 2===arguments.length&&"function"==typeof e&&(r=e,e=void 0),u(t,e).then(function(t){return n(t,r)})}}function i(n){return n.json()}var c=f(t.csvParse),s=f(t.tsvParse);n.blob=function(n,t){return fetch(n,t).then(e)},n.buffer=function(n,t){return fetch(n,t).then(r)},n.dsv=function(n,e,r,o){3===arguments.length&&"function"==typeof r&&(o=r,r=void 0);var f=t.dsvFormat(n);return u(e,r).then(function(n){return f.parse(n,o)})},n.csv=c,n.tsv=s,n.image=function(n,t){return new Promise(function(e,r){var o=new Image;for(var u in t)o[u]=t[u];o.onerror=r,o.onload=function(){e(o)},o.src=n})},n.json=function(n,t){return fetch(n,t).then(i)},n.text=u,Object.defineProperty(n,"__esModule",{value:!0})});
// https://d3js.org/d3-fetch/ Version 1.0.1. Copyright 2018 Mike Bostock.
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("d3-dsv")):"function"==typeof define&&define.amd?define(["exports","d3-dsv"],n):n(t.d3=t.d3||{},t.d3)}(this,function(t,n){"use strict";function e(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);return t.blob()}function r(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);return t.arrayBuffer()}function o(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);return t.text()}function u(t,n){return fetch(t,n).then(o)}function f(t){return function(n,e,r){return 2===arguments.length&&"function"==typeof e&&(r=e,e=void 0),u(n,e).then(function(n){return t(n,r)})}}function i(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);return t.json()}var s=f(n.csvParse),c=f(n.tsvParse);t.blob=function(t,n){return fetch(t,n).then(e)},t.buffer=function(t,n){return fetch(t,n).then(r)},t.dsv=function(t,e,r,o){3===arguments.length&&"function"==typeof r&&(o=r,r=void 0);var f=n.dsvFormat(t);return u(e,r).then(function(t){return f.parse(t,o)})},t.csv=s,t.tsv=c,t.image=function(t,n){return new Promise(function(e,r){var o=new Image;for(var u in n)o[u]=n[u];o.onerror=r,o.onload=function(){e(o)},o.src=t})},t.json=function(t,n){return fetch(t,n).then(i)},t.text=u,Object.defineProperty(t,"__esModule",{value:!0})});
{
"name": "d3-fetch",
"version": "1.0.0",
"version": "1.0.1",
"description": "Convenient parsing for Fetch.",

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

@@ -41,7 +41,7 @@ # d3-fetch

Fetches the binary file at the specified *input* URL as a Blob. If *init* is specified, it is passed along to the underlying call to [fetch](https://fetch.spec.whatwg.org/#fetch-method).
Fetches the binary file at the specified *input* URL as a Blob. If *init* is specified, it is passed along to the underlying call to [fetch](https://fetch.spec.whatwg.org/#fetch-method); see [RequestInit](https://fetch.spec.whatwg.org/#requestinit) for allowed fields.
<a name="buffer" href="#buffer">#</a> d3.<b>buffer</b>(<i>input</i>[, <i>init</i>]) [<>](https://github.com/d3/d3-fetch/blob/master/src/buffer.js "Source")
Fetches the binary file at the specified *input* URL as an ArrayBuffer. If *init* is specified, it is passed along to the underlying call to [fetch](https://fetch.spec.whatwg.org/#fetch-method).
Fetches the binary file at the specified *input* URL as an ArrayBuffer. If *init* is specified, it is passed along to the underlying call to [fetch](https://fetch.spec.whatwg.org/#fetch-method); see [RequestInit](https://fetch.spec.whatwg.org/#requestinit) for allowed fields.

@@ -54,3 +54,3 @@ <a name="csv" href="#csv">#</a> d3.<b>csv</b>(<i>input</i>[, <i>init</i>][, <i>row</i>]) [<>](https://github.com/d3/d3-fetch/blob/master/src/dsv.js "Source")

Fetches the [DSV](https://github.com/d3/d3-dsv) file at the specified *input* URL. If *init* is specified, it is passed along to the underlying call to [fetch](https://fetch.spec.whatwg.org/#fetch-method). An optional *row* conversion function may be specified to map and filter row objects to a more-specific representation; see [*dsv*.parse](https://github.com/d3/d3-dsv#dsv_parse) for details. For example:
Fetches the [DSV](https://github.com/d3/d3-dsv) file at the specified *input* URL. If *init* is specified, it is passed along to the underlying call to [fetch](https://fetch.spec.whatwg.org/#fetch-method); see [RequestInit](https://fetch.spec.whatwg.org/#requestinit) for allowed fields. An optional *row* conversion function may be specified to map and filter row objects to a more-specific representation; see [*dsv*.parse](https://github.com/d3/d3-dsv#dsv_parse) for details. For example:

@@ -86,7 +86,7 @@ ```js

Fetches the [JSON](http://json.org) file at the specified *input* URL.
Fetches the [JSON](http://json.org) file at the specified *input* URL. If *init* is specified, it is passed along to the underlying call to [fetch](https://fetch.spec.whatwg.org/#fetch-method); see [RequestInit](https://fetch.spec.whatwg.org/#requestinit) for allowed fields.
<a name="text" href="#text">#</a> d3.<b>text</b>(<i>input</i>[, <i>init</i>]) [<>](https://github.com/d3/d3-fetch/blob/master/src/text.js "Source")
Fetches the text file at the specified *input* URL.
Fetches the text file at the specified *input* URL. If *init* is specified, it is passed along to the underlying call to [fetch](https://fetch.spec.whatwg.org/#fetch-method); see [RequestInit](https://fetch.spec.whatwg.org/#requestinit) for allowed fields.

@@ -93,0 +93,0 @@ <a name="tsv" href="#tsv">#</a> d3.<b>tsv</b>(<i>input</i>[, <i>init</i>][, <i>row</i>]) [<>](https://github.com/d3/d3-fetch/blob/master/src/dsv.js "Source")

function responseBlob(response) {
if (!response.ok) throw new Error(response.status + " " + response.statusText);
return response.blob();

@@ -3,0 +4,0 @@ }

function responseArrayBuffer(response) {
if (!response.ok) throw new Error(response.status + " " + response.statusText);
return response.arrayBuffer();

@@ -3,0 +4,0 @@ }

function responseJson(response) {
if (!response.ok) throw new Error(response.status + " " + response.statusText);
return response.json();

@@ -3,0 +4,0 @@ }

function responseText(response) {
if (!response.ok) throw new Error(response.status + " " + response.statusText);
return response.text();

@@ -3,0 +4,0 @@ }

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