mirror of
https://github.com/garrytan/gstack.git
synced 2026-09-28 07:32:14 +02:00
* perf: remove repeated test work and preserve AUQ execution budgets * fix: validate native evaluation fixture evidence at its actual boundaries * fix: clarify deployment approval and recovery state transitions * chore: document coverage and release v1.90.2.0 * test: preserve Windows scheduling and native no-change consent * test: recognize verified reads through fixture symlinks * test: isolate alias-name installation from runtime assets
26 lines
1.1 KiB
TypeScript
26 lines
1.1 KiB
TypeScript
/** Inspect lettered consent options, not narration that quotes an unavailable option. */
|
||
export function asideDriveOptions(text: string): string[] {
|
||
const options: string[] = [];
|
||
let current: string | undefined;
|
||
for (const line of text.replaceAll('**', '').split('\n')) {
|
||
const option = line.match(/^[ \t]*(?:[-*+][ \t]+)?[A-D][).][ \t]+(.*)$/);
|
||
if (option) {
|
||
if (current !== undefined) options.push(current);
|
||
current = option[1];
|
||
} else if (current !== undefined && /^[ \t]+\S/.test(line)) {
|
||
current += ` ${line.trim()}`;
|
||
} else if (current !== undefined) {
|
||
options.push(current);
|
||
current = undefined;
|
||
}
|
||
}
|
||
if (current !== undefined) options.push(current);
|
||
return options.filter(option => {
|
||
const currentOffer = option.replace(
|
||
/\b(?:I|we)(?:['’]ll| will) (?:re[- ]?ask|ask again)(?: (?:you|this question))? with (?:the )?(?:"[^"]+"|“[^”]+”|[\w -]+?) option(?: included)?\b/gi,
|
||
'',
|
||
);
|
||
return /\bAside\b/i.test(option) && /\b(?:drive|driving|browse|browsing|navigate|click)\b/i.test(currentOffer);
|
||
});
|
||
}
|