mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-12-22 16:17:50 +08:00
e97630c639
* Require .js endings * add extension alias for cypress to resolve ts files with js endings
17 lines
579 B
TypeScript
17 lines
579 B
TypeScript
import { Extension } from '../Extension.js'
|
|
import { Mark } from '../Mark.js'
|
|
import { Node } from '../Node.js'
|
|
import { Extensions } from '../types.js'
|
|
|
|
export function splitExtensions(extensions: Extensions) {
|
|
const baseExtensions = extensions.filter(extension => extension.type === 'extension') as Extension[]
|
|
const nodeExtensions = extensions.filter(extension => extension.type === 'node') as Node[]
|
|
const markExtensions = extensions.filter(extension => extension.type === 'mark') as Mark[]
|
|
|
|
return {
|
|
baseExtensions,
|
|
nodeExtensions,
|
|
markExtensions,
|
|
}
|
|
}
|