Skip to content

Commit

Permalink
chore(block-node): add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyamore88 committed Aug 15, 2023
1 parent 8f65294 commit 933cfc6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/entities/BlockNode/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ export class BlockNode {
.entries(this.#data)
.reduce(
(acc, [dataKey, value]) => {
/**
* If the value is an array, we need to serialize each node in the array
* Value is an array if the BlockNode contains TextNodes and FormattingNodes
*/
if (value instanceof Array) {
acc[dataKey] = value.map((node) => node.serialized);

Expand Down

0 comments on commit 933cfc6

Please sign in to comment.