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.0 to 1.3.1

193

build/vega-util.js
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define(['exports'], factory) :
(factory((global.vega = global.vega || {})));
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define(['exports'], factory) :
(factory((global.vega = global.vega || {})));
}(this, (function (exports) { 'use strict';
var accessor = function(fn, fields, name) {
return (
fn.fields = fields || [],
fn.fname = name,
fn
);
}
fn.fields = fields || [];
fn.fname = name;
return fn;
};

@@ -25,3 +23,3 @@ function accessorName(fn) {

throw Error(message);
}
};

@@ -46,13 +44,27 @@ var splitAccessPath = function(p) {

c = p[j];
if (c === '\\') s += p.substring(i, j), i = ++j;
else if (c === q) push(), q = null, b = -1;
else if (q) continue;
else if (i === b && c === '"') i = j + 1, q = c;
else if (i === b && c === "'") i = j + 1, q = c;
else if (c === '.' && !b) (j > i) ? push() : (i = j + 1);
else if (c === '[') {
if (c === '\\') {
s += p.substring(i, j);
i = ++j;
} else if (c === q) {
push();
q = null;
b = -1;
} else if (q) {
continue;
} else if (i === b && c === '"') {
i = j + 1;
q = c;
} else if (i === b && c === "'") {
i = j + 1;
q = c;
} else if (c === '.' && !b) {
if (j > i) {
push();
} else {
i = j + 1;
}
} else if (c === '[') {
if (j > i) push();
b = i = j + 1;
}
else if (c === ']') {
} else if (c === ']') {
if (!b) error('Access path missing open bracket: ' + p);

@@ -67,5 +79,10 @@ if (b > 0) push();

if (q) error('Access path missing closing quote: ' + p);
if (j > i) ++j, push();
if (j > i) {
j++;
push();
}
return path;
}
};

@@ -76,7 +93,7 @@ var isArray = Array.isArray;

return _ === Object(_);
}
};
var isString = function(_) {
return typeof _ === 'string';
}
};

@@ -101,3 +118,3 @@ function $(x) {

);
}
};

@@ -132,3 +149,8 @@ var empty = [];

level: function(_) {
return arguments.length ? (level = +_, this) : level;
if (arguments.length) {
level = +_;
return this;
} else {
return level;
}
},

@@ -148,7 +170,7 @@ warn: function() {

}
}
};
var array = function(_) {
return _ != null ? (isArray(_) ? _ : [_]) : [];
}
};

@@ -158,4 +180,8 @@ var compare = function(fields, orders) {

cmp = (fields = array(fields)).map(function(f, i) {
return f == null ? null
: (idx.push(i), splitAccessPath(f).map($).join(']['));
if (f == null) {
return null;
} else {
idx.push(i);
return splitAccessPath(f).map($).join('][');
}
}),

@@ -175,3 +201,9 @@ n = idx.length - 1,

d = '((v=v instanceof Date?+v:v),(u=u instanceof Date?+u:u))';
lt = ord[i] !== 'descending' ? (gt=1, -1) : (gt=-1, 1);
if (ord[i] !== 'descending') {
gt = 1;
lt = -1;
} else {
gt = -1;
lt = 1;
}
code += '(' + u+'<'+v+'||u==null)&&v!=null?' + lt

@@ -188,11 +220,11 @@ + ':(u>v||v==null)&&u!=null?' + gt

);
}
};
var isFunction = function(_) {
return typeof _ === 'function';
}
};
var constant = function(_) {
return isFunction(_) ? _ : function() { return _; };
}
};

@@ -212,3 +244,3 @@ var debounce = function(delay, handler) {

};
}
};

@@ -221,3 +253,3 @@ var extend = function(_) {

return _;
}
};

