Socket
Socket
Sign inDemoInstall

vega-util

Package Overview
Dependencies
Maintainers
1
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vega-util - npm Package Compare versions

Comparing version 1.15.0 to 1.15.1

53

build/vega-util.js

@@ -44,6 +44,7 @@ (function (global, factory) {

function splitAccessPath(p) {
let path = [],
q = null,
const path = [],
n = p.length;
let q = null,
b = 0,
n = p.length,
s = '',

@@ -118,11 +119,11 @@ i, j, c;

const identity = accessor(function(_) { return _; }, [], 'identity');
const identity = accessor(_ => _, [], 'identity');
const zero = accessor(function() { return 0; }, [], 'zero');
const zero = accessor(() => 0, [], 'zero');
const one = accessor(function() { return 1; }, [], 'one');
const one = accessor(() => 1, [], 'one');
const truthy = accessor(function() { return true; }, [], 'true');
const truthy = accessor(() => true, [], 'true');
const falsy = accessor(function() { return false; }, [], 'false');
const falsy = accessor(() => false, [], 'false');

@@ -472,5 +473,4 @@ function log(method, level, input) {

function extentIndex(array, f) {
let i = -1,
n = array.length,
a, b, c, u, v;
const n = array.length;
let i = -1, a, b, c, u, v;

@@ -538,3 +538,2 @@ if (f == null) {

let obj = {},
map,
test;

@@ -546,3 +545,3 @@

map = {
const map = {
size: 0,

@@ -584,7 +583,6 @@ empty: 0,

clean() {
let next = {},
size = 0,
key, value;
for (key in obj) {
value = obj[key];
const next = {};
let size = 0;
for (const key in obj) {
const value = obj[key];
if (value !== NULL && (!test || !test(value))) {

@@ -601,3 +599,3 @@ next[key] = value;

if (input) Object.keys(input).forEach(function(key) {
if (input) Object.keys(input).forEach(key => {
map.set(key, input[key]);

@@ -612,6 +610,6 @@ });

const t = +threshold;
let a = range[0],
b = peek(range),
t = +threshold,
l, r;
l;

@@ -625,3 +623,3 @@ // swap endpoints if range is reversed

l = Math.abs(value - a);
r = Math.abs(b - value);
const r = Math.abs(b - value);

@@ -757,4 +755,4 @@ // adjust if value is within threshold distance of endpoint

let merged = output || new array0.constructor(n0 + n1),
i0 = 0, i1 = 0, i = 0;
const merged = output || new array0.constructor(n0 + n1);
let i0 = 0, i1 = 0, i = 0;

@@ -850,5 +848,6 @@ for (; i0<n0 && i1<n1; ++i) {

if (filter) {
let i = 0, n = array.length, t;
for (; i<n; ++i) {
if (t = filter(array[i])) visitor(t, i, array);
const n = array.length;
for (let i = 0; i < n; ++i) {
const t = filter(array[i]);
if (t) visitor(t, i, array);
}

@@ -855,0 +854,0 @@ } else {

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

!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((n="undefined"!=typeof globalThis?globalThis:n||self).vega={})}(this,(function(n){"use strict";function t(n,t,e){return n.fields=t||[],n.fname=e,n}function e(n){return null==n?null:n.fields}function r(n){return 1===n.length?o(n[0]):u(n)}const o=n=>function(t){return t[n]},u=n=>{const t=n.length;return function(e){for(let r=0;r<t;++r)e=e[n[r]];return e}};function i(n){throw Error(n)}function l(n){let t,e,r,o=[],u=null,l=0,c=n.length,f="";function s(){o.push(f+n.substring(t,e)),f="",t=e+1}for(n+="",t=e=0;e<c;++e)if(r=n[e],"\\"===r)f+=n.substring(t,e),f+=n.substring(++e,++e),t=e;else if(r===u)s(),u=null,l=-1;else{if(u)continue;t===l&&'"'===r||t===l&&"'"===r?(t=e+1,u=r):"."!==r||l?"["===r?(e>t&&s(),l=t=e+1):"]"===r&&(l||i("Access path missing open bracket: "+n),l>0&&s(),l=0,t=e+1):e>t?s():t=e+1}return l&&i("Access path missing closing bracket: "+n),u&&i("Access path missing closing quote: "+n),e>t&&(e++,s()),o}function c(n,e,o){const u=l(n);return n=1===u.length?u[0]:n,t((o&&o.get||r)(u),[n],e||n)}const f=c("id"),s=t((function(n){return n}),[],"identity"),a=t((function(){return 0}),[],"zero"),g=t((function(){return 1}),[],"one"),h=t((function(){return!0}),[],"true"),p=t((function(){return!1}),[],"false");function y(n,t,e){const r=[t].concat([].slice.call(e));console[n].apply(console,r)}var m=Array.isArray;function b(n){return n===Object(n)}const d=n=>"__proto__"!==n;function M(n,t,e,r){if(!d(t))return;let o,u;if(b(e)&&!m(e))for(o in u=b(n[t])?n[t]:n[t]={},e)r&&(!0===r||r[o])?M(u,o,e[o]):d(o)&&(u[o]=e[o]);else n[t]=e}function j(n,t){if(null==n)return t;const e={},r=[];function o(n){e[n.name]||(e[n.name]=1,r.push(n))}return t.forEach(o),n.forEach(o),r}function O(n){return n[n.length-1]}function w(n){return null==n||""===n?null:+n}const x=n=>t=>n*Math.exp(t),E=n=>t=>Math.log(n*t),z=n=>t=>Math.sign(t)*Math.log1p(Math.abs(t/n)),v=n=>t=>Math.sign(t)*Math.expm1(Math.abs(t))*n,D=n=>t=>t<0?-Math.pow(-t,n):Math.pow(t,n);function k(n,t,e,r){const o=e(n[0]),u=e(O(n)),i=(u-o)*t;return[r(o-i),r(u-i)]}function A(n,t,e,r,o){const u=r(n[0]),i=r(O(n)),l=null!=t?r(t):(u+i)/2;return[o(l+(u-l)*e),o(l+(i-l)*e)]}function S(n){return null!=n?m(n)?n:[n]:[]}function N(n){return"function"==typeof n}const R=(n,t)=>(n<t||null==n)&&null!=t?-1:(n>t||null==t)&&null!=n?1:(t=t instanceof Date?+t:t,(n=n instanceof Date?+n:n)!==n&&t==t?-1:t!=t&&n==n?1:0),P=(n,t)=>1===n.length?_(n[0],t[0]):T(n,t,n.length),_=(n,t)=>function(e,r){return R(n(e),n(r))*t},T=(n,t,e)=>(t.push(0),function(r,o){let u,i=0,l=-1;for(;0===i&&++l<e;)u=n[l],i=R(u(r),u(o));return i*t[l]});function C(n){for(let t,e,r=1,o=arguments.length;r<o;++r)for(e in t=arguments[r],t)n[e]=t[e];return n}const L=Object.prototype.hasOwnProperty;function q(n,t){return L.call(n,t)}const B={};function F(n){return"[object Date]"===Object.prototype.toString.call(n)}function I(n){return"number"==typeof n}function U(n){return"string"==typeof n}function W(n,t){let e="";for(;--t>=0;)e+=n;return e}const G=n=>I(n)||F(n)?n:Date.parse(n);n.Debug=4,n.Error=1,n.Info=3,n.None=0,n.Warn=2,n.accessor=t,n.accessorFields=e,n.accessorName=function(n){return null==n?null:n.fname},n.array=S,n.ascending=R,n.clampRange=function(n,t,e){let r,o=n[0],u=n[1];return u<o&&(r=u,u=o,o=r),r=u-o,r>=e-t?[t,e]:[o=Math.min(Math.max(o,t),e-r),o+r]},n.compare=function(n,r,o){o=o||{},r=S(r)||[];const u=[],i=[],l={},f=o.comparator||P;return S(n).forEach((n,t)=>{null!=n&&(u.push("descending"===r[t]?-1:1),i.push(n=N(n)?n:c(n,null,o)),(e(n)||[]).forEach(n=>l[n]=1))}),0===i.length?null:t(f(i,u),Object.keys(l))},n.constant=function(n){return N(n)?n:()=>n},n.debounce=function(n,t){let e;return r=>{e&&clearTimeout(e),e=setTimeout(()=>(t(r),e=null),n)}},n.error=i,n.extend=C,n.extent=function(n,t){let e,r,o,u,i=0;if(n&&(e=n.length))if(null==t){for(r=n[i];i<e&&(null==r||r!=r);r=n[++i]);for(o=u=r;i<e;++i)r=n[i],null!=r&&(r<o&&(o=r),r>u&&(u=r))}else{for(r=t(n[i]);i<e&&(null==r||r!=r);r=t(n[++i]));for(o=u=r;i<e;++i)r=t(n[i]),null!=r&&(r<o&&(o=r),r>u&&(u=r))}return[o,u]},n.extentIndex=function(n,t){let e,r,o,u,i,l=-1,c=n.length;if(null==t){for(;++l<c;)if(r=n[l],null!=r&&r>=r){e=o=r;break}if(l===c)return[-1,-1];for(u=i=l;++l<c;)r=n[l],null!=r&&(e>r&&(e=r,u=l),o<r&&(o=r,i=l))}else{for(;++l<c;)if(r=t(n[l],l,n),null!=r&&r>=r){e=o=r;break}if(l===c)return[-1,-1];for(u=i=l;++l<c;)r=t(n[l],l,n),null!=r&&(e>r&&(e=r,u=l),o<r&&(o=r,i=l))}return[u,i]},n.falsy=p,n.fastmap=function(n){let t,e,r={};function o(n){return q(r,n)&&r[n]!==B}return t={size:0,empty:0,object:r,has:o,get:n=>o(n)?r[n]:void 0,set(n,e){return o(n)||(++t.size,r[n]===B&&--t.empty),r[n]=e,this},delete(n){return o(n)&&(--t.size,++t.empty,r[n]=B),this},clear(){t.size=t.empty=0,t.object=r={}},test(n){return arguments.length?(e=n,t):e},clean(){let n,o,u={},i=0;for(n in r)o=r[n],o===B||e&&e(o)||(u[n]=o,++i);t.size=i,t.empty=0,t.object=r=u}},n&&Object.keys(n).forEach((function(e){t.set(e,n[e])})),t},n.field=c,n.flush=function(n,t,e,r,o,u){if(!e&&0!==e)return u;let i,l,c=n[0],f=O(n),s=+e;return f<c&&(i=c,c=f,f=i),i=Math.abs(t-c),l=Math.abs(f-t),i<l&&i<=s?r:l<=s?o:u},n.hasOwnProperty=q,n.id=f,n.identity=s,n.inherits=function(n,t,e){const r=n.prototype=Object.create(t.prototype);return r.constructor=n,C(r,e)},n.inrange=function(n,t,e,r){let o,u=t[0],i=t[t.length-1];return u>i&&(o=u,u=i,i=o),r=void 0===r||r,((e=void 0===e||e)?u<=n:u<n)&&(r?n<=i:n<i)},n.isArray=m,n.isBoolean=function(n){return"boolean"==typeof n},n.isDate=F,n.isFunction=N,n.isNumber=I,n.isObject=b,n.isRegExp=function(n){return"[object RegExp]"===Object.prototype.toString.call(n)},n.isString=U,n.key=function(n,e,o){n&&(n=e?S(n).map(n=>n.replace(/\\(.)/g,"$1")):S(n));const u=n&&n.length,i=o&&o.get||r,c=n=>i(e?[n]:l(n));let f;if(u)if(1===u){const t=c(n[0]);f=function(n){return""+t(n)}}else{const t=n.map(c);f=function(n){let e=""+t[0](n),r=0;for(;++r<u;)e+="|"+t[r](n);return e}}else f=function(){return""};return t(f,n,"key")},n.lerp=function(n,t){const e=n[0],r=O(n),o=+t;return o?1===o?r:e+o*(r-e):e},n.logger=function(n,t){let e=n||0;return{level(n){return arguments.length?(e=+n,this):e},error(){return e>=1&&y(t||"error","ERROR",arguments),this},warn(){return e>=2&&y(t||"warn","WARN",arguments),this},info(){return e>=3&&y(t||"log","INFO",arguments),this},debug(){return e>=4&&y(t||"log","DEBUG",arguments),this}}},n.lruCache=function(n){let t,e,r;n=+n||1e4;const o=()=>{t={},e={},r=0},u=(o,u)=>(++r>n&&(e=t,t={},r=1),t[o]=u);return o(),{clear:o,has:n=>q(t,n)||q(e,n),get:n=>q(t,n)?t[n]:q(e,n)?u(n,e[n]):void 0,set:(n,e)=>q(t,n)?t[n]=e:u(n,e)}},n.merge=function(n,t,e,r){const o=t.length,u=e.length;if(!u)return t;if(!o)return e;let i=r||new t.constructor(o+u),l=0,c=0,f=0;for(;l<o&&c<u;++f)i[f]=n(t[l],e[c])>0?e[c++]:t[l++];for(;l<o;++l,++f)i[f]=t[l];for(;c<u;++c,++f)i[f]=e[c];return i},n.mergeConfig=function(...n){return n.reduce((n,t)=>{for(const e in t)if("signals"===e)n.signals=j(n.signals,t.signals);else{const r="legend"===e?{layout:1}:"style"===e||null;M(n,e,t[e],r)}return n},{})},n.one=g,n.pad=function(n,t,e,r){const o=e||" ",u=n+"",i=t-u.length;return i<=0?u:"left"===r?W(o,i)+u:"center"===r?W(o,~~(i/2))+u+W(o,Math.ceil(i/2)):u+W(o,i)},n.panLinear=function(n,t){return k(n,t,w,s)},n.panLog=function(n,t){var e=Math.sign(n[0]);return k(n,t,E(e),x(e))},n.panPow=function(n,t,e){return k(n,t,D(e),D(1/e))},n.panSymlog=function(n,t,e){return k(n,t,z(e),v(e))},n.peek=O,n.quarter=function(n){return 1+~~(new Date(n).getMonth()/3)},n.repeat=W,n.span=function(n){return n&&O(n)-n[0]||0},n.splitAccessPath=l,n.stringValue=function n(t){return m(t)?"["+t.map(n)+"]":b(t)||U(t)?JSON.stringify(t).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):t},n.toBoolean=function(n){return null==n||""===n?null:!(!n||"false"===n||"0"===n)&&!!n},n.toDate=function(n,t){return t=t||G,null==n||""===n?null:t(n)},n.toNumber=w,n.toSet=function(n){const t={},e=n.length;for(let r=0;r<e;++r)t[n[r]]=!0;return t},n.toString=function(n){return null==n||""===n?null:n+""},n.truncate=function(n,t,e,r){const o=null!=r?r:"…",u=n+"",i=u.length,l=Math.max(0,t-o.length);return i<=t?u:"left"===e?o+u.slice(i-l):"center"===e?u.slice(0,Math.ceil(l/2))+o+u.slice(i-~~(l/2)):u.slice(0,l)+o},n.truthy=h,n.utcquarter=function(n){return 1+~~(new Date(n).getUTCMonth()/3)},n.visitArray=function(n,t,e){if(n)if(t){let r,o=0,u=n.length;for(;o<u;++o)(r=t(n[o]))&&e(r,o,n)}else n.forEach(e)},n.writeConfig=M,n.zero=a,n.zoomLinear=function(n,t,e){return A(n,t,e,w,s)},n.zoomLog=function(n,t,e){const r=Math.sign(n[0]);return A(n,t,e,E(r),x(r))},n.zoomPow=function(n,t,e,r){return A(n,t,e,D(r),D(1/r))},n.zoomSymlog=function(n,t,e,r){return A(n,t,e,z(r),v(r))},Object.defineProperty(n,"__esModule",{value:!0})}));
!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((n="undefined"!=typeof globalThis?globalThis:n||self).vega={})}(this,(function(n){"use strict";function t(n,t,e){return n.fields=t||[],n.fname=e,n}function e(n){return null==n?null:n.fields}function r(n){return 1===n.length?o(n[0]):u(n)}const o=n=>function(t){return t[n]},u=n=>{const t=n.length;return function(e){for(let r=0;r<t;++r)e=e[n[r]];return e}};function i(n){throw Error(n)}function c(n){const t=[],e=n.length;let r,o,u,c=null,l=0,s="";function f(){t.push(s+n.substring(r,o)),s="",r=o+1}for(n+="",r=o=0;o<e;++o)if(u=n[o],"\\"===u)s+=n.substring(r,o),s+=n.substring(++o,++o),r=o;else if(u===c)f(),c=null,l=-1;else{if(c)continue;r===l&&'"'===u||r===l&&"'"===u?(r=o+1,c=u):"."!==u||l?"["===u?(o>r&&f(),l=r=o+1):"]"===u&&(l||i("Access path missing open bracket: "+n),l>0&&f(),l=0,r=o+1):o>r?f():r=o+1}return l&&i("Access path missing closing bracket: "+n),c&&i("Access path missing closing quote: "+n),o>r&&(o++,f()),t}function l(n,e,o){const u=c(n);return n=1===u.length?u[0]:n,t((o&&o.get||r)(u),[n],e||n)}const s=l("id"),f=t(n=>n,[],"identity"),a=t(()=>0,[],"zero"),g=t(()=>1,[],"one"),h=t(()=>!0,[],"true"),p=t(()=>!1,[],"false");function y(n,t,e){const r=[t].concat([].slice.call(e));console[n].apply(console,r)}var m=Array.isArray;function b(n){return n===Object(n)}const d=n=>"__proto__"!==n;function M(n,t,e,r){if(!d(t))return;let o,u;if(b(e)&&!m(e))for(o in u=b(n[t])?n[t]:n[t]={},e)r&&(!0===r||r[o])?M(u,o,e[o]):d(o)&&(u[o]=e[o]);else n[t]=e}function j(n,t){if(null==n)return t;const e={},r=[];function o(n){e[n.name]||(e[n.name]=1,r.push(n))}return t.forEach(o),n.forEach(o),r}function O(n){return n[n.length-1]}function w(n){return null==n||""===n?null:+n}const x=n=>t=>n*Math.exp(t),E=n=>t=>Math.log(n*t),z=n=>t=>Math.sign(t)*Math.log1p(Math.abs(t/n)),v=n=>t=>Math.sign(t)*Math.expm1(Math.abs(t))*n,D=n=>t=>t<0?-Math.pow(-t,n):Math.pow(t,n);function k(n,t,e,r){const o=e(n[0]),u=e(O(n)),i=(u-o)*t;return[r(o-i),r(u-i)]}function A(n,t,e,r,o){const u=r(n[0]),i=r(O(n)),c=null!=t?r(t):(u+i)/2;return[o(c+(u-c)*e),o(c+(i-c)*e)]}function S(n){return null!=n?m(n)?n:[n]:[]}function N(n){return"function"==typeof n}const R=(n,t)=>(n<t||null==n)&&null!=t?-1:(n>t||null==t)&&null!=n?1:(t=t instanceof Date?+t:t,(n=n instanceof Date?+n:n)!==n&&t==t?-1:t!=t&&n==n?1:0),P=(n,t)=>1===n.length?_(n[0],t[0]):T(n,t,n.length),_=(n,t)=>function(e,r){return R(n(e),n(r))*t},T=(n,t,e)=>(t.push(0),function(r,o){let u,i=0,c=-1;for(;0===i&&++c<e;)u=n[c],i=R(u(r),u(o));return i*t[c]});function C(n){for(let t,e,r=1,o=arguments.length;r<o;++r)for(e in t=arguments[r],t)n[e]=t[e];return n}const L=Object.prototype.hasOwnProperty;function q(n,t){return L.call(n,t)}const B={};function F(n){return"[object Date]"===Object.prototype.toString.call(n)}function I(n){return"number"==typeof n}function U(n){return"string"==typeof n}function W(n,t){let e="";for(;--t>=0;)e+=n;return e}const G=n=>I(n)||F(n)?n:Date.parse(n);n.Debug=4,n.Error=1,n.Info=3,n.None=0,n.Warn=2,n.accessor=t,n.accessorFields=e,n.accessorName=function(n){return null==n?null:n.fname},n.array=S,n.ascending=R,n.clampRange=function(n,t,e){let r,o=n[0],u=n[1];return u<o&&(r=u,u=o,o=r),r=u-o,r>=e-t?[t,e]:[o=Math.min(Math.max(o,t),e-r),o+r]},n.compare=function(n,r,o){o=o||{},r=S(r)||[];const u=[],i=[],c={},s=o.comparator||P;return S(n).forEach((n,t)=>{null!=n&&(u.push("descending"===r[t]?-1:1),i.push(n=N(n)?n:l(n,null,o)),(e(n)||[]).forEach(n=>c[n]=1))}),0===i.length?null:t(s(i,u),Object.keys(c))},n.constant=function(n){return N(n)?n:()=>n},n.debounce=function(n,t){let e;return r=>{e&&clearTimeout(e),e=setTimeout(()=>(t(r),e=null),n)}},n.error=i,n.extend=C,n.extent=function(n,t){let e,r,o,u,i=0;if(n&&(e=n.length))if(null==t){for(r=n[i];i<e&&(null==r||r!=r);r=n[++i]);for(o=u=r;i<e;++i)r=n[i],null!=r&&(r<o&&(o=r),r>u&&(u=r))}else{for(r=t(n[i]);i<e&&(null==r||r!=r);r=t(n[++i]));for(o=u=r;i<e;++i)r=t(n[i]),null!=r&&(r<o&&(o=r),r>u&&(u=r))}return[o,u]},n.extentIndex=function(n,t){const e=n.length;let r,o,u,i,c,l=-1;if(null==t){for(;++l<e;)if(o=n[l],null!=o&&o>=o){r=u=o;break}if(l===e)return[-1,-1];for(i=c=l;++l<e;)o=n[l],null!=o&&(r>o&&(r=o,i=l),u<o&&(u=o,c=l))}else{for(;++l<e;)if(o=t(n[l],l,n),null!=o&&o>=o){r=u=o;break}if(l===e)return[-1,-1];for(i=c=l;++l<e;)o=t(n[l],l,n),null!=o&&(r>o&&(r=o,i=l),u<o&&(u=o,c=l))}return[i,c]},n.falsy=p,n.fastmap=function(n){let t,e={};function r(n){return q(e,n)&&e[n]!==B}const o={size:0,empty:0,object:e,has:r,get:n=>r(n)?e[n]:void 0,set(n,t){return r(n)||(++o.size,e[n]===B&&--o.empty),e[n]=t,this},delete(n){return r(n)&&(--o.size,++o.empty,e[n]=B),this},clear(){o.size=o.empty=0,o.object=e={}},test(n){return arguments.length?(t=n,o):t},clean(){const n={};let r=0;for(const o in e){const u=e[o];u===B||t&&t(u)||(n[o]=u,++r)}o.size=r,o.empty=0,o.object=e=n}};return n&&Object.keys(n).forEach(t=>{o.set(t,n[t])}),o},n.field=l,n.flush=function(n,t,e,r,o,u){if(!e&&0!==e)return u;const i=+e;let c,l=n[0],s=O(n);s<l&&(c=l,l=s,s=c),c=Math.abs(t-l);const f=Math.abs(s-t);return c<f&&c<=i?r:f<=i?o:u},n.hasOwnProperty=q,n.id=s,n.identity=f,n.inherits=function(n,t,e){const r=n.prototype=Object.create(t.prototype);return r.constructor=n,C(r,e)},n.inrange=function(n,t,e,r){let o,u=t[0],i=t[t.length-1];return u>i&&(o=u,u=i,i=o),r=void 0===r||r,((e=void 0===e||e)?u<=n:u<n)&&(r?n<=i:n<i)},n.isArray=m,n.isBoolean=function(n){return"boolean"==typeof n},n.isDate=F,n.isFunction=N,n.isNumber=I,n.isObject=b,n.isRegExp=function(n){return"[object RegExp]"===Object.prototype.toString.call(n)},n.isString=U,n.key=function(n,e,o){n&&(n=e?S(n).map(n=>n.replace(/\\(.)/g,"$1")):S(n));const u=n&&n.length,i=o&&o.get||r,l=n=>i(e?[n]:c(n));let s;if(u)if(1===u){const t=l(n[0]);s=function(n){return""+t(n)}}else{const t=n.map(l);s=function(n){let e=""+t[0](n),r=0;for(;++r<u;)e+="|"+t[r](n);return e}}else s=function(){return""};return t(s,n,"key")},n.lerp=function(n,t){const e=n[0],r=O(n),o=+t;return o?1===o?r:e+o*(r-e):e},n.logger=function(n,t){let e=n||0;return{level(n){return arguments.length?(e=+n,this):e},error(){return e>=1&&y(t||"error","ERROR",arguments),this},warn(){return e>=2&&y(t||"warn","WARN",arguments),this},info(){return e>=3&&y(t||"log","INFO",arguments),this},debug(){return e>=4&&y(t||"log","DEBUG",arguments),this}}},n.lruCache=function(n){let t,e,r;n=+n||1e4;const o=()=>{t={},e={},r=0},u=(o,u)=>(++r>n&&(e=t,t={},r=1),t[o]=u);return o(),{clear:o,has:n=>q(t,n)||q(e,n),get:n=>q(t,n)?t[n]:q(e,n)?u(n,e[n]):void 0,set:(n,e)=>q(t,n)?t[n]=e:u(n,e)}},n.merge=function(n,t,e,r){const o=t.length,u=e.length;if(!u)return t;if(!o)return e;const i=r||new t.constructor(o+u);let c=0,l=0,s=0;for(;c<o&&l<u;++s)i[s]=n(t[c],e[l])>0?e[l++]:t[c++];for(;c<o;++c,++s)i[s]=t[c];for(;l<u;++l,++s)i[s]=e[l];return i},n.mergeConfig=function(...n){return n.reduce((n,t)=>{for(const e in t)if("signals"===e)n.signals=j(n.signals,t.signals);else{const r="legend"===e?{layout:1}:"style"===e||null;M(n,e,t[e],r)}return n},{})},n.one=g,n.pad=function(n,t,e,r){const o=e||" ",u=n+"",i=t-u.length;return i<=0?u:"left"===r?W(o,i)+u:"center"===r?W(o,~~(i/2))+u+W(o,Math.ceil(i/2)):u+W(o,i)},n.panLinear=function(n,t){return k(n,t,w,f)},n.panLog=function(n,t){var e=Math.sign(n[0]);return k(n,t,E(e),x(e))},n.panPow=function(n,t,e){return k(n,t,D(e),D(1/e))},n.panSymlog=function(n,t,e){return k(n,t,z(e),v(e))},n.peek=O,n.quarter=function(n){return 1+~~(new Date(n).getMonth()/3)},n.repeat=W,n.span=function(n){return n&&O(n)-n[0]||0},n.splitAccessPath=c,n.stringValue=function n(t){return m(t)?"["+t.map(n)+"]":b(t)||U(t)?JSON.stringify(t).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):t},n.toBoolean=function(n){return null==n||""===n?null:!(!n||"false"===n||"0"===n)&&!!n},n.toDate=function(n,t){return t=t||G,null==n||""===n?null:t(n)},n.toNumber=w,n.toSet=function(n){const t={},e=n.length;for(let r=0;r<e;++r)t[n[r]]=!0;return t},n.toString=function(n){return null==n||""===n?null:n+""},n.truncate=function(n,t,e,r){const o=null!=r?r:"…",u=n+"",i=u.length,c=Math.max(0,t-o.length);return i<=t?u:"left"===e?o+u.slice(i-c):"center"===e?u.slice(0,Math.ceil(c/2))+o+u.slice(i-~~(c/2)):u.slice(0,c)+o},n.truthy=h,n.utcquarter=function(n){return 1+~~(new Date(n).getUTCMonth()/3)},n.visitArray=function(n,t,e){if(n)if(t){const r=n.length;for(let o=0;o<r;++o){const r=t(n[o]);r&&e(r,o,n)}}else n.forEach(e)},n.writeConfig=M,n.zero=a,n.zoomLinear=function(n,t,e){return A(n,t,e,w,f)},n.zoomLog=function(n,t,e){const r=Math.sign(n[0]);return A(n,t,e,E(r),x(r))},n.zoomPow=function(n,t,e,r){return A(n,t,e,D(r),D(1/r))},n.zoomSymlog=function(n,t,e,r){return A(n,t,e,z(r),v(r))},Object.defineProperty(n,"__esModule",{value:!0})}));
{
"name": "vega-util",
"version": "1.15.0",
"version": "1.15.1",
"description": "JavaScript utilities for Vega.",

@@ -25,3 +25,3 @@ "keywords": [

},
"gitHead": "28db83352e43e321dfe55fc5cb6489b211e45662"
"gitHead": "8d6793f4ca7eaaf2d22186764e9ce2dae687cf52"
}

@@ -6,10 +6,10 @@ import accessor from './accessor';

export const identity = accessor(function(_) { return _; }, [], 'identity');
export const identity = accessor(_ => _, [], 'identity');
export const zero = accessor(function() { return 0; }, [], 'zero');
export const zero = accessor(() => 0, [], 'zero');
export const one = accessor(function() { return 1; }, [], 'one');
export const one = accessor(() => 1, [], 'one');
export const truthy = accessor(function() { return true; }, [], 'true');
export const truthy = accessor(() => true, [], 'true');
export const falsy = accessor(function() { return false; }, [], 'false');
export const falsy = accessor(() => false, [], 'false');
export default function(array, f) {
let i = -1,
n = array.length,
a, b, c, u, v;
const n = array.length;
let i = -1, a, b, c, u, v;

@@ -6,0 +5,0 @@ if (f == null) {

@@ -7,3 +7,2 @@ import hasOwnProperty from './hasOwnProperty';

let obj = {},
map,
test;

@@ -15,3 +14,3 @@

map = {
const map = {
size: 0,

@@ -53,7 +52,6 @@ empty: 0,

clean() {
let next = {},
size = 0,
key, value;
for (key in obj) {
value = obj[key];
const next = {};
let size = 0;
for (const key in obj) {
const value = obj[key];
if (value !== NULL && (!test || !test(value))) {

@@ -70,3 +68,3 @@ next[key] = value;

if (input) Object.keys(input).forEach(function(key) {
if (input) Object.keys(input).forEach(key => {
map.set(key, input[key]);

@@ -73,0 +71,0 @@ });

@@ -6,6 +6,6 @@ import peek from './peek';

const t = +threshold;
let a = range[0],
b = peek(range),
t = +threshold,
l, r;
l;

@@ -19,3 +19,3 @@ // swap endpoints if range is reversed

l = Math.abs(value - a);
r = Math.abs(b - value);
const r = Math.abs(b - value);

@@ -22,0 +22,0 @@ // adjust if value is within threshold distance of endpoint

@@ -8,4 +8,4 @@ export default function(compare, array0, array1, output) {

let merged = output || new array0.constructor(n0 + n1),
i0 = 0, i1 = 0, i = 0;
const merged = output || new array0.constructor(n0 + n1);
let i0 = 0, i1 = 0, i = 0;

@@ -12,0 +12,0 @@ for (; i0<n0 && i1<n1; ++i) {

import error from './error';
export default function(p) {
let path = [],
q = null,
const path = [],
n = p.length;
let q = null,
b = 0,
n = p.length,
s = '',

@@ -9,0 +10,0 @@ i, j, c;

export default function(array, filter, visitor) {
if (array) {
if (filter) {
let i = 0, n = array.length, t;
for (; i<n; ++i) {
if (t = filter(array[i])) visitor(t, i, array);
const n = array.length;
for (let i = 0; i < n; ++i) {
const t = filter(array[i]);
if (t) visitor(t, i, array);
}

@@ -8,0 +9,0 @@ } else {

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