(key: string)
| 25 | * @see https://modelcontextprotocol.io/specification/2025-06-18/basic/index#meta |
| 26 | */ |
| 27 | const getPrefixSegment = (key: string): string | null => { |
| 28 | const trimmedKey = key.trim(); |
| 29 | const slashIndex = trimmedKey.indexOf("/"); |
| 30 | if (slashIndex === -1) { |
| 31 | return null; |
| 32 | } |
| 33 | return trimmedKey.slice(0, slashIndex); |
| 34 | }; |
| 35 | |
| 36 | /** |
| 37 | * Normalizes a potential prefix segment by trimming whitespace, removing schemes, |
no outgoing calls
no test coverage detected