chore: run prettier --write .
This commit is contained in:
@@ -6,22 +6,24 @@ import { RTETypeEnum } from "@/types/rte/enums"
|
||||
import type { EmbedByUid } from "@/types/components/jsontohtml"
|
||||
import type { Node } from "@/types/requests/utils/edges"
|
||||
import type { RenderOptions } from "@/types/rte/option"
|
||||
import type { RTENode, RTETextNode, RTERenderOptionComponent } from "@/types/rte/node"
|
||||
import type {
|
||||
RTENode,
|
||||
RTETextNode,
|
||||
RTERenderOptionComponent,
|
||||
} from "@/types/rte/node"
|
||||
import type { Embeds } from "@/types/requests/embeds"
|
||||
|
||||
export function groupEmbedsByUid(embedsArray: Node<Embeds>[]) {
|
||||
const embedsByUid = embedsArray
|
||||
.reduce<EmbedByUid>((acc, embed) => {
|
||||
if (embed.node.system.uid) {
|
||||
acc[embed.node.system.uid] = embed
|
||||
}
|
||||
return acc
|
||||
}, {})
|
||||
const embedsByUid = embedsArray.reduce<EmbedByUid>((acc, embed) => {
|
||||
if (embed.node.system.uid) {
|
||||
acc[embed.node.system.uid] = embed
|
||||
}
|
||||
return acc
|
||||
}, {})
|
||||
|
||||
return embedsByUid
|
||||
}
|
||||
|
||||
|
||||
export function nodeChildrenToHtml(
|
||||
nodes: RTENode[],
|
||||
embeds: EmbedByUid,
|
||||
|
||||
Reference in New Issue
Block a user