d3-request
Advanced tools
Comparing version 0.4.2 to 0.4.3
@@ -1,1 +0,1 @@ | ||
var version = "0.4.2"; export * from "../index"; export {version}; | ||
var version = "0.4.3"; export * from "../index"; export {version}; |
(function (global, factory) { | ||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('d3-collection'), require('d3-dispatch'), require('d3-dsv')) : | ||
typeof define === 'function' && define.amd ? define(['exports', 'd3-collection', 'd3-dispatch', 'd3-dsv'], factory) : | ||
(factory((global.d3_request = {}),global.d3_collection,global.d3_dispatch,global.d3_dsv)); | ||
(factory((global.d3_request = global.d3_request || {}),global.d3_collection,global.d3_dispatch,global.d3_dsv)); | ||
}(this, function (exports,d3Collection,d3Dispatch,d3Dsv) { 'use strict'; | ||
@@ -188,3 +188,3 @@ | ||
var version = "0.4.2"; | ||
var version = "0.4.3"; | ||
@@ -191,0 +191,0 @@ exports.version = version; |
@@ -1,1 +0,1 @@ | ||
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("d3-collection"),require("d3-dispatch"),require("d3-dsv")):"function"==typeof define&&define.amd?define(["exports","d3-collection","d3-dispatch","d3-dsv"],n):n(e.d3_request={},e.d3_collection,e.d3_dispatch,e.d3_dsv)}(this,function(e,n,t,r){"use strict";function o(e,r){function o(e){var n,t=d.status;if(!t&&s(d)||t>=200&&300>t||304===t){if(l)try{n=l.call(i,d)}catch(r){return void p.call("error",i,r)}else n=d;p.call("load",i,n)}else p.call("error",i,e)}var i,a,l,c,p=t.dispatch("beforesend","progress","load","error"),f=n.map(),d=new XMLHttpRequest,m=0;return"undefined"==typeof XDomainRequest||"withCredentials"in d||!/^(http(s)?:)?\/\//.test(e)||(d=new XDomainRequest),"onload"in d?d.onload=d.onerror=d.ontimeout=o:d.onreadystatechange=function(e){d.readyState>3&&o(e)},d.onprogress=function(e){p.call("progress",i,e)},i={header:function(e,n){return e=(e+"").toLowerCase(),arguments.length<2?f.get(e):(null==n?f.remove(e):f.set(e,n+""),i)},mimeType:function(e){return arguments.length?(a=null==e?null:e+"",i):a},responseType:function(e){return arguments.length?(c=e,i):c},timeout:function(e){return arguments.length?(m=+e,i):m},response:function(e){return l=e,i},get:function(e,n){return i.send("GET",e,n)},post:function(e,n){return i.send("POST",e,n)},send:function(n,t,r){return r||"function"!=typeof t||(r=t,t=null),r&&1===r.length&&(r=u(r)),d.open(n,e,!0),null==a||f.has("accept")||f.set("accept",a+",*/*"),d.setRequestHeader&&f.each(function(e,n){d.setRequestHeader(n,e)}),null!=a&&d.overrideMimeType&&d.overrideMimeType(a),null!=c&&(d.responseType=c),m>0&&(d.timeout=m),r&&i.on("error",r).on("load",function(e){r(null,e)}),p.call("beforesend",i,d),d.send(null==t?null:t),i},abort:function(){return d.abort(),i},on:function(){var e=p.on.apply(p,arguments);return e===p?i:e}},r?i.get(r):i}function u(e){return function(n,t){e(null==n?t:null)}}function s(e){var n=e.responseType;return n&&"text"!==n?e.response:e.responseText}function i(e,n){return function(t,r){var u=o(t).mimeType(e).response(n);return r?u.get(r):u}}function a(e,n){return function(t,r,u){arguments.length<3&&(u=r,r=null);var s=o(t).mimeType(e);return s.row=function(e){return arguments.length?s.response(l(n,r=e)):r},s.row(r),u?s.get(u):s}}function l(e,n){return function(t){return e(t.responseText,n)}}var c=i("text/html",function(e){return document.createRange().createContextualFragment(e.responseText)}),p=i("application/json",function(e){return JSON.parse(e.responseText)}),f=i("text/plain",function(e){return e.responseText}),d=i("application/xml",function(e){var n=e.responseXML;if(!n)throw new Error("parse error");return n}),m=a("text/csv",r.csvParse),g=a("text/tab-separated-values",r.tsvParse),h="0.4.2";e.version=h,e.request=o,e.html=c,e.json=p,e.text=f,e.xml=d,e.csv=m,e.tsv=g}); | ||
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("d3-collection"),require("d3-dispatch"),require("d3-dsv")):"function"==typeof define&&define.amd?define(["exports","d3-collection","d3-dispatch","d3-dsv"],n):n(e.d3_request=e.d3_request||{},e.d3_collection,e.d3_dispatch,e.d3_dsv)}(this,function(e,n,t,r){"use strict";function o(e,r){function o(e){var n,t=f.status;if(!t&&s(f)||t>=200&&300>t||304===t){if(l)try{n=l.call(i,f)}catch(r){return void p.call("error",i,r)}else n=f;p.call("load",i,n)}else p.call("error",i,e)}var i,a,l,c,p=t.dispatch("beforesend","progress","load","error"),d=n.map(),f=new XMLHttpRequest,m=0;return"undefined"==typeof XDomainRequest||"withCredentials"in f||!/^(http(s)?:)?\/\//.test(e)||(f=new XDomainRequest),"onload"in f?f.onload=f.onerror=f.ontimeout=o:f.onreadystatechange=function(e){f.readyState>3&&o(e)},f.onprogress=function(e){p.call("progress",i,e)},i={header:function(e,n){return e=(e+"").toLowerCase(),arguments.length<2?d.get(e):(null==n?d.remove(e):d.set(e,n+""),i)},mimeType:function(e){return arguments.length?(a=null==e?null:e+"",i):a},responseType:function(e){return arguments.length?(c=e,i):c},timeout:function(e){return arguments.length?(m=+e,i):m},response:function(e){return l=e,i},get:function(e,n){return i.send("GET",e,n)},post:function(e,n){return i.send("POST",e,n)},send:function(n,t,r){return r||"function"!=typeof t||(r=t,t=null),r&&1===r.length&&(r=u(r)),f.open(n,e,!0),null==a||d.has("accept")||d.set("accept",a+",*/*"),f.setRequestHeader&&d.each(function(e,n){f.setRequestHeader(n,e)}),null!=a&&f.overrideMimeType&&f.overrideMimeType(a),null!=c&&(f.responseType=c),m>0&&(f.timeout=m),r&&i.on("error",r).on("load",function(e){r(null,e)}),p.call("beforesend",i,f),f.send(null==t?null:t),i},abort:function(){return f.abort(),i},on:function(){var e=p.on.apply(p,arguments);return e===p?i:e}},r?i.get(r):i}function u(e){return function(n,t){e(null==n?t:null)}}function s(e){var n=e.responseType;return n&&"text"!==n?e.response:e.responseText}function i(e,n){return function(t,r){var u=o(t).mimeType(e).response(n);return r?u.get(r):u}}function a(e,n){return function(t,r,u){arguments.length<3&&(u=r,r=null);var s=o(t).mimeType(e);return s.row=function(e){return arguments.length?s.response(l(n,r=e)):r},s.row(r),u?s.get(u):s}}function l(e,n){return function(t){return e(t.responseText,n)}}var c=i("text/html",function(e){return document.createRange().createContextualFragment(e.responseText)}),p=i("application/json",function(e){return JSON.parse(e.responseText)}),d=i("text/plain",function(e){return e.responseText}),f=i("application/xml",function(e){var n=e.responseXML;if(!n)throw new Error("parse error");return n}),m=a("text/csv",r.csvParse),g=a("text/tab-separated-values",r.tsvParse),h="0.4.3";e.version=h,e.request=o,e.html=c,e.json=p,e.text=d,e.xml=f,e.csv=m,e.tsv=g}); |
{ | ||
"name": "d3-request", | ||
"version": "0.4.2", | ||
"version": "0.4.3", | ||
"description": "A convenient alternative to XMLHttpRequest.", | ||
@@ -17,3 +17,4 @@ "keywords": [ | ||
}, | ||
"main": "build/d3-request.js", | ||
"main": "build/d3-request.node.js", | ||
"browser": "build/d3-request.js", | ||
"jsnext:main": "index.js", | ||
@@ -25,3 +26,3 @@ "repository": { | ||
"scripts": { | ||
"pretest": "mkdir -p build && node -e 'process.stdout.write(\"var version = \\\"\" + require(\"./package.json\").version + \"\\\"; export * from \\\"../index\\\"; export {version};\");' > build/bundle.js && rollup -f umd -g d3-collection:d3_collection,d3-dispatch:d3_dispatch,d3-dsv:d3_dsv -n d3_request -o build/d3-request.js -- build/bundle.js", | ||
"pretest": "mkdir -p build && node -e 'process.stdout.write(\"var version = \\\"\" + require(\"./package.json\").version + \"\\\"; export * from \\\"../index\\\"; export {version};\");' > build/bundle.js && rollup -f umd -g d3-collection:d3_collection,d3-dispatch:d3_dispatch,d3-dsv:d3_dsv -n d3_request -o build/d3-request.js -- build/bundle.js && echo \"'use strict';\n\nvar XMLHttpRequest = require('xmlhttprequest').XMLHttpRequest;\" > build/d3-request.node.js && rollup -f cjs -g d3-collection:d3_collection,d3-dispatch:d3_dispatch,d3-dsv:d3_dsv -- build/bundle.js | tail -n+3 >> build/d3-request.node.js", | ||
"test": "faucet `find test -name '*-test.js'` && eslint index.js src", | ||
@@ -34,3 +35,4 @@ "prepublish": "npm run test && uglifyjs build/d3-request.js -c -m -o build/d3-request.min.js && rm -f build/d3-request.zip && zip -j build/d3-request.zip -- LICENSE README.md build/d3-request.js build/d3-request.min.js", | ||
"d3-dispatch": "~0.4.0", | ||
"d3-dsv": "~0.2.0" | ||
"d3-dsv": "~0.2.0", | ||
"xmlhttprequest": "1" | ||
}, | ||
@@ -37,0 +39,0 @@ "devDependencies": { |
@@ -33,3 +33,3 @@ # d3-request | ||
If you use NPM, `npm install d3-request`. Otherwise, download the [latest release](https://github.com/d3/d3-request/releases/latest). The released bundle supports AMD, CommonJS, and vanilla environments. (Note that Node is not supported, as this module requires XMLHttpRequest.) Create a custom build using [Rollup](https://github.com/rollup/rollup) or your preferred bundler. You can also load directly from [d3js.org](https://d3js.org): | ||
If you use NPM, `npm install d3-request`. Otherwise, download the [latest release](https://github.com/d3/d3-request/releases/latest). The released bundle supports AMD, CommonJS, and vanilla environments. (Node requires [xmlhttprequest](https://www.npmjs.com/package/xmlhttprequest); as such, [html](#html) and [xml](#xml) are not supported on Node.) Create a custom build using [Rollup](https://github.com/rollup/rollup) or your preferred bundler. You can also load directly from [d3js.org](https://d3js.org): | ||
@@ -36,0 +36,0 @@ ```html |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
36726
19
508
4
+ Addedxmlhttprequest@1
+ Addedxmlhttprequest@1.8.0(transitive)