(target = "")
| 37 | } |
| 38 | |
| 39 | function splitLinkTarget(target = "") { |
| 40 | const hashIndex = target.indexOf("#"); |
| 41 | if (hashIndex === -1) { |
| 42 | return { path: target, hash: "" }; |
| 43 | } |
| 44 | |
| 45 | return { |
| 46 | path: target.slice(0, hashIndex), |
| 47 | hash: target.slice(hashIndex), |
| 48 | }; |
| 49 | } |
| 50 | |
| 51 | export function isExternalLink(target = "") { |
| 52 | return EXTERNAL_LINK_PATTERN.test(String(target).trim()); |
no outgoing calls
no test coverage detected