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

vega-loader

Package Overview
Dependencies
Maintainers
1
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vega-loader - npm Package Compare versions

Comparing version 2.0.0-beta to 2.0.0-beta.1

2

build/vega-loader.js

@@ -263,3 +263,3 @@ (function (global, factory) {

}
return d3Dsv.dsvFormat(format.delimiter).parse(data);
return d3Dsv.dsvFormat(format.delimiter).parse(data+'');
}

@@ -266,0 +266,0 @@

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

!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("vega-util"),require("d3-request"),require("d3-dsv"),require("topojson"),require("d3-time-format")):"function"==typeof define&&define.amd?define(["exports","vega-util","d3-request","d3-dsv","topojson","d3-time-format"],n):n(e.vega=e.vega||{},e.vega,e.d3,e.d3,e.topojson,e.d3)}(this,function(e,n,r,t,o,i){"use strict";function u(e,r){return n.extend({},e.options,r)}function f(e,n){var r=this;return r.sanitize(e,n).then(function(e){return d(e,I)?r.file(e.slice(I.length)):r.http(e,n)})}function s(e,r){return r=u(this,r),new Promise(function(t,o){var i,u,f,s;return null==e||"string"!=typeof e?void o("Sanitize failure, invalid URI: "+n.stringValue(e)):((s=r.baseURL)&&!u&&(d(e,"/")||"/"===s[s.length-1]||(e="/"+e),e=s+e),i=d(e,I),u=B.test(e),f=i||"file"===r.mode||"http"!==r.mode&&!u&&c(),f?e=(i?"":I)+e:d(e,"//")&&(e=(r.defaultProtocol||"http")+":"+e),void t(e))})}function a(e,n){return n=u(this,n),new Promise(function(t,o){var i,u=r.request(e);for(i in n.headers)u.header(i,n.headers[i]);S.forEach(function(e){n[e]&&u[e](n[e])}),u.on("error",function(n){o(n||"Error loading URL: "+e)}).on("load",function(e){var n=e&&e.responseText;e&&0!==e.status?t(n):o(n||"Error")}).get()})}function l(e){return new Promise(function(n,r){var t=c();t?t.readFile(e,function(e,t){e?r(e):n(t)}):r("No file system access for "+e)})}function c(){return"function"==typeof require&&require("fs")}function d(e,n){return null!=e&&0===e.lastIndexOf(n,0)}function p(e,n){var r,t,o,i,u=J.slice();for(t=0,o=e.length;t<o;++t){for(r=n?e[t][n]:e[t],i=0;i<u.length;++i)j(r)&&!u[i](r)&&(u.splice(i,1),--i);if(0===u.length)return"string"}return U[J.indexOf(u[0])]}function m(e,n){return n.reduce(function(n,r){return n[r]=p(e,r),n},{})}function h(e){return null==e||""===e?null:+e}function v(e){return null==e||""===e?null:!(!e||"false"===e)&&!!e}function g(e,n){return null==e||""===e?null:n?n(e):Date.parse(e)}function y(e){return null==e||""===e?null:e+""}function j(e){return null!=e&&e===e}function b(e){return"true"===e||"false"===e||e===!0||e===!1}function O(e){return!isNaN(Date.parse(e))}function q(e){return!(isNaN(+e)||e instanceof Date)}function x(e){return q(e)&&(e=+e)===~~e}function N(e){return function(r,t){var o={delimiter:e};return P(r,t?n.extend(t,o):o)}}function P(e,r){return r.header&&(e=r.header.map(n.stringValue).join(r.delimiter)+"\n"+e),t.dsvFormat(r.delimiter).parse(e)}function w(e){return!("function"!=typeof Buffer||!n.isFunction(Buffer.isBuffer))&&Buffer.isBuffer(e)}function T(e,n,r){r=r||i.timeParse;var t,o,u,f,s,a,l,c=e.columns||Object.keys(e[0]);for("auto"===n&&(n=m(e,c)),c=Object.keys(n),t=c.map(function(e){var t,o,i=n[e];if(i&&0===i.indexOf("date:"))return t=i.split(/:(.+)?/,2),o=t[1],("'"===o[0]&&"'"===o[o.length-1]||'"'===o[0]&&'"'===o[o.length-1])&&(o=o.slice(1,-1)),r(o);if(!E[i])throw Error("Illegal format pattern: "+e+":"+i);return E[i]}),f=0,a=e.length,l=c.length;f<a;++f)for(o=e[f],s=0;s<l;++s)u=c[s],o[u]=t[s](o[u])}var B=/^([A-Za-z]+:)?\/\//,I="file://",S=["mimeType","responseType","user","password"],z=function(e){return{options:e||{},sanitize:s,load:f,file:l,http:a}},E={boolean:v,integer:h,number:h,date:g,string:y},J=[b,x,q,O],U=["boolean","integer","number","date"],k=function(e,r){return e=n.isObject(e)&&!w(e)?e:JSON.parse(e),r&&r.property?n.field(r.property)(e):e},D=function(e,r){var t,i;return e=k(e,r),r&&(i=r.feature)?(t=e.objects[i])?o.feature(e,t).features:n.error("Invalid TopoJSON object: "+i):r&&(i=r.mesh)?(t=e.objects[i])?[o.mesh(e,t)]:n.error("Invalid TopoJSON object: "+i):void n.error("Missing TopoJSON feature or mesh parameter.")},F={dsv:P,csv:N(","),tsv:N("\t"),json:k,topojson:D},R=function(e,n){return arguments.length>1?(F[e]=n,this):F.hasOwnProperty(e)?F[e]:null},L=function(e,r,t){r=r||{};var o=R(r.type||"json");return o||n.error("Unknown data format type: "+r.type),e=o(e,r),r.parse&&T(e,r.parse,t),e.hasOwnProperty("columns")&&delete e.columns,e};e.loader=z,e.read=L,e.inferType=p,e.inferTypes=m,e.typeParsers=E,e.formats=R,Object.defineProperty(e,"__esModule",{value:!0})});
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("vega-util"),require("d3-request"),require("d3-dsv"),require("topojson"),require("d3-time-format")):"function"==typeof define&&define.amd?define(["exports","vega-util","d3-request","d3-dsv","topojson","d3-time-format"],n):n(e.vega=e.vega||{},e.vega,e.d3,e.d3,e.topojson,e.d3)}(this,function(e,n,r,t,o,i){"use strict";function u(e,r){return n.extend({},e.options,r)}function f(e,n){var r=this;return r.sanitize(e,n).then(function(e){return d(e,I)?r.file(e.slice(I.length)):r.http(e,n)})}function s(e,r){return r=u(this,r),new Promise(function(t,o){var i,u,f,s;return null==e||"string"!=typeof e?void o("Sanitize failure, invalid URI: "+n.stringValue(e)):((s=r.baseURL)&&!u&&(d(e,"/")||"/"===s[s.length-1]||(e="/"+e),e=s+e),i=d(e,I),u=B.test(e),f=i||"file"===r.mode||"http"!==r.mode&&!u&&c(),f?e=(i?"":I)+e:d(e,"//")&&(e=(r.defaultProtocol||"http")+":"+e),void t(e))})}function a(e,n){return n=u(this,n),new Promise(function(t,o){var i,u=r.request(e);for(i in n.headers)u.header(i,n.headers[i]);S.forEach(function(e){n[e]&&u[e](n[e])}),u.on("error",function(n){o(n||"Error loading URL: "+e)}).on("load",function(e){var n=e&&e.responseText;e&&0!==e.status?t(n):o(n||"Error")}).get()})}function l(e){return new Promise(function(n,r){var t=c();t?t.readFile(e,function(e,t){e?r(e):n(t)}):r("No file system access for "+e)})}function c(){return"function"==typeof require&&require("fs")}function d(e,n){return null!=e&&0===e.lastIndexOf(n,0)}function p(e,n){var r,t,o,i,u=J.slice();for(t=0,o=e.length;t<o;++t){for(r=n?e[t][n]:e[t],i=0;i<u.length;++i)j(r)&&!u[i](r)&&(u.splice(i,1),--i);if(0===u.length)return"string"}return U[J.indexOf(u[0])]}function m(e,n){return n.reduce(function(n,r){return n[r]=p(e,r),n},{})}function h(e){return null==e||""===e?null:+e}function v(e){return null==e||""===e?null:!(!e||"false"===e)&&!!e}function g(e,n){return null==e||""===e?null:n?n(e):Date.parse(e)}function y(e){return null==e||""===e?null:e+""}function j(e){return null!=e&&e===e}function b(e){return"true"===e||"false"===e||e===!0||e===!1}function O(e){return!isNaN(Date.parse(e))}function q(e){return!(isNaN(+e)||e instanceof Date)}function x(e){return q(e)&&(e=+e)===~~e}function N(e){return function(r,t){var o={delimiter:e};return P(r,t?n.extend(t,o):o)}}function P(e,r){return r.header&&(e=r.header.map(n.stringValue).join(r.delimiter)+"\n"+e),t.dsvFormat(r.delimiter).parse(e+"")}function w(e){return!("function"!=typeof Buffer||!n.isFunction(Buffer.isBuffer))&&Buffer.isBuffer(e)}function T(e,n,r){r=r||i.timeParse;var t,o,u,f,s,a,l,c=e.columns||Object.keys(e[0]);for("auto"===n&&(n=m(e,c)),c=Object.keys(n),t=c.map(function(e){var t,o,i=n[e];if(i&&0===i.indexOf("date:"))return t=i.split(/:(.+)?/,2),o=t[1],("'"===o[0]&&"'"===o[o.length-1]||'"'===o[0]&&'"'===o[o.length-1])&&(o=o.slice(1,-1)),r(o);if(!E[i])throw Error("Illegal format pattern: "+e+":"+i);return E[i]}),f=0,a=e.length,l=c.length;f<a;++f)for(o=e[f],s=0;s<l;++s)u=c[s],o[u]=t[s](o[u])}var B=/^([A-Za-z]+:)?\/\//,I="file://",S=["mimeType","responseType","user","password"],z=function(e){return{options:e||{},sanitize:s,load:f,file:l,http:a}},E={boolean:v,integer:h,number:h,date:g,string:y},J=[b,x,q,O],U=["boolean","integer","number","date"],k=function(e,r){return e=n.isObject(e)&&!w(e)?e:JSON.parse(e),r&&r.property?n.field(r.property)(e):e},D=function(e,r){var t,i;return e=k(e,r),r&&(i=r.feature)?(t=e.objects[i])?o.feature(e,t).features:n.error("Invalid TopoJSON object: "+i):r&&(i=r.mesh)?(t=e.objects[i])?[o.mesh(e,t)]:n.error("Invalid TopoJSON object: "+i):void n.error("Missing TopoJSON feature or mesh parameter.")},F={dsv:P,csv:N(","),tsv:N("\t"),json:k,topojson:D},R=function(e,n){return arguments.length>1?(F[e]=n,this):F.hasOwnProperty(e)?F[e]:null},L=function(e,r,t){r=r||{};var o=R(r.type||"json");return o||n.error("Unknown data format type: "+r.type),e=o(e,r),r.parse&&T(e,r.parse,t),e.hasOwnProperty("columns")&&delete e.columns,e};e.loader=z,e.read=L,e.inferType=p,e.inferTypes=m,e.typeParsers=E,e.formats=R,Object.defineProperty(e,"__esModule",{value:!0})});
{
"name": "vega-loader",
"version": "2.0.0-beta",
"version": "2.0.0-beta.1",
"description": "Network request and file loading utilities.",

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

@@ -17,3 +17,3 @@ import {dsvFormat} from 'd3-dsv';

}
return dsvFormat(format.delimiter).parse(data);
return dsvFormat(format.delimiter).parse(data+'');
}
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