UNPKG

@milkdown/plugin-clipboard

Version:

The clipboard plugin of [milkdown](https://milkdown.dev/).

16 lines (13 loc) 414 B
type UnknownRecord = Record<string, unknown> export function isPureText( content: UnknownRecord | UnknownRecord[] | undefined | null ): boolean { if (!content) return false if (Array.isArray(content)) { if (content.length > 1) return false return isPureText(content[0]) } const child = content.content if (child) return isPureText(child as UnknownRecord[]) return content.type === 'text' }