vega-event-selector
Advanced tools
Comparing version 2.0.2 to 2.0.3
@@ -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="]",s="{",f="}",u=":",c=",",l="@",a=">",h=/[[\]{}]/,p={"*":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 m(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 g(e){for(var t=[],r=0,n=e.length,u=0;u<n;)u=m(e,u,c,i+s,o+f),t.push(e.substring(r,u).trim()),r=++u;if(0===t.length)throw"Empty event selector: "+e;return t}function w(e){return"["===e[0]?function(e){var t,r,n=e.length,s=1;if((s=m(e,s,o,i,o))===n)throw"Empty between selector: "+e;if(2!==(t=g(e.substring(1,s))).length)throw"Between selector must have two elements: "+e;if((e=e.slice(s+1).trim())[0]!==a)throw"Expected '>' after between selector: "+e;if(t=t.map(w),(r=w(e.slice(1).trim())).between)return{between:t,stream:r};r.between=t;return r}(e):function(e){var n,a,p={source:t},g=[],w=[0,0],b=0,d=0,v=e.length,y=0;if(e[v-1]===f){if(!((y=e.lastIndexOf(s))>=0))throw"Unmatched right brace: "+e;try{w=function(e){var t=e.split(c);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(y+1,v-1))}catch(t){throw"Invalid throttle specification: "+e}e=e.slice(0,y).trim(),v=e.length,y=0}if(!v)throw e;e[0]===l&&(b=++y);(n=m(e,y,u))<v&&(g.push(e.substring(d,n).trim()),d=y=++n);if((y=m(e,y,i))===v)g.push(e.substring(d,v).trim());else if(g.push(e.substring(d,y).trim()),a=[],(d=++y)===v)throw"Unmatched left bracket: "+e;for(;y<v;){if((y=m(e,y,o))===v)throw"Unmatched left bracket: "+e;if(a.push(e.substring(d,y).trim()),y<v-1&&e[++y]!==i)throw"Expected left bracket: "+e;d=++y}if(!(v=g.length)||h.test(g[v-1]))throw"Invalid event selector: "+e;v>1?(p.type=g[1],b?p.markname=g[0].slice(1):(x=g[0],r[x]?p.marktype=g[0]:p.source=g[0])):p.type=g[0];var x;"!"===p.type.slice(-1)&&(p.consume=!0,p.type=p.type.slice(0,-1));null!=a&&(p.filter=a);w[0]&&(p.throttle=w[0]);w[1]&&(p.debounce=w[1]);return p}(e)}e.selector=function(e,i,o){return t=i||n,r=o||p,g(e.trim()).map(w)},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=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})})); |
{ | ||
"name": "vega-event-selector", | ||
"version": "2.0.2", | ||
"version": "2.0.3", | ||
"description": "A CSS-inspired language to select, sequence, and compose DOM events.", | ||
@@ -22,7 +22,7 @@ "keywords": [ | ||
"pretest": "yarn prebuild && yarn rollup", | ||
"test": "tape 'test/**/*-test.js' && eslint index.js src test", | ||
"test": "tape 'test/**/*-test.js'", | ||
"prepublishOnly": "yarn test && yarn build", | ||
"postpublish": "git push && git push --tags" | ||
}, | ||
"gitHead": "b690910bacfcb2580511e262400e496d9b14b04f" | ||
"gitHead": "35e31c5c6b54db9dc3a577b5adad8d15ec274d32" | ||
} |
@@ -191,3 +191,3 @@ /** | ||
stream.consume = true; | ||
stream.type = stream.type.slice(0, -1) | ||
stream.type = stream.type.slice(0, -1); | ||
} | ||
@@ -194,0 +194,0 @@ if (filter != null) stream.filter = filter; |
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
15481