CFI: export collapse function

This commit is contained in:
John Factotum authored and GitHub committed 2023-03-07 06:44:36 +00:00
1 parent 15aa43bd42
commit f5bf41def6
1 file changed
+1 -1
+1 -1
View File
@@ -131,7 +131,7 @@ const toInnerString = parsed => parsed.parent
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))
: x.parent ? concatArrays(x.parent, x[toEnd ? 'end' : 'start']) : x