removes createNode utility

This commit is contained in:
marihachi 2021-04-10 19:03:57 +09:00
parent 150cbd26d5
commit 2d2bea6d3a

View file

@ -1,16 +1,5 @@
import { isMfmBlock, MfmNode, TEXT } from './node'; import { isMfmBlock, MfmNode, TEXT } from './node';
export function createNode(type: string, props?: Record<string, any>, children?: MfmNode[]): MfmNode {
const node: any = { type };
if (props != null) {
node.props = props;
}
if (children != null) {
node.children = children;
}
return node;
}
export function mergeText(nodes: (MfmNode | string)[]): MfmNode[] { export function mergeText(nodes: (MfmNode | string)[]): MfmNode[] {
const dest: MfmNode[] = []; const dest: MfmNode[] = [];
const storedChars: string[] = []; const storedChars: string[] = [];