ranges-set
Advanced tools
Comparing version 1.1.2 to 1.1.3
@@ -1,2 +0,2 @@ | ||
var r=/^\s*(?:0|[1-9]\d*)\s*$/,n=/^\s*(0|[1-9]\d*)\s*-\s*(0|[1-9]\d*)\s*$/;function t(r,n){if(r.t!==n.t)return r.t-n.t;switch(r.t){case 0:return r.u>=n.u?r.u>n.u?1:0:-1;case 1:return r.i-n.i||r.o-n.o}}function u(r,n){var t,u,e,i,f,c,o=[];r:for(t=0;t<r.length;++t){switch((u=r[t]).t){case 0:for(e=0;e<n.length;++e)if(0===(i=n[e]).t&&i.u===u.u)continue r;break;case 1:for(f=0;f<n.length;++f)if(1===(c=n[f]).t){if(u.i>=c.i&&u.o<=c.o)continue r;if(u.i<=c.i&&u.o>=c.o){u.o>c.o&&r.splice(t+1,0,{t:1,i:c.o+1,o:u.o}),u.i<c.i&&r.splice(t+1,0,{t:1,i:u.i,o:c.i-1});continue r}u.i>=c.i&&u.i<=c.o?u.i=c.o+1:u.o>=c.i&&u.o<=c.o&&(u.o=c.i-1)}}o.push(u)}return o}function e(r,n){if(r.length!==n.length)return!1;for(var u=0;u<r.length;++u)if(t(r[u],n[u]))return!1;return!0}function i(r){var n,t,u,e=[];for(n=0;n<r.length;++n)switch((t=r[n]).t){case 0:e.push(t.u);break;case 1:for(u=t.i;u<=t.o;++u)e.push(""+u)}return e}function f(r,n){var t,u;if(r.t!==n.t)return null;switch(r.t){case 0:return r.u===n.u?r:null;case 1:return(t=Math.max(r.i,n.i))>(u=Math.min(r.o,n.o))?null:{t:1,i:t,o:u}}}function c(r,n){var t,u,e,i,c=[];for(t=0;t<r.length;++t)for(u=r[t],e=0;e<n.length;++e)null!==(i=f(u,n[e]))&&c.push(i);return c}function o(r){var n,t,u=[],e=r.split(",");for(n=0;n<e.length;++n)(t=e[n])&&v(u,a(t));return u}function a(t){if(r.test(t))return{t:1,i:+t,o:+t};var u=n.exec(t);return u?{t:1,i:+u[1],o:+u[2]}:{t:0,u:t}}function s(r){return r.map(_).join()}function _(r){switch(r.t){case 0:return r.u;case 1:return r.i===r.o?""+r.i:r.i+"-"+r.o}}function x(r,n){var t,u,e,i,f,c;r:for(t=0;t<n.length;++t)switch((u=n[t]).t){case 0:for(e=0;e<r.length;++e)if(0===(i=r[e]).t&&i.u===u.u)continue r;return!1;case 1:for(f=0;f<r.length;++f)if(1===(c=r[f]).t&&c.i<=u.i&&c.o>=u.o)continue r;return!1}return!0}function h(r,n){var t;if(r.t!==n.t)return!1;switch(r.t){case 0:return r.u===n.u;case 1:return(t=r.i<=n.o+1&&r.o>=n.i||n.i<=r.o+1&&n.o>=r.i)&&(r.i=Math.min(r.i,n.i),r.o=Math.max(r.o,n.o)),t}}function v(r,n){for(var u,e,i=0,f=r.length;i<f;){if(!(e=t(n,r[u=i+f>>>1])))return;e<0?f=u:i=u+1}m(r,n,i)||m(r,n,i+1)||r.splice(i,0,n)}function m(r,n,t){if(t&&t<=r.length&&h(r[t-1],n)){for(;t<r.length&&h(r[t-1],r[t]);)r.splice(t,1);return!0}return!1}exports.difference=function(r,n){return s(u(o(r),o(n)))},exports.equal=function(r,n){return e(o(r),o(n))},exports.expand=function(r){return i(o(r))},exports.intersection=function(r,n){return s(c(o(r),o(n)))},exports.normalize=function(r){return s(o(r))},exports.subset=function(r,n){return x(o(r),o(n))},exports.union=function(r,n){return s(o(r+","+n))}; | ||
var r=/^\s*(?:0|[1-9]\d*)\s*$/,n=/^\s*(0|[1-9]\d*)\s*-\s*(0|[1-9]\d*)\s*$/;function t(r,n){if(r.t!==n.t)return r.t-n.t;switch(r.t){case 0:return r.u>=n.u?r.u>n.u?1:0:-1;case 1:return r.i-n.i||r.o-n.o}}function u(r,n){var t,u,e,i,f,c,o=[];r:for(t=0;t<r.length;++t){switch((u=r[t]).t){case 0:for(e=0;e<n.length;++e)if(0===(i=n[e]).t&&i.u===u.u)continue r;break;case 1:for(f=0;f<n.length;++f)if(1===(c=n[f]).t){if(u.i>=c.i&&u.o<=c.o)continue r;if(u.i<=c.i&&u.o>=c.o){u.o>c.o&&r.splice(t+1,0,{t:1,i:c.o+1,o:u.o}),u.i<c.i&&r.splice(t+1,0,{t:1,i:u.i,o:c.i-1});continue r}u.i>=c.i&&u.i<=c.o?u.i=c.o+1:u.o>=c.i&&u.o<=c.o&&(u.o=c.i-1)}}o.push(u)}return o}function e(r,n){if(r.length!==n.length)return!1;for(var u=0;u<r.length;++u)if(t(r[u],n[u]))return!1;return!0}function i(r){var n,t,u,e=[];for(n=0;n<r.length;++n)switch((t=r[n]).t){case 0:e.push(t.u);break;case 1:for(u=t.i;u<=t.o;++u)e.push(""+u)}return e}function f(r,n){var t,u;if(r.t!==n.t)return null;switch(r.t){case 0:return r.u===n.u?r:null;case 1:return(t=Math.max(r.i,n.i))>(u=Math.min(r.o,n.o))?null:{t:1,i:t,o:u}}}function c(r,n){var t,u,e,i,c=[];for(t=0;t<r.length;++t)for(u=r[t],e=0;e<n.length;++e)null!==(i=f(u,n[e]))&&c.push(i);return c}function o(r){var n,t,u=[],e=r.split(",");for(n=0;n<e.length;++n)(t=e[n])&&v(u,a(t));return u}function a(t){if(r.test(t))return{t:1,i:+t,o:+t};var u=n.exec(t);return u?{t:1,i:+u[1],o:+u[2]}:{t:0,u:t.trim()}}function s(r){return r.map(_).join()}function _(r){switch(r.t){case 0:return r.u;case 1:return r.i===r.o?""+r.i:r.i+"-"+r.o}}function x(r,n){var t,u,e,i,f,c;r:for(t=0;t<n.length;++t)switch((u=n[t]).t){case 0:for(e=0;e<r.length;++e)if(0===(i=r[e]).t&&i.u===u.u)continue r;return!1;case 1:for(f=0;f<r.length;++f)if(1===(c=r[f]).t&&c.i<=u.i&&c.o>=u.o)continue r;return!1}return!0}function h(r,n){var t;if(r.t!==n.t)return!1;switch(r.t){case 0:return r.u===n.u;case 1:return(t=r.i<=n.o+1&&r.o>=n.i||n.i<=r.o+1&&n.o>=r.i)&&(r.i=Math.min(r.i,n.i),r.o=Math.max(r.o,n.o)),t}}function v(r,n){for(var u,e,i=0,f=r.length;i<f;){if(!(e=t(n,r[u=i+f>>>1])))return;e<0?f=u:i=u+1}m(r,n,i)||m(r,n,i+1)||r.splice(i,0,n)}function m(r,n,t){if(t&&t<=r.length&&h(r[t-1],n)){for(;t<r.length&&h(r[t-1],r[t]);)r.splice(t,1);return!0}return!1}exports.difference=function(r,n){return s(u(o(r),o(n)))},exports.equal=function(r,n){return e(o(r),o(n))},exports.expand=function(r){return i(o(r))},exports.intersection=function(r,n){return s(c(o(r),o(n)))},exports.normalize=function(r){return s(o(r))},exports.subset=function(r,n){return x(o(r),o(n))},exports.union=function(r,n){return s(o(r+","+n))}; | ||
//# sourceMappingURL=index.js.map |
@@ -1,2 +0,2 @@ | ||
const n=/^\s*(?:0|[1-9]\d*)\s*$/,t=/^\s*(0|[1-9]\d*)\s*-\s*(0|[1-9]\d*)\s*$/;function r(n,t){if(n.t!==t.t)return n.t-t.t;switch(n.t){case 0:return n.u>=t.u?n.u>t.u?1:0:-1;case 1:return n.o-t.o||n.i-t.i}}function e(n,t){return d(c(h(n),h(t)))}function c(n,t){const r=[];n:for(let e=0;e<n.length;++e){const c=n[e];switch(c.t){case 0:for(let n=0;n<t.length;++n){const r=t[n];if(0===r.t&&r.u===c.u)continue n}break;case 1:for(let r=0;r<t.length;++r){const u=t[r];if(1===u.t){if(c.o>=u.o&&c.i<=u.i)continue n;if(c.o<=u.o&&c.i>=u.i){c.i>u.i&&n.splice(e+1,0,{t:1,o:u.i+1,i:c.i}),c.o<u.o&&n.splice(e+1,0,{t:1,o:c.o,i:u.o-1});continue n}c.o>=u.o&&c.o<=u.i?c.o=u.i+1:c.i>=u.o&&c.i<=u.i&&(c.i=u.o-1)}}}r.push(c)}return r}function u(n,t){return o(h(n),h(t))}function o(n,t){if(n.length!==t.length)return!1;for(let e=0;e<n.length;++e)if(r(n[e],t[e]))return!1;return!0}function i(n){return f(h(n))}function f(n){const t=[];for(let r=0;r<n.length;++r){const e=n[r];switch(e.t){case 0:t.push(e.u);break;case 1:for(let n=e.o;n<=e.i;++n)t.push(`${n}`)}}return t}function s(n,t){return d(l(h(n),h(t)))}function a(n,t){if(n.t!==t.t)return null;switch(n.t){case 0:return n.u===t.u?n:null;case 1:{const r=Math.max(n.o,t.o),e=Math.min(n.i,t.i);return r>e?null:{t:1,o:r,i:e}}}}function l(n,t){const r=[];for(let e=0;e<n.length;++e){const c=n[e];for(let n=0;n<t.length;++n){const e=a(c,t[n]);null!==e&&r.push(e)}}return r}function _(n){return d(h(n))}function h(n){const t=[],r=n.split(",");for(let n=0;n<r.length;++n){const e=r[n];e&&b(t,m(e))}return t}function m(r){if(n.test(r))return{t:1,o:+r,i:+r};const e=t.exec(r);return e?{t:1,o:+e[1],i:+e[2]}:{t:0,u:r}}function d(n){return n.map(k).join()}function k(n){switch(n.t){case 0:return n.u;case 1:return n.o===n.i?`${n.o}`:`${n.o}-${n.i}`}}function $(n,t){return w(h(n),h(t))}function w(n,t){n:for(let r=0;r<t.length;++r){const e=t[r];switch(e.t){case 0:for(let t=0;t<n.length;++t){const r=n[t];if(0===r.t&&r.u===e.u)continue n}return!1;case 1:for(let t=0;t<n.length;++t){const r=n[t];if(1===r.t&&r.o<=e.o&&r.i>=e.i)continue n}return!1}}return!0}function x(n,t){return d(h(`${n},${t}`))}function M(n,t){if(n.t!==t.t)return!1;switch(n.t){case 0:return n.u===t.u;case 1:{const r=n.o<=t.i+1&&n.i>=t.o||t.o<=n.i+1&&t.i>=n.o;return r&&(n.o=Math.min(n.o,t.o),n.i=Math.max(n.i,t.i)),r}}}function b(n,t){let e=0,c=n.length;for(;e<c;){const u=e+c>>>1,o=r(t,n[u]);if(!o)return;o<0?c=u:e=u+1}p(n,t,e)||p(n,t,e+1)||n.splice(e,0,t)}function p(n,t,r){if(r&&r<=n.length&&M(n[r-1],t)){for(;r<n.length&&M(n[r-1],n[r]);)n.splice(r,1);return!0}return!1}export{e as difference,u as equal,i as expand,s as intersection,_ as normalize,$ as subset,x as union}; | ||
const n=/^\s*(?:0|[1-9]\d*)\s*$/,t=/^\s*(0|[1-9]\d*)\s*-\s*(0|[1-9]\d*)\s*$/;function r(n,t){if(n.t!==t.t)return n.t-t.t;switch(n.t){case 0:return n.u>=t.u?n.u>t.u?1:0:-1;case 1:return n.o-t.o||n.i-t.i}}function e(n,t){return d(c(h(n),h(t)))}function c(n,t){const r=[];n:for(let e=0;e<n.length;++e){const c=n[e];switch(c.t){case 0:for(let n=0;n<t.length;++n){const r=t[n];if(0===r.t&&r.u===c.u)continue n}break;case 1:for(let r=0;r<t.length;++r){const u=t[r];if(1===u.t){if(c.o>=u.o&&c.i<=u.i)continue n;if(c.o<=u.o&&c.i>=u.i){c.i>u.i&&n.splice(e+1,0,{t:1,o:u.i+1,i:c.i}),c.o<u.o&&n.splice(e+1,0,{t:1,o:c.o,i:u.o-1});continue n}c.o>=u.o&&c.o<=u.i?c.o=u.i+1:c.i>=u.o&&c.i<=u.i&&(c.i=u.o-1)}}}r.push(c)}return r}function u(n,t){return o(h(n),h(t))}function o(n,t){if(n.length!==t.length)return!1;for(let e=0;e<n.length;++e)if(r(n[e],t[e]))return!1;return!0}function i(n){return f(h(n))}function f(n){const t=[];for(let r=0;r<n.length;++r){const e=n[r];switch(e.t){case 0:t.push(e.u);break;case 1:for(let n=e.o;n<=e.i;++n)t.push(`${n}`)}}return t}function s(n,t){return d(l(h(n),h(t)))}function a(n,t){if(n.t!==t.t)return null;switch(n.t){case 0:return n.u===t.u?n:null;case 1:{const r=Math.max(n.o,t.o),e=Math.min(n.i,t.i);return r>e?null:{t:1,o:r,i:e}}}}function l(n,t){const r=[];for(let e=0;e<n.length;++e){const c=n[e];for(let n=0;n<t.length;++n){const e=a(c,t[n]);null!==e&&r.push(e)}}return r}function _(n){return d(h(n))}function h(n){const t=[],r=n.split(",");for(let n=0;n<r.length;++n){const e=r[n];e&&b(t,m(e))}return t}function m(r){if(n.test(r))return{t:1,o:+r,i:+r};const e=t.exec(r);return e?{t:1,o:+e[1],i:+e[2]}:{t:0,u:r.trim()}}function d(n){return n.map(k).join()}function k(n){switch(n.t){case 0:return n.u;case 1:return n.o===n.i?`${n.o}`:`${n.o}-${n.i}`}}function $(n,t){return w(h(n),h(t))}function w(n,t){n:for(let r=0;r<t.length;++r){const e=t[r];switch(e.t){case 0:for(let t=0;t<n.length;++t){const r=n[t];if(0===r.t&&r.u===e.u)continue n}return!1;case 1:for(let t=0;t<n.length;++t){const r=n[t];if(1===r.t&&r.o<=e.o&&r.i>=e.i)continue n}return!1}}return!0}function x(n,t){return d(h(`${n},${t}`))}function M(n,t){if(n.t!==t.t)return!1;switch(n.t){case 0:return n.u===t.u;case 1:{const r=n.o<=t.i+1&&n.i>=t.o||t.o<=n.i+1&&t.i>=n.o;return r&&(n.o=Math.min(n.o,t.o),n.i=Math.max(n.i,t.i)),r}}}function b(n,t){let e=0,c=n.length;for(;e<c;){const u=e+c>>>1,o=r(t,n[u]);if(!o)return;o<0?c=u:e=u+1}p(n,t,e)||p(n,t,e+1)||n.splice(e,0,t)}function p(n,t,r){if(r&&r<=n.length&&M(n[r-1],t)){for(;r<n.length&&M(n[r-1],n[r]);)n.splice(r,1);return!0}return!1}export{e as difference,u as equal,i as expand,s as intersection,_ as normalize,$ as subset,x as union}; | ||
//# sourceMappingURL=index.modern.js.map |
@@ -1,2 +0,2 @@ | ||
var n=/^\s*(?:0|[1-9]\d*)\s*$/,r=/^\s*(0|[1-9]\d*)\s*-\s*(0|[1-9]\d*)\s*$/;function t(n,r){if(n.t!==r.t)return n.t-r.t;switch(n.t){case 0:return n.u>=r.u?n.u>r.u?1:0:-1;case 1:return n.i-r.i||n.o-r.o}}function u(n,r){return d(i(v(n),v(r)))}function i(n,r){var t,u,i,e,f,c,o=[];n:for(t=0;t<n.length;++t){switch((u=n[t]).t){case 0:for(i=0;i<r.length;++i)if(0===(e=r[i]).t&&e.u===u.u)continue n;break;case 1:for(f=0;f<r.length;++f)if(1===(c=r[f]).t){if(u.i>=c.i&&u.o<=c.o)continue n;if(u.i<=c.i&&u.o>=c.o){u.o>c.o&&n.splice(t+1,0,{t:1,i:c.o+1,o:u.o}),u.i<c.i&&n.splice(t+1,0,{t:1,i:u.i,o:c.i-1});continue n}u.i>=c.i&&u.i<=c.o?u.i=c.o+1:u.o>=c.i&&u.o<=c.o&&(u.o=c.i-1)}}o.push(u)}return o}function e(n,r){return f(v(n),v(r))}function f(n,r){if(n.length!==r.length)return!1;for(var u=0;u<n.length;++u)if(t(n[u],r[u]))return!1;return!0}function c(n){return o(v(n))}function o(n){var r,t,u,i=[];for(r=0;r<n.length;++r)switch((t=n[r]).t){case 0:i.push(t.u);break;case 1:for(u=t.i;u<=t.o;++u)i.push(""+u)}return i}function a(n,r){return d(_(v(n),v(r)))}function s(n,r){var t,u;if(n.t!==r.t)return null;switch(n.t){case 0:return n.u===r.u?n:null;case 1:return(t=Math.max(n.i,r.i))>(u=Math.min(n.o,r.o))?null:{t:1,i:t,o:u}}}function _(n,r){var t,u,i,e,f=[];for(t=0;t<n.length;++t)for(u=n[t],i=0;i<r.length;++i)null!==(e=s(u,r[i]))&&f.push(e);return f}function h(n){return d(v(n))}function v(n){var r,t,u=[],i=n.split(",");for(r=0;r<i.length;++r)(t=i[r])&&b(u,m(t));return u}function m(t){if(n.test(t))return{t:1,i:+t,o:+t};var u=r.exec(t);return u?{t:1,i:+u[1],o:+u[2]}:{t:0,u:t}}function d(n){return n.map(k).join()}function k(n){switch(n.t){case 0:return n.u;case 1:return n.i===n.o?""+n.i:n.i+"-"+n.o}}function l(n,r){return w(v(n),v(r))}function w(n,r){var t,u,i,e,f,c;n:for(t=0;t<r.length;++t)switch((u=r[t]).t){case 0:for(i=0;i<n.length;++i)if(0===(e=n[i]).t&&e.u===u.u)continue n;return!1;case 1:for(f=0;f<n.length;++f)if(1===(c=n[f]).t&&c.i<=u.i&&c.o>=u.o)continue n;return!1}return!0}function x(n,r){return d(v(n+","+r))}function M(n,r){var t;if(n.t!==r.t)return!1;switch(n.t){case 0:return n.u===r.u;case 1:return(t=n.i<=r.o+1&&n.o>=r.i||r.i<=n.o+1&&r.o>=n.i)&&(n.i=Math.min(n.i,r.i),n.o=Math.max(n.o,r.o)),t}}function b(n,r){for(var u,i,e=0,f=n.length;e<f;){if(!(i=t(r,n[u=e+f>>>1])))return;i<0?f=u:e=u+1}$(n,r,e)||$(n,r,e+1)||n.splice(e,0,r)}function $(n,r,t){if(t&&t<=n.length&&M(n[t-1],r)){for(;t<n.length&&M(n[t-1],n[t]);)n.splice(t,1);return!0}return!1}export{u as difference,e as equal,c as expand,a as intersection,h as normalize,l as subset,x as union}; | ||
var n=/^\s*(?:0|[1-9]\d*)\s*$/,r=/^\s*(0|[1-9]\d*)\s*-\s*(0|[1-9]\d*)\s*$/;function t(n,r){if(n.t!==r.t)return n.t-r.t;switch(n.t){case 0:return n.u>=r.u?n.u>r.u?1:0:-1;case 1:return n.i-r.i||n.o-r.o}}function u(n,r){return d(i(v(n),v(r)))}function i(n,r){var t,u,i,e,f,c,o=[];n:for(t=0;t<n.length;++t){switch((u=n[t]).t){case 0:for(i=0;i<r.length;++i)if(0===(e=r[i]).t&&e.u===u.u)continue n;break;case 1:for(f=0;f<r.length;++f)if(1===(c=r[f]).t){if(u.i>=c.i&&u.o<=c.o)continue n;if(u.i<=c.i&&u.o>=c.o){u.o>c.o&&n.splice(t+1,0,{t:1,i:c.o+1,o:u.o}),u.i<c.i&&n.splice(t+1,0,{t:1,i:u.i,o:c.i-1});continue n}u.i>=c.i&&u.i<=c.o?u.i=c.o+1:u.o>=c.i&&u.o<=c.o&&(u.o=c.i-1)}}o.push(u)}return o}function e(n,r){return f(v(n),v(r))}function f(n,r){if(n.length!==r.length)return!1;for(var u=0;u<n.length;++u)if(t(n[u],r[u]))return!1;return!0}function c(n){return o(v(n))}function o(n){var r,t,u,i=[];for(r=0;r<n.length;++r)switch((t=n[r]).t){case 0:i.push(t.u);break;case 1:for(u=t.i;u<=t.o;++u)i.push(""+u)}return i}function a(n,r){return d(_(v(n),v(r)))}function s(n,r){var t,u;if(n.t!==r.t)return null;switch(n.t){case 0:return n.u===r.u?n:null;case 1:return(t=Math.max(n.i,r.i))>(u=Math.min(n.o,r.o))?null:{t:1,i:t,o:u}}}function _(n,r){var t,u,i,e,f=[];for(t=0;t<n.length;++t)for(u=n[t],i=0;i<r.length;++i)null!==(e=s(u,r[i]))&&f.push(e);return f}function h(n){return d(v(n))}function v(n){var r,t,u=[],i=n.split(",");for(r=0;r<i.length;++r)(t=i[r])&&b(u,m(t));return u}function m(t){if(n.test(t))return{t:1,i:+t,o:+t};var u=r.exec(t);return u?{t:1,i:+u[1],o:+u[2]}:{t:0,u:t.trim()}}function d(n){return n.map(k).join()}function k(n){switch(n.t){case 0:return n.u;case 1:return n.i===n.o?""+n.i:n.i+"-"+n.o}}function l(n,r){return w(v(n),v(r))}function w(n,r){var t,u,i,e,f,c;n:for(t=0;t<r.length;++t)switch((u=r[t]).t){case 0:for(i=0;i<n.length;++i)if(0===(e=n[i]).t&&e.u===u.u)continue n;return!1;case 1:for(f=0;f<n.length;++f)if(1===(c=n[f]).t&&c.i<=u.i&&c.o>=u.o)continue n;return!1}return!0}function x(n,r){return d(v(n+","+r))}function M(n,r){var t;if(n.t!==r.t)return!1;switch(n.t){case 0:return n.u===r.u;case 1:return(t=n.i<=r.o+1&&n.o>=r.i||r.i<=n.o+1&&r.o>=n.i)&&(n.i=Math.min(n.i,r.i),n.o=Math.max(n.o,r.o)),t}}function b(n,r){for(var u,i,e=0,f=n.length;e<f;){if(!(i=t(r,n[u=e+f>>>1])))return;i<0?f=u:e=u+1}$(n,r,e)||$(n,r,e+1)||n.splice(e,0,r)}function $(n,r,t){if(t&&t<=n.length&&M(n[t-1],r)){for(;t<n.length&&M(n[t-1],n[t]);)n.splice(t,1);return!0}return!1}export{u as difference,e as equal,c as expand,a as intersection,h as normalize,l as subset,x as union}; | ||
//# sourceMappingURL=index.module.js.map |
@@ -46,3 +46,3 @@ const enum Kind { | ||
// eslint-disable-next-line complexity | ||
// eslint-disable-next-line complexity -- This function IS complex. | ||
function differenceReprs(reprsA: MReprs, reprsB: IReprs): MReprs { | ||
@@ -220,3 +220,3 @@ const reprs: MReprs = []; | ||
return { _kind: Kind.Literal, _text: text }; | ||
return { _kind: Kind.Literal, _text: text.trim() }; | ||
} | ||
@@ -313,3 +313,3 @@ | ||
while (low < high) { | ||
// eslint-disable-next-line no-bitwise | ||
// eslint-disable-next-line no-bitwise -- This is much faster than Math.floor. | ||
const middle = (low + high) >>> 1; | ||
@@ -316,0 +316,0 @@ const result = compare(repr, reprs[middle]); |
{ | ||
"name": "ranges-set", | ||
"version": "1.1.2", | ||
"version": "1.1.3", | ||
"description": "Set operations on human-friendly ranges.", | ||
@@ -27,2 +27,3 @@ "license": "MIT", | ||
"build": "microbundle --format cjs,es,modern", | ||
"clean": "rm -f index.{d.ts,{js,m{odern,odule}.js}{,.map}}", | ||
"coverage": "nyc --reporter lcov --reporter text npm test", | ||
@@ -34,3 +35,3 @@ "lint": "eslint --ignore-path .gitignore .", | ||
"ava": "3.15.0", | ||
"eslint-config-vazco": "6.1.0", | ||
"eslint-config-vazco": "6.2.0", | ||
"microbundle": "0.13.3", | ||
@@ -37,0 +38,0 @@ "nyc": "15.1.0", |
@@ -63,2 +63,3 @@ import test from 'ava'; | ||
['1', '1', true], | ||
['1', ' 1 ', true], | ||
['1', '1-2', false], | ||
@@ -71,2 +72,3 @@ ['1', '2', false], | ||
['1-2', '1-2', true], | ||
['1-2', ' 1 - 2 ', true], | ||
['1-2', '2', false], | ||
@@ -88,3 +90,5 @@ ['1-2,3,4-5', '1-5', true], | ||
['a', 'a', true], | ||
['a', ' a ', true], | ||
['a', 'b', false], | ||
['a,1', ' a , 1 ', true], | ||
['a,1', 'b,1', false], | ||
@@ -91,0 +95,0 @@ ['a,1', 'b,2', false], |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
64931
578