Skip to content
This repository has been archived by the owner on Sep 3, 2023. It is now read-only.

Commit

Permalink
fix: node 14.x issue
Browse files Browse the repository at this point in the history
  • Loading branch information
harlan-zw committed Aug 19, 2022
1 parent e385a5f commit c1ec855
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/core/build.ts
Expand Up @@ -20,7 +20,10 @@ export const renderNodesToSchemaOrgHtml = (nodes: RegisteredThing[], options = {

const groupBy = <T>(array: T[], predicate: (value: T, index: number, array: T[]) => string) =>
array.reduce((acc, value, index, array) => {
(acc[predicate(value, index, array)] ||= []).push(value)
const key = predicate(value, index, array)
if (!acc[key])
acc[key] = []
acc[key].push(value)
return acc
}, {} as { [key: string]: T[] })

Expand Down

0 comments on commit c1ec855

Please sign in to comment.