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.3.1 to 1.4.0

11

build/vega-util.js

@@ -136,5 +136,6 @@ (function (global, factory) {

var None = 0;
var Warn = 1;
var Info = 2;
var Debug = 3;
var Error$1 = 1;
var Warn = 2;
var Info = 3;
var Debug = 4;

@@ -152,2 +153,6 @@ var logger = function(_) {

},
error: function() {
if (level >= Error$1) log('error', 'ERROR', arguments);
return this;
},
warn: function() {

@@ -154,0 +159,0 @@ if (level >= Warn) log('warn', 'WARN', arguments);

@@ -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.vega=n.vega||{})}(this,function(n){"use strict";function t(n){return c(n)?"["+n.map(t)+"]":l(n)||f(n)?JSON.stringify(n).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):n}function e(n,t,e){var r=[t].concat([].slice.call(e));console[n].apply(console,r)}function r(n){return x(n)?n:O(n)?n:Date.parse(n)}var u=function(n,t,e){return n.fields=t||[],n.fname=e,n},o=function(n){throw Error(n)},i=function(n){function t(){i.push(a+n.substring(e,r)),a="",e=r+1}var e,r,u,i=[],c=null,l=0,f=n.length,a="";for(n+="",e=r=0;r<f;++r)if("\\"===(u=n[r]))a+=n.substring(e,r),e=++r;else if(u===c)t(),c=null,l=-1;else{if(c)continue;e===l&&'"'===u?(e=r+1,c=u):e===l&&"'"===u?(e=r+1,c=u):"."!==u||l?"["===u?(r>e&&t(),l=e=r+1):"]"===u&&(l||o("Access path missing open bracket: "+n),l>0&&t(),l=0,e=r+1):r>e?t():e=r+1}return l&&o("Access path missing closing bracket: "+n),c&&o("Access path missing closing quote: "+n),r>e&&(r++,t()),i},c=Array.isArray,l=function(n){return n===Object(n)},f=function(n){return"string"==typeof n},a=function(n,e){var r=i(n),o="return _["+r.map(t).join("][")+"];";return u(Function("_",o),[n=1===r.length?r[0]:n],e||n)},s=[],p=a("id"),g=u(function(n){return n},s,"identity"),v=u(function(){return 0},s,"zero"),h=u(function(){return 1},s,"one"),y=u(function(){return!0},s,"true"),b=u(function(){return!1},s,"false"),m=function(n){return null!=n?c(n)?n:[n]:[]},d=function(n){return"function"==typeof n},j={},O=function(n){return"[object Date]"===Object.prototype.toString.call(n)},x=function(n){return"number"==typeof n},A=function(n,t){for(var e="";--t>=0;)e+=n;return e};n.accessor=u,n.accessorName=function(n){return null==n?null:n.fname},n.accessorFields=function(n){return null==n?null:n.fields},n.id=p,n.identity=g,n.zero=v,n.one=h,n.truthy=y,n.falsy=b,n.logger=function(n){var t=n||0;return{level:function(n){return arguments.length?(t=+n,this):t},warn:function(){return t>=1&&e("warn","WARN",arguments),this},info:function(){return t>=2&&e("log","INFO",arguments),this},debug:function(){return t>=3&&e("log","DEBUG",arguments),this}}},n.None=0,n.Warn=1,n.Info=2,n.Debug=3,n.array=m,n.compare=function(n,e){var r,o,c,l,f,a,s,p,g=[],v=(n=m(n)).map(function(n,e){return null==n?null:(g.push(e),i(n).map(t).join("]["))}),h=g.length-1,y=m(e),b="var u,v;return ";if(h<0)return null;for(o=0;o<=h;++o)l="(u=a["+(c=v[r=g[o]])+"])",f="(v=b["+c+"])",a="((v=v instanceof Date?+v:v),(u=u instanceof Date?+u:u))","descending"!==y[r]?(p=1,s=-1):(p=-1,s=1),b+="("+l+"<"+f+"||u==null)&&v!=null?"+s+":(u>v||v==null)&&u!=null?"+p+":"+a+"!==u&&v===v?"+s+":v!==v&&u===u?"+p+(r<h?":":":0");return u(Function("a","b",b+";"),n.filter(function(n){return null!=n}))},n.constant=function(n){return d(n)?n:function(){return n}},n.debounce=function(n,t){function e(){t(u),r=u=null}var r,u;return function(t){u=t,r&&clearTimeout(r),r=setTimeout(e,n)}},n.error=o,n.extend=function(n){for(var t,e,r=1,u=arguments.length;r<u;++r){t=arguments[r];for(e in t)n[e]=t[e]}return n},n.extentIndex=function(n,t){var e,r,u,o,i,c=-1,l=n.length;if(null==t){for(;++c<l;)if(null!=(r=n[c])&&r>=r){e=u=r;break}for(o=i=c;++c<l;)null!=(r=n[c])&&(e>r&&(e=r,o=c),u<r&&(u=r,i=c))}else{for(;++c<l;)if(null!=(r=t(n[c],c,n))&&r>=r){e=u=r;break}for(o=i=c;++c<l;)null!=(r=t(n[c],c,n))&&(e>r&&(e=r,o=c),u<r&&(u=r,i=c))}return[o,i]},n.fastmap=function(n){function t(n){return u.hasOwnProperty(n)&&u[n]!==j}var e,r,u={};return e={size:0,empty:0,object:u,has:t,get:function(n){return t(n)?u[n]:void 0},set:function(n,r){return t(n)||(++e.size,u[n]===j&&--e.empty),u[n]=r,this},delete:function(n){return t(n)&&(--e.size,++e.empty,u[n]=j),this},clear:function(){e.size=e.empty=0,e.object=u={}},test:function(n){return arguments.length?(r=n,e):r},clean:function(){var n,t,o={},i=0;for(n in u)(t=u[n])===j||r&&r(t)||(o[n]=t,++i);e.size=i,e.empty=0,e.object=u=o}},n&&Object.keys(n).forEach(function(t){e.set(t,n[t])}),e},n.field=a,n.inherits=function(n,t){var e=n.prototype=Object.create(t.prototype);return e.constructor=n,e},n.isArray=c,n.isBoolean=function(n){return"boolean"==typeof n},n.isDate=O,n.isFunction=d,n.isNumber=x,n.isObject=l,n.isRegExp=function(n){return"[object RegExp]"===Object.prototype.toString.call(n)},n.isString=f,n.key=function(n){var e=(n=n?m(n):n)&&n.length?Function("_","return ''+"+n.map(function(n){return"_["+i(n).map(t).join("][")+"]"}).join("+'|'+")+";"):function(){return""};return u(e,n,"key")},n.merge=function(n,t,e,r){var u=t.length,o=e.length;if(!o)return t;if(!u)return e;for(var i=r||new t.constructor(u+o),c=0,l=0,f=0;c<u&&l<o;++f)i[f]=n(t[c],e[l])>0?e[l++]:t[c++];for(;c<u;++c,++f)i[f]=t[c];for(;l<o;++l,++f)i[f]=e[l];return i},n.pad=function(n,t,e,r){var u=e||" ",o=n+"",i=t-o.length;return i<=0?o:"left"===r?A(u,i)+o:"center"===r?A(u,~~(i/2))+o+A(u,Math.ceil(i/2)):o+A(u,i)},n.peek=function(n){return n[n.length-1]},n.repeat=A,n.splitAccessPath=i,n.stringValue=t,n.toBoolean=function(n){return null==n||""===n?null:!(!n||"false"===n||"0"===n||!n)},n.toDate=function(n,t){return t=t||r,null==n||""===n?null:t(n)},n.toNumber=function(n){return null==n||""===n?null:+n},n.toString=function(n){return null==n||""===n?null:n+""},n.toSet=function(n){for(var t={},e=0,r=n.length;e<r;++e)t[n[e]]=1;return t},n.truncate=function(n,t,e,r){var u=null!=r?r:"…",o=n+"",i=o.length,c=Math.max(0,t-u.length);return i<=t?o:"left"===e?u+o.slice(i-c):"center"===e?o.slice(0,Math.ceil(c/2))+u+o.slice(i-~~(c/2)):o.slice(0,c)+u},n.visitArray=function(n,t,e){if(n){var r,u=0,o=n.length;if(t)for(;u<o;++u)(r=t(n[u]))&&e(r,u,n);else n.forEach(e)}},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.vega=n.vega||{})}(this,function(n){"use strict";function t(n){return c(n)?"["+n.map(t)+"]":l(n)||f(n)?JSON.stringify(n).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):n}function e(n,t,e){var r=[t].concat([].slice.call(e));console[n].apply(console,r)}function r(n){return x(n)?n:O(n)?n:Date.parse(n)}var u=function(n,t,e){return n.fields=t||[],n.fname=e,n},o=function(n){throw Error(n)},i=function(n){function t(){i.push(a+n.substring(e,r)),a="",e=r+1}var e,r,u,i=[],c=null,l=0,f=n.length,a="";for(n+="",e=r=0;r<f;++r)if("\\"===(u=n[r]))a+=n.substring(e,r),e=++r;else if(u===c)t(),c=null,l=-1;else{if(c)continue;e===l&&'"'===u?(e=r+1,c=u):e===l&&"'"===u?(e=r+1,c=u):"."!==u||l?"["===u?(r>e&&t(),l=e=r+1):"]"===u&&(l||o("Access path missing open bracket: "+n),l>0&&t(),l=0,e=r+1):r>e?t():e=r+1}return l&&o("Access path missing closing bracket: "+n),c&&o("Access path missing closing quote: "+n),r>e&&(r++,t()),i},c=Array.isArray,l=function(n){return n===Object(n)},f=function(n){return"string"==typeof n},a=function(n,e){var r=i(n),o="return _["+r.map(t).join("][")+"];";return u(Function("_",o),[n=1===r.length?r[0]:n],e||n)},s=[],p=a("id"),g=u(function(n){return n},s,"identity"),h=u(function(){return 0},s,"zero"),v=u(function(){return 1},s,"one"),y=u(function(){return!0},s,"true"),b=u(function(){return!1},s,"false"),m=function(n){return null!=n?c(n)?n:[n]:[]},d=function(n){return"function"==typeof n},j={},O=function(n){return"[object Date]"===Object.prototype.toString.call(n)},x=function(n){return"number"==typeof n},A=function(n,t){for(var e="";--t>=0;)e+=n;return e};n.accessor=u,n.accessorName=function(n){return null==n?null:n.fname},n.accessorFields=function(n){return null==n?null:n.fields},n.id=p,n.identity=g,n.zero=h,n.one=v,n.truthy=y,n.falsy=b,n.logger=function(n){var t=n||0;return{level:function(n){return arguments.length?(t=+n,this):t},error:function(){return t>=1&&e("error","ERROR",arguments),this},warn:function(){return t>=2&&e("warn","WARN",arguments),this},info:function(){return t>=3&&e("log","INFO",arguments),this},debug:function(){return t>=4&&e("log","DEBUG",arguments),this}}},n.None=0,n.Warn=2,n.Info=3,n.Debug=4,n.array=m,n.compare=function(n,e){var r,o,c,l,f,a,s,p,g=[],h=(n=m(n)).map(function(n,e){return null==n?null:(g.push(e),i(n).map(t).join("]["))}),v=g.length-1,y=m(e),b="var u,v;return ";if(v<0)return null;for(o=0;o<=v;++o)l="(u=a["+(c=h[r=g[o]])+"])",f="(v=b["+c+"])",a="((v=v instanceof Date?+v:v),(u=u instanceof Date?+u:u))","descending"!==y[r]?(p=1,s=-1):(p=-1,s=1),b+="("+l+"<"+f+"||u==null)&&v!=null?"+s+":(u>v||v==null)&&u!=null?"+p+":"+a+"!==u&&v===v?"+s+":v!==v&&u===u?"+p+(r<v?":":":0");return u(Function("a","b",b+";"),n.filter(function(n){return null!=n}))},n.constant=function(n){return d(n)?n:function(){return n}},n.debounce=function(n,t){function e(){t(u),r=u=null}var r,u;return function(t){u=t,r&&clearTimeout(r),r=setTimeout(e,n)}},n.error=o,n.extend=function(n){for(var t,e,r=1,u=arguments.length;r<u;++r){t=arguments[r];for(e in t)n[e]=t[e]}return n},n.extentIndex=function(n,t){var e,r,u,o,i,c=-1,l=n.length;if(null==t){for(;++c<l;)if(null!=(r=n[c])&&r>=r){e=u=r;break}for(o=i=c;++c<l;)null!=(r=n[c])&&(e>r&&(e=r,o=c),u<r&&(u=r,i=c))}else{for(;++c<l;)if(null!=(r=t(n[c],c,n))&&r>=r){e=u=r;break}for(o=i=c;++c<l;)null!=(r=t(n[c],c,n))&&(e>r&&(e=r,o=c),u<r&&(u=r,i=c))}return[o,i]},n.fastmap=function(n){function t(n){return u.hasOwnProperty(n)&&u[n]!==j}var e,r,u={};return e={size:0,empty:0,object:u,has:t,get:function(n){return t(n)?u[n]:void 0},set:function(n,r){return t(n)||(++e.size,u[n]===j&&--e.empty),u[n]=r,this},delete:function(n){return t(n)&&(--e.size,++e.empty,u[n]=j),this},clear:function(){e.size=e.empty=0,e.object=u={}},test:function(n){return arguments.length?(r=n,e):r},clean:function(){var n,t,o={},i=0;for(n in u)(t=u[n])===j||r&&r(t)||(o[n]=t,++i);e.size=i,e.empty=0,e.object=u=o}},n&&Object.keys(n).forEach(function(t){e.set(t,n[t])}),e},n.field=a,n.inherits=function(n,t){var e=n.prototype=Object.create(t.prototype);return e.constructor=n,e},n.isArray=c,n.isBoolean=function(n){return"boolean"==typeof n},n.isDate=O,n.isFunction=d,n.isNumber=x,n.isObject=l,n.isRegExp=function(n){return"[object RegExp]"===Object.prototype.toString.call(n)},n.isString=f,n.key=function(n){var e=(n=n?m(n):n)&&n.length?Function("_","return ''+"+n.map(function(n){return"_["+i(n).map(t).join("][")+"]"}).join("+'|'+")+";"):function(){return""};return u(e,n,"key")},n.merge=function(n,t,e,r){var u=t.length,o=e.length;if(!o)return t;if(!u)return e;for(var i=r||new t.constructor(u+o),c=0,l=0,f=0;c<u&&l<o;++f)i[f]=n(t[c],e[l])>0?e[l++]:t[c++];for(;c<u;++c,++f)i[f]=t[c];for(;l<o;++l,++f)i[f]=e[l];return i},n.pad=function(n,t,e,r){var u=e||" ",o=n+"",i=t-o.length;return i<=0?o:"left"===r?A(u,i)+o:"center"===r?A(u,~~(i/2))+o+A(u,Math.ceil(i/2)):o+A(u,i)},n.peek=function(n){return n[n.length-1]},n.repeat=A,n.splitAccessPath=i,n.stringValue=t,n.toBoolean=function(n){return null==n||""===n?null:!(!n||"false"===n||"0"===n||!n)},n.toDate=function(n,t){return t=t||r,null==n||""===n?null:t(n)},n.toNumber=function(n){return null==n||""===n?null:+n},n.toString=function(n){return null==n||""===n?null:n+""},n.toSet=function(n){for(var t={},e=0,r=n.length;e<r;++e)t[n[e]]=1;return t},n.truncate=function(n,t,e,r){var u=null!=r?r:"…",o=n+"",i=o.length,c=Math.max(0,t-u.length);return i<=t?o:"left"===e?u+o.slice(i-c):"center"===e?o.slice(0,Math.ceil(c/2))+u+o.slice(i-~~(c/2)):o.slice(0,c)+u},n.visitArray=function(n,t,e){if(n){var r,u=0,o=n.length;if(t)for(;u<o;++u)(r=t(n[u]))&&e(r,u,n);else n.forEach(e)}},Object.defineProperty(n,"__esModule",{value:!0})});
{
"name": "vega-util",
"version": "1.3.1",
"version": "1.4.0",
"description": "JavaScript utilities for Vega.",

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

@@ -489,2 +489,9 @@ # vega-util

<a name="Error" href="#Error">#</a>
vega.<b>Error</b>
[<>](https://github.com/vega/vega-util/blob/master/src/logger.js "Source")
Constant value indicating a log level of 'Error'. If set as the log level of
a [logger](#logger) instance, only error messages will be presented.
<a name="Warn" href="#Warn">#</a>

@@ -495,3 +502,3 @@ vega.<b>Warn</b>

Constant value indicating a log level of 'Warn'. If set as the log level of
a [logger](#logger) instance, only warning messages will be presented.
a [logger](#logger) instance, both error and warning messages will be presented.

@@ -503,3 +510,4 @@ <a name="Info" href="#Info">#</a>

Constant value indicating a log level of 'Info'. If set as the log level of
a [logger](#logger) instance, both warning and info messages will be presented.
a [logger](#logger) instance, error, warning and info messages will be
presented.

@@ -511,4 +519,4 @@ <a name="Debug" href="#Debug">#</a>

Constant value indicating a log level of 'Debug'. If set as the log level of
a [logger](#logger) instance, all log messages (warning, info and debug)
will be presented.
a [logger](#logger) instance, all log messages (error, warning, info and
debug) will be presented.

@@ -515,0 +523,0 @@

@@ -7,5 +7,6 @@ function log(method, level, input) {

export var None = 0;
export var Warn = 1;
export var Info = 2;
export var Debug = 3;
export var Error = 1;
export var Warn = 2;
export var Info = 3;
export var Debug = 4;

@@ -23,2 +24,6 @@ export default function(_) {

},
error: function() {
if (level >= Error) log('error', 'ERROR', arguments);
return this;
},
warn: function() {

@@ -25,0 +30,0 @@ if (level >= Warn) log('warn', 'WARN', arguments);

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