( children: JSXElement, separator?: JSXElement | string, encloseWithId?: boolean, id?: Id, )
| 5 | import {isArray, isUndefined} from '../../common/other.ts'; |
| 6 | |
| 7 | export const wrap = ( |
| 8 | children: JSXElement, |
| 9 | separator?: JSXElement | string, |
| 10 | encloseWithId?: boolean, |
| 11 | id?: Id, |
| 12 | ): JSXElement => { |
| 13 | const separated = |
| 14 | isUndefined(separator) || !isArray(children) |
| 15 | ? children |
| 16 | : arrayMap(children, (child, c) => (c > 0 ? [separator, child] : child)); |
| 17 | return encloseWithId ? [id, ':{', separated, '}'] : separated; |
| 18 | }; |
no test coverage detected
searching dependent graphs…