MCPcopy Create free account
hub / github.com/chhoumann/quickadd / extractBareFlagPart

Function extractBareFlagPart

src/utils/pipeSyntax.ts:36–49  ·  view source on GitHub ↗
(
	parts: string[],
	flag: string,
)

Source from the content-addressed store, hash-verified

34 * grammars so the `optional` flag word means the same thing in both.
35 */
36export 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

Callers 4

extractBareOptionalFlagFunction · 0.90
extractBareValueFlagsFunction · 0.90
parseVDateOptionsFunction · 0.90
parseFileTokenFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected