( parts: string[], flag: string, )
| 34 | * grammars so the `optional` flag word means the same thing in both. |
| 35 | */ |
| 36 | export function extractBareFlagPart( |
| 37 | parts: string[], |
| 38 | flag: string, |
| 39 | ): { remaining: string[]; found: boolean } { |
| 40 | let found = false; |
| 41 | const remaining = parts.filter((part) => { |
| 42 | if (part.trim().toLowerCase() === flag) { |
| 43 | found = true; |
| 44 | return false; |
| 45 | } |
| 46 | return true; |
| 47 | }); |
| 48 | return { remaining, found }; |
| 49 | } |
| 50 |
no outgoing calls
no test coverage detected