@@ -230,14 +262,44 @@ var extentIndex = function(array, f) {

if (f == null) {
while (++i < n) if ((b = array[i]) != null && b >= b) { a = c = b; break; }
while (++i < n) {
b = array[i];
if (b != null && b >= b) {
a = c = b;
break;
}
}
u = v = i;
while (++i < n) if ((b = array[i]) != null) {
if (a > b) a = b, u = i;
if (c < b) c = b, v = i;
while (++i < n) {
b = array[i];
if (b != null) {
if (a > b) {
a = b;
u = i;
}
if (c < b) {
c = b;
v = i;
}
}
}
} else {
while (++i < n) if ((b = f(array[i], i, array)) != null && b >= b) { a = c = b; break; }
while (++i < n) {
b = f(array[i], i, array);
if (b != null && b >= b) {
a = c = b;
break;
}
}
u = v = i;
while (++i < n) if ((b = f(array[i], i, array)) != null) {
if (a > b) a = b, u = i;
if (c < b) c = b, v = i;
while (++i < n) {
b = f(array[i], i, array);
if (b != null) {
if (a > b) {
a = b;
u = i;
}
if (c < b) {
c = b;
v = i;
}
}
}

@@ -247,3 +309,3 @@ }

return [u, v];
}
};

@@ -290,3 +352,8 @@ var NULL = {};

test: function(_) {
return arguments.length ? (test = _, map) : test;
if (arguments.length) {
test = _;
return map;
} else {
return test;
}
},

@@ -315,3 +382,3 @@ clean: function() {

return map;
}
};

@@ -322,19 +389,19 @@ var inherits = function(child, parent) {

return proto;
}
};
var isBoolean = function(_) {
return typeof _ === 'boolean';
}
};
var isDate = function(_) {
return Object.prototype.toString.call(_) === '[object Date]';
}
};
var isNumber = function(_) {
return typeof _ === 'number';
}
};
var isRegExp = function(_) {
return Object.prototype.toString.call(_) === '[object RegExp]';
}
};

@@ -350,3 +417,3 @@ var key = function(fields) {

return accessor(fn, fields, 'key');
}
};

@@ -378,3 +445,3 @@ var merge = function(compare, array0, array1, output) {

return merged;
}
};

@@ -385,3 +452,3 @@ var repeat = function(str, reps) {

return s;
}
};

@@ -397,11 +464,11 @@ var pad = function(str, length, padchar, align) {

: s + repeat(c, n);
}
};
var peek = function(array) {
return array[array.length - 1];
}
};
var toBoolean = function(_) {
return _ == null || _ === '' ? null : !_ || _ === 'false' || _ === '0' ? false : !!_;
}
};

@@ -415,11 +482,11 @@ function defaultParser(_) {

return _ == null || _ === '' ? null : parser(_);
}
};
var toNumber = function(_) {
return _ == null || _ === '' ? null : +_;
}
};
var toString = function(_) {
return _ == null || _ === '' ? null : _ + '';
}
};

@@ -429,3 +496,3 @@ var toSet = function(_) {

return s;
}
};

@@ -442,3 +509,3 @@ var truncate = function(str, length, align, ellipsis) {

: s.slice(0, l) + e;
}
};

@@ -456,3 +523,3 @@ var visitArray = function(array, filter, visitor) {

}
}
};

@@ -459,0 +526,0 @@ exports.accessor = accessor;

