pixiu-number-toolkit
Version:
A collection of number utilities.
8 lines (6 loc) • 455 B
JavaScript
;
function u(n){let a=n.sort((e,r)=>e.start-r.start);return {breakpoints:a.map(e=>e.start),values:a.map(e=>e.value)}}function i(n,a){let{breakpoints:e,values:r}=a,l=0,s=e.length-1;if(n<e[0])return null;for(;l<=s;){let t=Math.floor((l+s)/2);if(n>=e[t]){if(t===e.length-1||n<e[t+1])return r[t];l=t+1;}else s=t-1;}return null}
exports.a = u;
exports.b = i;
//# sourceMappingURL=chunk-A4GPCTFO.cjs.map
//# sourceMappingURL=chunk-A4GPCTFO.cjs.map