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

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.0.0 to 1.0.1

14

build/vega-util.js

@@ -264,9 +264,11 @@ (function (global, factory) {

var visitArray = function(array, filter, visitor) {
var i = 0, n = array.length, t;
if (filter) {
for (; i<n; ++i) {
if (t = filter(array[i])) visitor(t, i, array);
if (array) {
var i = 0, n = array.length, t;
if (filter) {
for (; i<n; ++i) {
if (t = filter(array[i])) visitor(t, i, array);
}
} else {
array.forEach(visitor);
}
} else {
array.forEach(visitor);
}

@@ -273,0 +275,0 @@ }

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

!function(n,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r(n.vega=n.vega||{})}(this,function(n){"use strict";function r(n){return null==n?null:n.fname}function t(n){return null==n?null:n.fields}function e(n){return"["!==n[0]?n:"'"!==n[1]&&'"'!==n[1]?n.slice(1,-1):n.slice(2,-2).replace(/\\(["'])/g,"$1")}function u(n){return f(n)?"["+n.map(u)+"]":l(n)||a(n)?JSON.stringify(n).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):n}function o(n,r,t){var e=[r].concat([].slice.call(t));console[n].apply(console,e)}var i=function(n,r,t){return n.fields=r||[],n.fname=t,n},c=function(n){return String(n).match(/\[(.*?)\]|[^.\[]+/g).map(e)},f=Array.isArray,l=function(n){return n===Object(n)},a=function(n){return"string"==typeof n},s=function(n,r){var t=c(n).map(u),e=Function("_","return _["+t.join("][")+"];");return i(e,[n],r||n)},v=[],p=s("id"),g=i(function(n){return n},v,"identity"),h=i(function(){return 0},v,"zero"),d=i(function(){return 1},v,"one"),y=i(function(){return!0},v,"true"),m=i(function(){return!1},v,"false"),b=0,j=1,x=2,A=3,F=function(n){var r=n||b;return{level:function(n){return arguments.length?(r=+n,this):r},warn:function(){return r>=j&&o("warn","WARN",arguments),this},info:function(){return r>=x&&o("log","INFO",arguments),this},debug:function(){return r>=A&&o("log","DEBUG",arguments),this}}},N=function(n){return null!=n?f(n)?n:[n]:[]},O=function(n,r){if(null==n)return null;n=N(n);var t,e,o,f,l,a,s,v=n.map(function(n){return c(n).map(u).join("][")}),p=N(r),g=v.length-1,h="var u,v;return ";for(t=0;t<=g;++t)e=v[t],o="(u=a["+e+"])",f="(v=b["+e+"])",l="((v=v instanceof Date?+v:v),(u=u instanceof Date?+u:u))",a="descending"!==p[t]?(s=1,-1):(s=-1,1),h+="("+o+"<"+f+"||u==null)&&v!=null?"+a+":(u>v||v==null)&&u!=null?"+s+":"+l+"!==u&&v===v?"+a+":v!==v&&u===u?"+s+(t<g?":":":0");return i(Function("a","b",h+";"),n)},_=function(n){return"function"==typeof n},k=function(n){return _(n)?n:function(){return n}},w=function(n){throw Error(n)},D=function(n){for(var r,t,e=1,u=arguments.length;e<u;++e){r=arguments[e];for(t in r)n[t]=r[t]}return n},M=function(n,r){var t,e,u,o,i,c=-1,f=n.length;if(null==r){for(;++c<f;)if(null!=(e=n[c])&&e>=e){t=u=e;break}for(o=i=c;++c<f;)null!=(e=n[c])&&(t>e&&(t=e,o=c),u<e&&(u=e,i=c))}else{for(;++c<f;)if(null!=(e=r(n[c],c,n))&&e>=e){t=u=e;break}for(o=i=c;++c<f;)null!=(e=r(n[c],c,n))&&(t>e&&(t=e,o=c),u<e&&(u=e,i=c))}return[o,i]},S=function(n,r){var t=n.prototype=Object.create(r.prototype);return t.constructor=n,t},E=function(n){return"number"==typeof n},I=function(n){n=n?N(n):n;var r=n&&n.length?Function("_","return ''+"+n.map(function(n){return"_["+c(n).map(u).join("][")+"]"}).join("+'|'+")+";"):function(){return""};return i(r,n,"key")},z=function(n,r,t,e){var u=r.length,o=t.length;if(!o)return r;if(!u)return t;for(var i=e||new r.constructor(u+o),c=0,f=0,l=0;c<u&&f<o;++l)i[l]=n(r[c],t[f])>0?t[f++]:r[c++];for(;c<u;++c,++l)i[l]=r[c];for(;f<o;++f,++l)i[l]=t[f];return i},P=function(n,r){for(var t="";--r>=0;)t+=n;return t},W=function(n,r,t,e){var u=t||" ",o=r-n.length;return o<=0?n:"left"===e?P(u,o)+n:"center"===e?P(u,~~(o/2))+n+P(u,Math.ceil(o/2)):n+P(u,o)},B=function(n){return n[n.length-1]},G=function(n){for(var r={},t=0,e=n.length;t<e;++t)r[n[t]]=1;return r},J=function(n,r,t,e){var u=null!=e?e:"…",o=n.length,i=Math.max(0,r-u.length);return o<=r?n:"left"===t?u+n.slice(o-i):"center"===t?n.slice(0,Math.ceil(i/2))+u+n.slice(o-~~(i/2)):n.slice(0,i)+u},R=function(n,r,t){var e,u=0,o=n.length;if(r)for(;u<o;++u)(e=r(n[u]))&&t(e,u,n);else n.forEach(t)};n.accessor=i,n.accessorName=r,n.accessorFields=t,n.id=p,n.identity=g,n.zero=h,n.one=d,n.truthy=y,n.falsy=m,n.logger=F,n.None=b,n.Warn=j,n.Info=x,n.Debug=A,n.array=N,n.compare=O,n.constant=k,n.error=w,n.extend=D,n.extentIndex=M,n.field=s,n.inherits=S,n.isArray=f,n.isFunction=_,n.isNumber=E,n.isObject=l,n.isString=a,n.key=I,n.merge=z,n.pad=W,n.peek=B,n.repeat=P,n.splitAccessPath=c,n.stringValue=u,n.toSet=G,n.truncate=J,n.visitArray=R,Object.defineProperty(n,"__esModule",{value:!0})});
!function(n,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r(n.vega=n.vega||{})}(this,function(n){"use strict";function r(n){return null==n?null:n.fname}function t(n){return null==n?null:n.fields}function e(n){return"["!==n[0]?n:"'"!==n[1]&&'"'!==n[1]?n.slice(1,-1):n.slice(2,-2).replace(/\\(["'])/g,"$1")}function u(n){return f(n)?"["+n.map(u)+"]":l(n)||a(n)?JSON.stringify(n).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):n}function o(n,r,t){var e=[r].concat([].slice.call(t));console[n].apply(console,e)}var i=function(n,r,t){return n.fields=r||[],n.fname=t,n},c=function(n){return String(n).match(/\[(.*?)\]|[^.\[]+/g).map(e)},f=Array.isArray,l=function(n){return n===Object(n)},a=function(n){return"string"==typeof n},s=function(n,r){var t=c(n).map(u),e=Function("_","return _["+t.join("][")+"];");return i(e,[n],r||n)},v=[],p=s("id"),g=i(function(n){return n},v,"identity"),h=i(function(){return 0},v,"zero"),d=i(function(){return 1},v,"one"),y=i(function(){return!0},v,"true"),m=i(function(){return!1},v,"false"),b=0,j=1,x=2,A=3,F=function(n){var r=n||b;return{level:function(n){return arguments.length?(r=+n,this):r},warn:function(){return r>=j&&o("warn","WARN",arguments),this},info:function(){return r>=x&&o("log","INFO",arguments),this},debug:function(){return r>=A&&o("log","DEBUG",arguments),this}}},N=function(n){return null!=n?f(n)?n:[n]:[]},O=function(n,r){if(null==n)return null;n=N(n);var t,e,o,f,l,a,s,v=n.map(function(n){return c(n).map(u).join("][")}),p=N(r),g=v.length-1,h="var u,v;return ";for(t=0;t<=g;++t)e=v[t],o="(u=a["+e+"])",f="(v=b["+e+"])",l="((v=v instanceof Date?+v:v),(u=u instanceof Date?+u:u))",a="descending"!==p[t]?(s=1,-1):(s=-1,1),h+="("+o+"<"+f+"||u==null)&&v!=null?"+a+":(u>v||v==null)&&u!=null?"+s+":"+l+"!==u&&v===v?"+a+":v!==v&&u===u?"+s+(t<g?":":":0");return i(Function("a","b",h+";"),n)},_=function(n){return"function"==typeof n},k=function(n){return _(n)?n:function(){return n}},w=function(n){throw Error(n)},D=function(n){for(var r,t,e=1,u=arguments.length;e<u;++e){r=arguments[e];for(t in r)n[t]=r[t]}return n},M=function(n,r){var t,e,u,o,i,c=-1,f=n.length;if(null==r){for(;++c<f;)if(null!=(e=n[c])&&e>=e){t=u=e;break}for(o=i=c;++c<f;)null!=(e=n[c])&&(t>e&&(t=e,o=c),u<e&&(u=e,i=c))}else{for(;++c<f;)if(null!=(e=r(n[c],c,n))&&e>=e){t=u=e;break}for(o=i=c;++c<f;)null!=(e=r(n[c],c,n))&&(t>e&&(t=e,o=c),u<e&&(u=e,i=c))}return[o,i]},S=function(n,r){var t=n.prototype=Object.create(r.prototype);return t.constructor=n,t},E=function(n){return"number"==typeof n},I=function(n){n=n?N(n):n;var r=n&&n.length?Function("_","return ''+"+n.map(function(n){return"_["+c(n).map(u).join("][")+"]"}).join("+'|'+")+";"):function(){return""};return i(r,n,"key")},z=function(n,r,t,e){var u=r.length,o=t.length;if(!o)return r;if(!u)return t;for(var i=e||new r.constructor(u+o),c=0,f=0,l=0;c<u&&f<o;++l)i[l]=n(r[c],t[f])>0?t[f++]:r[c++];for(;c<u;++c,++l)i[l]=r[c];for(;f<o;++f,++l)i[l]=t[f];return i},P=function(n,r){for(var t="";--r>=0;)t+=n;return t},W=function(n,r,t,e){var u=t||" ",o=r-n.length;return o<=0?n:"left"===e?P(u,o)+n:"center"===e?P(u,~~(o/2))+n+P(u,Math.ceil(o/2)):n+P(u,o)},B=function(n){return n[n.length-1]},G=function(n){for(var r={},t=0,e=n.length;t<e;++t)r[n[t]]=1;return r},J=function(n,r,t,e){var u=null!=e?e:"…",o=n.length,i=Math.max(0,r-u.length);return o<=r?n:"left"===t?u+n.slice(o-i):"center"===t?n.slice(0,Math.ceil(i/2))+u+n.slice(o-~~(i/2)):n.slice(0,i)+u},R=function(n,r,t){if(n){var e,u=0,o=n.length;if(r)for(;u<o;++u)(e=r(n[u]))&&t(e,u,n);else n.forEach(t)}};n.accessor=i,n.accessorName=r,n.accessorFields=t,n.id=p,n.identity=g,n.zero=h,n.one=d,n.truthy=y,n.falsy=m,n.logger=F,n.None=b,n.Warn=j,n.Info=x,n.Debug=A,n.array=N,n.compare=O,n.constant=k,n.error=w,n.extend=D,n.extentIndex=M,n.field=s,n.inherits=S,n.isArray=f,n.isFunction=_,n.isNumber=E,n.isObject=l,n.isString=a,n.key=I,n.merge=z,n.pad=W,n.peek=B,n.repeat=P,n.splitAccessPath=c,n.stringValue=u,n.toSet=G,n.truncate=J,n.visitArray=R,Object.defineProperty(n,"__esModule",{value:!0})});
{
"name": "vega-util",
"version": "1.0.0",
"version": "1.0.1",
"description": "JavaScript utilities for Vega.",

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

export default function(array, filter, visitor) {
var i = 0, n = array.length, t;
if (filter) {
for (; i<n; ++i) {
if (t = filter(array[i])) visitor(t, i, array);
if (array) {
var i = 0, n = array.length, t;
if (filter) {
for (; i<n; ++i) {
if (t = filter(array[i])) visitor(t, i, array);
}
} else {
array.forEach(visitor);
}
} else {
array.forEach(visitor);
}
}
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