1.3.2 • Published 3 years ago
common-js-methods v1.3.2
common-js-methods 提供了一些常用的方法。
debounce
throttle
easyDeepClone
deepClone
How to deep clone a JavaScript object
isOverlap
判断两个闭合区间是否重叠。
Math.min(end1,end2) >= Math.max(start1,start2)
多区间是否重叠
const segments = [
[1, 3],
[2, 3],
[4, 8],
];
const result = multiSegmentsIsOverlap(segments); // true
参考文献
How to publish packages to npm (the way the industry does things) TypeScript-Node-Starter