File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -36,12 +36,13 @@ export function roundAndCheckForNaN(unrounded) {
3636export function processSnapPoints ( unsafeSnaps : number | number [ ] , maxHeight ) {
3737 const safeSnaps = [ ] . concat ( unsafeSnaps ) . map ( roundAndCheckForNaN )
3838
39- const snapPoints = [
40- ...safeSnaps . reduce ( ( acc , snapPoint ) => {
41- acc . add ( clamp ( snapPoint , 0 , maxHeight ) )
42- return acc
43- } , new Set < number > ( ) ) ,
44- ]
39+ const snapPointsDedupedSet = safeSnaps . reduce ( ( acc , snapPoint ) => {
40+ acc . add ( clamp ( snapPoint , 0 , maxHeight ) )
41+ return acc
42+ } , new Set < number > ( ) )
43+
44+ const snapPoints = Array . from ( snapPointsDedupedSet )
45+
4546 const minSnap = Math . min ( ...snapPoints )
4647 if ( Number . isNaN ( minSnap ) ) {
4748 throw new TypeError ( 'minSnap is NaN' )
You can’t perform that action at this time.
0 commit comments