Skip to content

Commit

Permalink
fix: bypass older node version problems
Browse files Browse the repository at this point in the history
  • Loading branch information
AcrylicShrimp committed Mar 4, 2025
1 parent 49bf2e0 commit 8216f9a
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/extract-content.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,9 @@ export function extractContentFromTextDensityMap(
function computeThreshold(
map: Map<domhandler.AnyNode, TextDensityStat>
): number {
const maximumDensitySumStat = map
.values()
.reduce((prev, current) =>
prev.densitySum < current.densitySum ? current : prev
);
const maximumDensitySumStat = Array.from(map.values()).reduce(
(prev, current) => (prev.densitySum < current.densitySum ? current : prev)
);

let candidateStats: TextDensityStat[] = [maximumDensitySumStat];
let parent = maximumDensitySumStat.element.parent;
Expand Down

0 comments on commit 8216f9a

Please sign in to comment.