@@ -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 null==n?null:n.fname}function e(n){return null==n?null:n.fields}function r(n){return f(n)?"["+n.map(r)+"]":a(n)||s(n)?JSON.stringify(n).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):n}function u(n,t,e){var r=[t].concat([].slice.call(e));console[n].apply(console,r)}function o(n){return R(n)?n:P(n)?n:Date.parse(n)}var i=function(n,t,e){return n.fields=t||[],n.fname=e,n},c=function(n){throw Error(n)},l=function(n){function t(){o.push(a+n.substring(e,r)),a="",e=r+1}var e,r,u,o=[],i=null,l=0,f=n.length,a="";for(n+="",e=r=0;r<f;++r)if(u=n[r],"\\"===u)a+=n.substring(e,r),e=++r;else if(u===i)t(),i=null,l=-1;else{if(i)continue;e===l&&'"'===u?(e=r+1,i=u):e===l&&"'"===u?(e=r+1,i=u):"."!==u||l?"["===u?(r>e&&t(),l=e=r+1):"]"===u&&(l||c("Access path missing open bracket: "+n),l>0&&t(),l=0,e=r+1):r>e?t():e=r+1}return l&&c("Access path missing closing bracket: "+n),i&&c("Access path missing closing quote: "+n),r>e&&(++r,t()),o},f=Array.isArray,a=function(n){return n===Object(n)},s=function(n){return"string"==typeof n},p=function(n,t){var e=l(n),u="return _["+e.map(r).join("][")+"];";return i(Function("_",u),[n=1===e.length?e[0]:n],t||n)},g=[],v=p("id"),h=i(function(n){return n},g,"identity"),y=i(function(){return 0},g,"zero"),b=i(function(){return 1},g,"one"),m=i(function(){return!0},g,"true"),d=i(function(){return!1},g,"false"),j=0,O=1,x=2,A=3,k=function(n){var t=n||j;return{level:function(n){return arguments.length?(t=+n,this):t},warn:function(){return t>=O&&u("warn","WARN",arguments),this},info:function(){return t>=x&&u("log","INFO",arguments),this},debug:function(){return t>=A&&u("log","DEBUG",arguments),this}}},D=function(n){return null!=n?f(n)?n:[n]:[]},z=function(n,t){var e,u,o,c,f,a,s,p,g=[],v=(n=D(n)).map(function(n,t){return null==n?null:(g.push(t),l(n).map(r).join("]["))}),h=g.length-1,y=D(t),b="var u,v;return ";if(h<0)return null;for(u=0;u<=h;++u)e=g[u],o=v[e],c="(u=a["+o+"])",f="(v=b["+o+"])",a="((v=v instanceof Date?+v:v),(u=u instanceof Date?+u:u))",s="descending"!==y[e]?(p=1,-1):(p=-1,1),b+="("+c+"<"+f+"||u==null)&&v!=null?"+s+":(u>v||v==null)&&u!=null?"+p+":"+a+"!==u&&v===v?"+s+":v!==v&&u===u?"+p+(e<h?":":":0");return i(Function("a","b",b+";"),n.filter(function(n){return null!=n}))},N=function(n){return"function"==typeof n},E=function(n){return N(n)?n:function(){return n}},F=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)}},S=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},_=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]},w={},M=function(n){function t(n){return u.hasOwnProperty(n)&&u[n]!==w}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]===w&&--e.empty),u[n]=r,this},delete:function(n){return t(n)&&(--e.size,++e.empty,u[n]=w),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],t===w||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},B=function(n,t){var e=n.prototype=Object.create(t.prototype);return e.constructor=n,e},I=function(n){return"boolean"==typeof n},P=function(n){return"[object Date]"===Object.prototype.toString.call(n)},R=function(n){return"number"==typeof n},T=function(n){return"[object RegExp]"===Object.prototype.toString.call(n)},W=function(n){n=n?D(n):n;var t=n&&n.length?Function("_","return ''+"+n.map(function(n){return"_["+l(n).map(r).join("][")+"]"}).join("+'|'+")+";"):function(){return""};return i(t,n,"key")},q=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},G=function(n,t){for(var e="";--t>=0;)e+=n;return e},J=function(n,t,e,r){var u=e||" ",o=n+"",i=t-o.length;return i<=0?o:"left"===r?G(u,i)+o:"center"===r?G(u,~~(i/2))+o+G(u,Math.ceil(i/2)):o+G(u,i)},U=function(n){return n[n.length-1]},V=function(n){return null==n||""===n?null:!(!n||"false"===n||"0"===n)&&!!n},C=function(n,t){return t=t||o,null==n||""===n?null:t(n)},H=function(n){return null==n||""===n?null:+n},K=function(n){return null==n||""===n?null:n+""},L=function(n){for(var t={},e=0,r=n.length;e<r;++e)t[n[e]]=1;return t},Q=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},X=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)}};n.accessor=i,n.accessorName=t,n.accessorFields=e,n.id=v,n.identity=h,n.zero=y,n.one=b,n.truthy=m,n.falsy=d,n.logger=k,n.None=j,n.Warn=O,n.Info=x,n.Debug=A,n.array=D,n.compare=z,n.constant=E,n.debounce=F,n.error=c,n.extend=S,n.extentIndex=_,n.fastmap=M,n.field=p,n.inherits=B,n.isArray=f,n.isBoolean=I,n.isDate=P,n.isFunction=N,n.isNumber=R,n.isObject=a,n.isRegExp=T,n.isString=s,n.key=W,n.merge=q,n.pad=J,n.peek=U,n.repeat=G,n.splitAccessPath=l,n.stringValue=r,n.toBoolean=V,n.toDate=C,n.toNumber=H,n.toString=K,n.toSet=L,n.truncate=Q,n.visitArray=X,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"),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})});
{
"name": "vega-util",
"version": "1.3.0",
"version": "1.3.1",
"description": "JavaScript utilities for Vega.",

@@ -30,6 +30,6 @@ "keywords": [

"eslint": "2",
"rollup": "0.36",
"rollup": "0.43",
"tape": "4",
"uglify-js": "2"
"uglify-js": "3"
}
}
}
export default function(fn, fields, name) {
return (
fn.fields = fields || [],
fn.fname = name,
fn
);
fn.fields = fields || [];
fn.fname = name;
return fn;
}

