first commit
This commit is contained in:
8
node_modules/vant/es/utils/closest.mjs
generated
vendored
Normal file
8
node_modules/vant/es/utils/closest.mjs
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
function closest(arr, target) {
|
||||
return arr.reduce(
|
||||
(pre, cur) => Math.abs(pre - target) < Math.abs(cur - target) ? pre : cur
|
||||
);
|
||||
}
|
||||
export {
|
||||
closest
|
||||
};
|
||||
Reference in New Issue
Block a user