@antv/s2
Version:
effective spreadsheet render core lib
14 lines • 433 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.vennArr = void 0;
/*
* 数组范围交集,如果没有交集,则返回空数组
* 例如:[1,5], [2,6] -> [2,5]
*/
function vennArr(arr1, arr2) {
const min = Math.max(arr1[0], arr2[0]);
const max = Math.min(arr1[1], arr2[1]);
return min <= max ? [min, max] : [];
}
exports.vennArr = vennArr;
//# sourceMappingURL=veen-arr.js.map