@@ -8,0 +6,0 @@

@@ -9,4 +9,8 @@ import accessor from './accessor';

cmp = (fields = array(fields)).map(function(f, i) {
return f == null ? null
: (idx.push(i), splitAccessPath(f).map(stringValue).join(']['));
if (f == null) {
return null;
} else {
idx.push(i);
return splitAccessPath(f).map(stringValue).join('][');
}
}),

@@ -26,3 +30,9 @@ n = idx.length - 1,

d = '((v=v instanceof Date?+v:v),(u=u instanceof Date?+u:u))';
lt = ord[i] !== 'descending' ? (gt=1, -1) : (gt=-1, 1);
if (ord[i] !== 'descending') {
gt = 1;
lt = -1;
} else {
gt = -1;
lt = 1;
}
code += '(' + u+'<'+v+'||u==null)&&v!=null?' + lt

@@ -39,2 +49,2 @@ + ':(u>v||v==null)&&u!=null?' + gt

);
}
}

@@ -7,14 +7,44 @@ export default function(array, f) {

if (f == null) {
while (++i < n) if ((b = array[i]) != null && b >= b) { a = c = b; break; }
while (++i < n) {
b = array[i];
if (b != null && b >= b) {
a = c = b;
break;
}
}
u = v = i;
while (++i < n) if ((b = array[i]) != null) {
if (a > b) a = b, u = i;
if (c < b) c = b, v = i;
while (++i < n) {
b = array[i];
if (b != null) {
if (a > b) {
a = b;
u = i;
}
if (c < b) {
c = b;
v = i;
}
}
}
} else {
while (++i < n) if ((b = f(array[i], i, array)) != null && b >= b) { a = c = b; break; }
while (++i < n) {
b = f(array[i], i, array);
if (b != null && b >= b) {
a = c = b;
break;
}
}
u = v = i;
while (++i < n) if ((b = f(array[i], i, array)) != null) {
if (a > b) a = b, u = i;
if (c < b) c = b, v = i;
while (++i < n) {
b = f(array[i], i, array);
if (b != null) {
if (a > b) {
a = b;
u = i;
}
if (c < b) {
c = b;
v = i;
}
}
}

@@ -21,0 +51,0 @@ }

@@ -41,3 +41,8 @@ var NULL = {};

test: function(_) {
return arguments.length ? (test = _, map) : test;
if (arguments.length) {
test = _;
return map;
} else {
return test;
}
},

@@ -44,0 +49,0 @@ clean: function() {

@@ -15,3 +15,8 @@ function log(method, level, input) {

level: function(_) {
return arguments.length ? (level = +_, this) : level;
if (arguments.length) {
level = +_;
return this;
} else {
return level;
}
},

@@ -18,0 +23,0 @@ warn: function() {

@@ -21,13 +21,27 @@ import error from './error';

c = p[j];
if (c === '\\') s += p.substring(i, j), i = ++j;
else if (c === q) push(), q = null, b = -1;
else if (q) continue;
else if (i === b && c === '"') i = j + 1, q = c;
else if (i === b && c === "'") i = j + 1, q = c;
else if (c === '.' && !b) (j > i) ? push() : (i = j + 1);
else if (c === '[') {
if (c === '\\') {
s += p.substring(i, j);
i = ++j;
} else if (c === q) {
push();
q = null;
b = -1;
} else if (q) {
continue;
} else if (i === b && c === '"') {
i = j + 1;
q = c;
} else if (i === b && c === "'") {
i = j + 1;
q = c;
} else if (c === '.' && !b) {
if (j > i) {
push();
} else {
i = j + 1;
}
} else if (c === '[') {
if (j > i) push();
b = i = j + 1;
}
else if (c === ']') {
} else if (c === ']') {
if (!b) error('Access path missing open bracket: ' + p);

@@ -42,4 +56,9 @@ if (b > 0) push();

if (q) error('Access path missing closing quote: ' + p);
if (j > i) ++j, push();
if (j > i) {
j++;
push();
}
return path;
}
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