2023-07-01 03:03:49 +08:00
|
|
|
import { Extension } from '../Extension.js'
|
|
|
|
import { Mark } from '../Mark.js'
|
|
|
|
import { Node } from '../Node.js'
|
|
|
|
import { Extensions } from '../types.js'
|
2020-10-22 03:01:39 +08:00
|
|
|
|
2021-12-06 19:00:09 +08:00
|
|
|
export function splitExtensions(extensions: Extensions) {
|
2020-11-20 04:08:25 +08:00
|
|
|
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[]
|
2020-10-22 03:01:39 +08:00
|
|
|
|
|
|
|
return {
|
|
|
|
baseExtensions,
|
|
|
|
nodeExtensions,
|
2020-10-22 03:13:38 +08:00
|
|
|
markExtensions,
|
2020-10-22 03:01:39 +08:00
|
|
|
}
|
|
|
|
}
|