move extension helper functions to separate files

This commit is contained in:
Hans Pagel
2020-09-04 12:10:35 +02:00
parent 7525ff5726
commit 55817b9be4
5 changed files with 37 additions and 27 deletions

View File

@@ -0,0 +1,10 @@
import Mark from '../Mark'
import collect from 'collect.js'
import { Extensions } from '../types'
export default function getMarksFromExtensions(extensions: Extensions): any {
return collect(extensions)
.where('extensionType', 'mark')
.mapWithKeys((extension: Mark) => [extension.name, extension.schema()])
.all()
}