(path1: string, path2: string)
| 27 | import range from 'lodash/range'; |
| 28 | |
| 29 | export const compose = (path1: string, path2: string) => { |
| 30 | let p1 = path1; |
| 31 | if (!isEmpty(path1) && !isEmpty(path2) && !path2.startsWith('[')) { |
| 32 | p1 = path1 + '.'; |
| 33 | } |
| 34 | |
| 35 | if (isEmpty(p1)) { |
| 36 | return path2; |
| 37 | } else if (isEmpty(path2)) { |
| 38 | return p1; |
| 39 | } else { |
| 40 | return `${p1}${path2}`; |
| 41 | } |
| 42 | }; |
| 43 | |
| 44 | export { compose as composePaths }; |
| 45 |
no outgoing calls
no test coverage detected
searching dependent graphs…