From d0d438330fdb786d21e05283c15b8b431fc85e09 Mon Sep 17 00:00:00 2001 From: Luffy <52o@qq52o.cn> Date: Fri, 3 Jan 2025 13:45:03 +0800 Subject: [PATCH] chore: format code --- src/core/event/index.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/core/event/index.js b/src/core/event/index.js index c76430534..2bdacfcc8 100644 --- a/src/core/event/index.js +++ b/src/core/event/index.js @@ -99,11 +99,16 @@ export function Events(Base) { if (headingsInView.size === 1) { activeHeading = headingsInView.values().next().value; } else if (headingsInView.size > 1) { - activeHeading = Array.from(headingsInView).reduce((closest, current) => { - return !closest || (closest.compareDocumentPosition(current) & Node.DOCUMENT_POSITION_FOLLOWING) - ? current - : closest; - }, null); + activeHeading = Array.from(headingsInView).reduce( + (closest, current) => { + return !closest || + closest.compareDocumentPosition(current) & + Node.DOCUMENT_POSITION_FOLLOWING + ? current + : closest; + }, + null, + ); } if (activeHeading) {