vega-event-selector
Advanced tools
Comparing version 2.0.3 to 2.0.4
(function (global, factory) { | ||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : | ||
typeof define === 'function' && define.amd ? define(['exports'], factory) : | ||
(global = global || self, factory(global.vega = {})); | ||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.vega = {})); | ||
}(this, (function (exports) { 'use strict'; | ||
@@ -17,3 +17,3 @@ | ||
var VIEW = 'view', | ||
let VIEW = 'view', | ||
LBRACK = '[', | ||
@@ -51,3 +51,3 @@ RBRACK = ']', | ||
function find(s, i, endChar, pushChar, popChar) { | ||
var count = 0, | ||
let count = 0, | ||
n = s.length, | ||
@@ -65,3 +65,3 @@ c; | ||
function parseMerge(s) { | ||
var output = [], | ||
let output = [], | ||
start = 0, | ||
@@ -90,3 +90,3 @@ n = s.length, | ||
function parseBetween(s) { | ||
var n = s.length, | ||
let n = s.length, | ||
i = 1, | ||
@@ -126,3 +126,3 @@ b, stream; | ||
function parseStream(s) { | ||
var stream = {source: DEFAULT_SOURCE}, | ||
let stream = {source: DEFAULT_SOURCE}, | ||
source = [], | ||
@@ -212,6 +212,6 @@ throttle = [0, 0], | ||
function parseThrottle(s) { | ||
var a = s.split(COMMA); | ||
const a = s.split(COMMA); | ||
if (!s.length || a.length > 2) throw s; | ||
return a.map(function(_) { | ||
var x = +_; | ||
const x = +_; | ||
if (x !== x) throw s; | ||
@@ -218,0 +218,0 @@ return x; |
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self).vega={})}(this,(function(e){"use strict";var t,r,n="view",i=/[[\]{}]/,o={"*":1,arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1};function s(e,t,r,n,i){for(var o,s=0,f=e.length;t<f;++t){if(o=e[t],!s&&o===r)return t;i&&i.indexOf(o)>=0?--s:n&&n.indexOf(o)>=0&&++s}return t}function f(e){for(var t=[],r=0,n=e.length,i=0;i<n;)i=s(e,i,",","[{","]}"),t.push(e.substring(r,i).trim()),r=++i;if(0===t.length)throw"Empty event selector: "+e;return t}function u(e){return"["===e[0]?function(e){var t,r,n=e.length,i=1;if((i=s(e,i,"]","[","]"))===n)throw"Empty between selector: "+e;if(2!==(t=f(e.substring(1,i))).length)throw"Between selector must have two elements: "+e;if(">"!==(e=e.slice(i+1).trim())[0])throw"Expected '>' after between selector: "+e;if(t=t.map(u),(r=u(e.slice(1).trim())).between)return{between:t,stream:r};r.between=t;return r}(e):function(e){var n,o,f={source:t},u=[],c=[0,0],l=0,a=0,h=e.length,p=0;if("}"===e[h-1]){if(!((p=e.lastIndexOf("{"))>=0))throw"Unmatched right brace: "+e;try{c=function(e){var t=e.split(",");if(!e.length||t.length>2)throw e;return t.map((function(t){var r=+t;if(r!=r)throw e;return r}))}(e.substring(p+1,h-1))}catch(t){throw"Invalid throttle specification: "+e}e=e.slice(0,p).trim(),h=e.length,p=0}if(!h)throw e;"@"===e[0]&&(l=++p);(n=s(e,p,":"))<h&&(u.push(e.substring(a,n).trim()),a=p=++n);if((p=s(e,p,"["))===h)u.push(e.substring(a,h).trim());else if(u.push(e.substring(a,p).trim()),o=[],(a=++p)===h)throw"Unmatched left bracket: "+e;for(;p<h;){if((p=s(e,p,"]"))===h)throw"Unmatched left bracket: "+e;if(o.push(e.substring(a,p).trim()),p<h-1&&"["!==e[++p])throw"Expected left bracket: "+e;a=++p}if(!(h=u.length)||i.test(u[h-1]))throw"Invalid event selector: "+e;h>1?(f.type=u[1],l?f.markname=u[0].slice(1):(m=u[0],r[m]?f.marktype=u[0]:f.source=u[0])):f.type=u[0];var m;"!"===f.type.slice(-1)&&(f.consume=!0,f.type=f.type.slice(0,-1));null!=o&&(f.filter=o);c[0]&&(f.throttle=c[0]);c[1]&&(f.debounce=c[1]);return f}(e)}e.selector=function(e,i,s){return t=i||n,r=s||o,f(e.trim()).map(u)},Object.defineProperty(e,"__esModule",{value:!0})})); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).vega={})}(this,(function(e){"use strict";let t,r,n="view",i=/[[\]{}]/,o={"*":1,arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1};function s(e,t,r,n,i){let o,s=0,l=e.length;for(;t<l;++t){if(o=e[t],!s&&o===r)return t;i&&i.indexOf(o)>=0?--s:n&&n.indexOf(o)>=0&&++s}return t}function l(e){let t=[],r=0,n=e.length,i=0;for(;i<n;)i=s(e,i,",","[{","]}"),t.push(e.substring(r,i).trim()),r=++i;if(0===t.length)throw"Empty event selector: "+e;return t}function f(e){return"["===e[0]?function(e){let t,r,n=e.length,i=1;if(i=s(e,i,"]","[","]"),i===n)throw"Empty between selector: "+e;if(t=l(e.substring(1,i)),2!==t.length)throw"Between selector must have two elements: "+e;if(">"!==(e=e.slice(i+1).trim())[0])throw"Expected '>' after between selector: "+e;if(t=t.map(f),r=f(e.slice(1).trim()),r.between)return{between:t,stream:r};r.between=t;return r}(e):function(e){let n,o,l={source:t},f=[],c=[0,0],u=0,h=0,a=e.length,p=0;if("}"===e[a-1]){if(p=e.lastIndexOf("{"),!(p>=0))throw"Unmatched right brace: "+e;try{c=function(e){const t=e.split(",");if(!e.length||t.length>2)throw e;return t.map((function(t){const r=+t;if(r!=r)throw e;return r}))}(e.substring(p+1,a-1))}catch(t){throw"Invalid throttle specification: "+e}a=(e=e.slice(0,p).trim()).length,p=0}if(!a)throw e;"@"===e[0]&&(u=++p);n=s(e,p,":"),n<a&&(f.push(e.substring(h,n).trim()),h=p=++n);if(p=s(e,p,"["),p===a)f.push(e.substring(h,a).trim());else if(f.push(e.substring(h,p).trim()),o=[],h=++p,h===a)throw"Unmatched left bracket: "+e;for(;p<a;){if(p=s(e,p,"]"),p===a)throw"Unmatched left bracket: "+e;if(o.push(e.substring(h,p).trim()),p<a-1&&"["!==e[++p])throw"Expected left bracket: "+e;h=++p}if(!(a=f.length)||i.test(f[a-1]))throw"Invalid event selector: "+e;a>1?(l.type=f[1],u?l.markname=f[0].slice(1):(m=f[0],r[m]?l.marktype=f[0]:l.source=f[0])):l.type=f[0];var m;"!"===l.type.slice(-1)&&(l.consume=!0,l.type=l.type.slice(0,-1));null!=o&&(l.filter=o);c[0]&&(l.throttle=c[0]);c[1]&&(l.debounce=c[1]);return l}(e)}e.selector=function(e,i,s){return t=i||n,r=s||o,l(e.trim()).map(f)},Object.defineProperty(e,"__esModule",{value:!0})})); |
{ | ||
"name": "vega-event-selector", | ||
"version": "2.0.3", | ||
"version": "2.0.4", | ||
"description": "A CSS-inspired language to select, sequence, and compose DOM events.", | ||
@@ -26,3 +26,3 @@ "keywords": [ | ||
}, | ||
"gitHead": "35e31c5c6b54db9dc3a577b5adad8d15ec274d32" | ||
"gitHead": "28db83352e43e321dfe55fc5cb6489b211e45662" | ||
} |
@@ -11,3 +11,3 @@ /** | ||
var VIEW = 'view', | ||
let VIEW = 'view', | ||
LBRACK = '[', | ||
@@ -45,3 +45,3 @@ RBRACK = ']', | ||
function find(s, i, endChar, pushChar, popChar) { | ||
var count = 0, | ||
let count = 0, | ||
n = s.length, | ||
@@ -59,3 +59,3 @@ c; | ||
function parseMerge(s) { | ||
var output = [], | ||
let output = [], | ||
start = 0, | ||
@@ -84,3 +84,3 @@ n = s.length, | ||
function parseBetween(s) { | ||
var n = s.length, | ||
let n = s.length, | ||
i = 1, | ||
@@ -120,3 +120,3 @@ b, stream; | ||
function parseStream(s) { | ||
var stream = {source: DEFAULT_SOURCE}, | ||
let stream = {source: DEFAULT_SOURCE}, | ||
source = [], | ||
@@ -206,6 +206,6 @@ throttle = [0, 0], | ||
function parseThrottle(s) { | ||
var a = s.split(COMMA); | ||
const a = s.split(COMMA); | ||
if (!s.length || a.length > 2) throw s; | ||
return a.map(function(_) { | ||
var x = +_; | ||
const x = +_; | ||
if (x !== x) throw s; | ||
@@ -212,0 +212,0 @@ return x; |
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
15586