Skip to content

Commit ed720b1

Browse files
committed
Add className & text content utilities
1 parent 195b7c6 commit ed720b1

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/utils.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { DecorationType } from "./types";
2+
3+
export const classNames = (...classes: Array<string | undefined | false>) =>
4+
classes.filter(a => !!a).join(" ");
5+
6+
export const getTextContent = (text: DecorationType[]) => {
7+
return text.reduce((prev, current) => prev + current[0], "");
8+
};

0 commit comments

Comments
 (0)