Skip to content

Commit

Permalink
fix: remove handling fields other than text in slateToText
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierniki committed Sep 5, 2023
1 parent 8d41ba9 commit 33c26e1
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions utils/slateToText.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { isArray, isObject, isString, values } from "lodash"
import { isArray, isObject, values } from "lodash"

export function slateToText(obj: unknown): string {
if (isObject(obj)) {
Expand All @@ -10,6 +10,5 @@ export function slateToText(obj: unknown): string {
.reduce((acc, val) => acc + val, "")
}
if (isArray(obj)) return obj.map(slateToText).reduce((acc, val) => acc + val, "")
if (isString(obj)) return obj
return ""
}

0 comments on commit 33c26e1

Please sign in to comment.