(a: string, b: string)
| 1640 | } |
| 1641 | |
| 1642 | export function joinUrlSegments(a: string, b: string): string { |
| 1643 | if (!a || !b) { |
| 1644 | return a || b || '' |
| 1645 | } |
| 1646 | if (a.endsWith('/')) { |
| 1647 | a = a.substring(0, a.length - 1) |
| 1648 | } |
| 1649 | if (b[0] !== '/') { |
| 1650 | b = '/' + b |
| 1651 | } |
| 1652 | return a + b |
| 1653 | } |
| 1654 | |
| 1655 | export function removeLeadingSlash(str: string): string { |
| 1656 | return str[0] === '/' ? str.slice(1) : str |
no outgoing calls
no test coverage detected