vega-loader
Advanced tools
Comparing version 4.1.1 to 4.1.2
@@ -258,11 +258,11 @@ (function (global, factory) { | ||
function isDate(_) { | ||
return !isNaN(Date.parse(_)); | ||
return !Number.isNaN(Date.parse(_)); | ||
} | ||
function isNumber(_) { | ||
return !isNaN(+_) && !(_ instanceof Date); | ||
return !Number.isNaN(+_) && !(_ instanceof Date); | ||
} | ||
function isInteger(_) { | ||
return isNumber(_) && (_=+_) === ~~_; | ||
return isNumber(_) && Number.isInteger(+_); | ||
} | ||
@@ -269,0 +269,0 @@ |
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vega-util"),require("d3-dsv"),require("topojson-client"),require("d3-time-format")):"function"==typeof define&&define.amd?define(["exports","vega-util","d3-dsv","topojson-client","d3-time-format"],t):t((e=e||self).vega={},e.vega,e.d3,e.topojson,e.d3)}(this,function(e,t,n,r,o){"use strict";const i=/^([A-Za-z]+:)?\/\//,s=/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp|file):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,u=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,f="file://";async function a(e,t){const n=await this.sanitize(e,t),r=n.href;return n.localFile?this.file(r):this.http(r,t)}async function c(e,n){n=t.extend({},this.options,n);const r=this.fileAccess,o={href:null};let a,c,l;const p=s.test(e.replace(u,""));null!=e&&"string"==typeof e&&p||t.error("Sanitize failure, invalid URI: "+t.stringValue(e));const d=i.test(e);return(l=n.baseURL)&&!d&&(e.startsWith("/")||"/"===l[l.length-1]||(e="/"+e),e=l+e),c=(a=e.startsWith(f))||"file"===n.mode||"http"!==n.mode&&!d&&r,a?e=e.slice(f.length):e.startsWith("//")&&("file"===n.defaultProtocol?(e=e.slice(2),c=!0):e=(n.defaultProtocol||"http")+":"+e),Object.defineProperty(o,"localFile",{value:!!c}),o.href=e,n.target&&(o.target=n.target+""),n.rel&&(o.rel=n.rel+""),o}function l(e){return e?function(t){return new Promise(function(n,r){e.readFile(t,function(e,t){e?r(e):n(t)})})}:p}async function p(){t.error("No file system access.")}function d(e){return e?async function(n,r){const o=t.extend({},this.options.http,r),i=r&&r.response,s=await e(n,o);return s.ok?t.isFunction(s[i])?s[i]():s.text():t.error(s.status+""+s.statusText)}:h}async function h(){t.error("No HTTP fetch method available.")}var m={boolean:t.toBoolean,integer:t.toNumber,number:t.toNumber,date:t.toDate,string:t.toString,unknown:t.identity},y=[function(e){return"true"===e||"false"===e||!0===e||!1===e},function(e){return b(e)&&(e=+e)==~~e},b,function(e){return!isNaN(Date.parse(e))}],g=["boolean","integer","number","date"];function v(e,t){if(!e||!e.length)return"unknown";var n,r,o,i,s=0,u=e.length,f=y.length,a=y.map(function(e,t){return t+1});for(r=0,u=e.length;r<u;++r)for(n=t?e[r][t]:e[r],o=0;o<f;++o)if(a[o]&&(null!=(i=n)&&i==i)&&!y[o](n)&&(a[o]=0,++s===y.length))return"string";return s=a.reduce(function(e,t){return 0===e?t:e},0)-1,g[s]}function j(e,t){return t.reduce(function(t,n){return t[n]=v(e,n),t},{})}function b(e){return!(isNaN(+e)||e instanceof Date)}function x(e){const n=function(n,r){const o={delimiter:e};return O(n,r?t.extend(r,o):o)};return n.responseType="text",n}function O(e,r){return r.header&&(e=r.header.map(t.stringValue).join(r.delimiter)+"\n"+e),n.dsvFormat(r.delimiter).parse(e+"")}function N(e,n){const r=n&&n.property?t.field(n.property):t.identity;return!t.isObject(e)||(o=e,"function"==typeof Buffer&&t.isFunction(Buffer.isBuffer)&&Buffer.isBuffer(o))?r(JSON.parse(e)):function(e,t){return t&&t.copy?JSON.parse(JSON.stringify(e)):e}(r(e));var o}O.responseType="text",N.responseType="json";const T={interior:(e,t)=>e!==t,exterior:(e,t)=>e===t};function P(e,n){let o,i,s,u;return e=N(e,n),n&&n.feature?(o=r.feature,s=n.feature):n&&n.mesh?(o=r.mesh,s=n.mesh,u=T[n.filter]):t.error("Missing TopoJSON feature or mesh parameter."),(i=(i=e.objects[s])?o(e,i,u):t.error("Invalid TopoJSON object: "+s))&&i.features||[i]}P.responseType="json";const w={dsv:O,csv:x(","),tsv:x("\t"),json:N,topojson:P};function z(e,n){return arguments.length>1?(w[e]=n,this):t.hasOwnProperty(w,e)?w[e]:null}var S=function(e,t){return function(n){return{options:n||{},sanitize:c,load:a,fileAccess:!!t,file:l(t),http:d(e)}}}("undefined"!=typeof fetch&&fetch,null);e.format=w,e.formats=z,e.inferType=v,e.inferTypes=j,e.loader=S,e.read=function(e,n,r){const i=z((n=n||{}).type||"json");return i||t.error("Unknown data format type: "+n.type),e=i(e,n),n.parse&&function(e,t,n){if(!e.length)return;n=n||o.timeParse;var r,i,s,u,f,a,c,l=e.columns||Object.keys(e[0]);"auto"===t&&(t=j(e,l));for(l=Object.keys(t),r=l.map(function(e){var r,i,s=t[e];if(s&&(0===s.indexOf("date:")||0===s.indexOf("utc:")))return("'"===(i=(r=s.split(/:(.+)?/,2))[1])[0]&&"'"===i[i.length-1]||'"'===i[0]&&'"'===i[i.length-1])&&(i=i.slice(1,-1)),"utc"===r[0]?o.utcParse(i):n(i);if(!m[s])throw Error("Illegal format pattern: "+e+":"+s);return m[s]}),u=0,a=e.length,c=l.length;u<a;++u)for(i=e[u],f=0;f<c;++f)s=l[f],i[s]=r[f](i[s])}(e,n.parse,r),t.hasOwnProperty(e,"columns")&&delete e.columns,e},e.responseType=function(e){const t=z(e);return t&&t.responseType||"text"},e.typeParsers=m,Object.defineProperty(e,"__esModule",{value:!0})}); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vega-util"),require("d3-dsv"),require("topojson-client"),require("d3-time-format")):"function"==typeof define&&define.amd?define(["exports","vega-util","d3-dsv","topojson-client","d3-time-format"],t):t((e=e||self).vega={},e.vega,e.d3,e.topojson,e.d3)}(this,(function(e,t,n,r,o){"use strict";const i=/^([A-Za-z]+:)?\/\//,s=/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp|file):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,u=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,f="file://";async function a(e,t){const n=await this.sanitize(e,t),r=n.href;return n.localFile?this.file(r):this.http(r,t)}async function c(e,n){n=t.extend({},this.options,n);const r=this.fileAccess,o={href:null};let a,c,l;const p=s.test(e.replace(u,""));null!=e&&"string"==typeof e&&p||t.error("Sanitize failure, invalid URI: "+t.stringValue(e));const d=i.test(e);return(l=n.baseURL)&&!d&&(e.startsWith("/")||"/"===l[l.length-1]||(e="/"+e),e=l+e),c=(a=e.startsWith(f))||"file"===n.mode||"http"!==n.mode&&!d&&r,a?e=e.slice(f.length):e.startsWith("//")&&("file"===n.defaultProtocol?(e=e.slice(2),c=!0):e=(n.defaultProtocol||"http")+":"+e),Object.defineProperty(o,"localFile",{value:!!c}),o.href=e,n.target&&(o.target=n.target+""),n.rel&&(o.rel=n.rel+""),o}function l(e){return e?function(t){return new Promise((function(n,r){e.readFile(t,(function(e,t){e?r(e):n(t)}))}))}:p}async function p(){t.error("No file system access.")}function d(e){return e?async function(n,r){const o=t.extend({},this.options.http,r),i=r&&r.response,s=await e(n,o);return s.ok?t.isFunction(s[i])?s[i]():s.text():t.error(s.status+""+s.statusText)}:h}async function h(){t.error("No HTTP fetch method available.")}var m={boolean:t.toBoolean,integer:t.toNumber,number:t.toNumber,date:t.toDate,string:t.toString,unknown:t.identity},y=[function(e){return"true"===e||"false"===e||!0===e||!1===e},function(e){return j(e)&&Number.isInteger(+e)},j,function(e){return!Number.isNaN(Date.parse(e))}],g=["boolean","integer","number","date"];function v(e,t){if(!e||!e.length)return"unknown";var n,r,o,i,s=0,u=e.length,f=y.length,a=y.map((function(e,t){return t+1}));for(r=0,u=e.length;r<u;++r)for(n=t?e[r][t]:e[r],o=0;o<f;++o)if(a[o]&&(null!=(i=n)&&i==i)&&!y[o](n)&&(a[o]=0,++s===y.length))return"string";return s=a.reduce((function(e,t){return 0===e?t:e}),0)-1,g[s]}function b(e,t){return t.reduce((function(t,n){return t[n]=v(e,n),t}),{})}function j(e){return!(Number.isNaN(+e)||e instanceof Date)}function N(e){const n=function(n,r){const o={delimiter:e};return x(n,r?t.extend(r,o):o)};return n.responseType="text",n}function x(e,r){return r.header&&(e=r.header.map(t.stringValue).join(r.delimiter)+"\n"+e),n.dsvFormat(r.delimiter).parse(e+"")}function O(e,n){const r=n&&n.property?t.field(n.property):t.identity;return!t.isObject(e)||(o=e,"function"==typeof Buffer&&t.isFunction(Buffer.isBuffer)&&Buffer.isBuffer(o))?r(JSON.parse(e)):function(e,t){return t&&t.copy?JSON.parse(JSON.stringify(e)):e}(r(e));var o}x.responseType="text",O.responseType="json";const T={interior:(e,t)=>e!==t,exterior:(e,t)=>e===t};function P(e,n){let o,i,s,u;return e=O(e,n),n&&n.feature?(o=r.feature,s=n.feature):n&&n.mesh?(o=r.mesh,s=n.mesh,u=T[n.filter]):t.error("Missing TopoJSON feature or mesh parameter."),(i=(i=e.objects[s])?o(e,i,u):t.error("Invalid TopoJSON object: "+s))&&i.features||[i]}P.responseType="json";const w={dsv:x,csv:N(","),tsv:N("\t"),json:O,topojson:P};function z(e,n){return arguments.length>1?(w[e]=n,this):t.hasOwnProperty(w,e)?w[e]:null}var S=function(e,t){return function(n){return{options:n||{},sanitize:c,load:a,fileAccess:!!t,file:l(t),http:d(e)}}}("undefined"!=typeof fetch&&fetch,null);e.format=w,e.formats=z,e.inferType=v,e.inferTypes=b,e.loader=S,e.read=function(e,n,r){const i=z((n=n||{}).type||"json");return i||t.error("Unknown data format type: "+n.type),e=i(e,n),n.parse&&function(e,t,n){if(!e.length)return;n=n||o.timeParse;var r,i,s,u,f,a,c,l=e.columns||Object.keys(e[0]);"auto"===t&&(t=b(e,l));for(l=Object.keys(t),r=l.map((function(e){var r,i,s=t[e];if(s&&(0===s.indexOf("date:")||0===s.indexOf("utc:")))return("'"===(i=(r=s.split(/:(.+)?/,2))[1])[0]&&"'"===i[i.length-1]||'"'===i[0]&&'"'===i[i.length-1])&&(i=i.slice(1,-1)),"utc"===r[0]?o.utcParse(i):n(i);if(!m[s])throw Error("Illegal format pattern: "+e+":"+s);return m[s]})),u=0,a=e.length,c=l.length;u<a;++u)for(i=e[u],f=0;f<c;++f)s=l[f],i[s]=r[f](i[s])}(e,n.parse,r),t.hasOwnProperty(e,"columns")&&delete e.columns,e},e.responseType=function(e){const t=z(e);return t&&t.responseType||"text"},e.typeParsers=m,Object.defineProperty(e,"__esModule",{value:!0})})); |
@@ -261,11 +261,11 @@ 'use strict'; | ||
function isDate(_) { | ||
return !isNaN(Date.parse(_)); | ||
return !Number.isNaN(Date.parse(_)); | ||
} | ||
function isNumber(_) { | ||
return !isNaN(+_) && !(_ instanceof Date); | ||
return !Number.isNaN(+_) && !(_ instanceof Date); | ||
} | ||
function isInteger(_) { | ||
return isNumber(_) && (_=+_) === ~~_; | ||
return isNumber(_) && Number.isInteger(+_); | ||
} | ||
@@ -272,0 +272,0 @@ |
{ | ||
"name": "vega-loader", | ||
"version": "4.1.1", | ||
"version": "4.1.2", | ||
"description": "Network request and file loading utilities.", | ||
@@ -40,3 +40,3 @@ "keywords": [ | ||
"node-fetch": "^2.6.0", | ||
"topojson-client": "^3.0.0", | ||
"topojson-client": "^3.0.1", | ||
"vega-util": "^1.11.0" | ||
@@ -48,3 +48,3 @@ }, | ||
}, | ||
"gitHead": "b45fc90406ce2de167073b73d4ae5cf79c5e1705" | ||
"gitHead": "b1337d09ced5f517d54c8ec17fdf849651f5c16c" | ||
} |
@@ -67,11 +67,11 @@ import {identity, toBoolean, toDate, toNumber, toString} from 'vega-util'; | ||
function isDate(_) { | ||
return !isNaN(Date.parse(_)); | ||
return !Number.isNaN(Date.parse(_)); | ||
} | ||
function isNumber(_) { | ||
return !isNaN(+_) && !(_ instanceof Date); | ||
return !Number.isNaN(+_) && !(_ instanceof Date); | ||
} | ||
function isInteger(_) { | ||
return isNumber(_) && (_=+_) === ~~_; | ||
return isNumber(_) && Number.isInteger(+_); | ||
} |
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
57130
Updatedtopojson-client@^3.0.1