INNER CODE UNIT · TypeScript
maxContiguous
akirarika/milkio · packages/cookbook/src/index.ts:148
maxContiguous = Math.max(maxContiguous, currentContiguous);
} else {
currentContiguous = 0;
}
}
return { maxContiguous, firstMatchIndex };
};
const selected = await (async () => {
const { controller, timeoutId } = createPromptAbortController();
try {
return await search(
{
message: "What kind of command:",
source: async (input) => {
if (!input) return commands;
const filtered = commands.filter((command) => containsCharsInOrder(input.toLowerCase(), command.name.toLowerCase()));