cleanup formatting attributes

This commit is contained in:
Kevin Jahns
2020-05-11 01:45:27 +02:00
parent 4c87f9a021
commit 4547b35641
4 changed files with 364 additions and 1 deletions

View File

@@ -19,6 +19,22 @@ import * as iterator from 'lib0/iterator.js'
import * as error from 'lib0/error.js'
import * as encoding from 'lib0/encoding.js' // eslint-disable-line
/**
* Accumulate all (list) children of a type and return them as an Array.
*
* @param {AbstractType<any>} t
* @return {Array<Item>}
*/
export const getTypeChildren = t => {
let s = t._start
const arr = []
while (s) {
arr.push(s)
s = s.right
}
return arr
}
/**
* Call event listeners with an event. This will also add an event to all
* parents (for `.observeDeep` handlers).