mirror of
https://github.com/john-okeefe/foliate-js.git
synced 2026-10-24 22:59:51 -04:00
CFI: export collapse function
This commit is contained in:
1 parent
15aa43bd42
commit
f5bf41def6
1 file changed
+1
-1
+1
-1
@@ -131,7 +131,7 @@ const toInnerString = parsed => parsed.parent
|
|||||||
|
|
||||||
const toString = parsed => wrap(toInnerString(parsed))
|
const toString = parsed => wrap(toInnerString(parsed))
|
||||||
|
|
||||||
const collapse = (x, toEnd) => typeof x === 'string'
|
export const collapse = (x, toEnd) => typeof x === 'string'
|
||||||
? toString(collapse(parse(x), toEnd))
|
? toString(collapse(parse(x), toEnd))
|
||||||
: x.parent ? concatArrays(x.parent, x[toEnd ? 'end' : 'start']) : x
|
: x.parent ? concatArrays(x.parent, x[toEnd ? 'end' : 'start']) : x
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user