(value: string)
| 58 | // A bare `/` returns an empty string, so callers must check for `undefined` |
| 59 | // rather than for falsiness. |
| 60 | export const commandQuery = (value: string): string | undefined => { |
| 61 | const match = /^\/([a-z-]*)$/.exec(value); |
| 62 | |
| 63 | return match ? match[1] : undefined; |
| 64 | }; |
| 65 | |
| 66 | export const parseCommand = ( |
| 67 | value: string, |
no outgoing calls
no test coverage detected