项目文件夹

文件
wehub-resource-sync 98e40dac97
CLI Smoke Test / smoke-test-linux (20) (push) Has been cancelled
CLI Smoke Test / smoke-test-linux (24) (push) Has been cancelled
CLI Smoke Test / smoke-test-windows (20) (push) Has been cancelled
CLI Smoke Test / smoke-test-windows (24) (push) Has been cancelled
Expo App TypeScript typecheck / typecheck (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 12:40:49 +08:00

23 行
708 B
TypeScript

export type HackableMode = {
key: string;
name: string;
description?: string | null;
};
export function hackMode<T extends HackableMode>(mode: T): T {
const normalizedName = mode.name.trim().toLowerCase();
const normalizedKey = mode.key.trim().toLowerCase();
if (normalizedName === 'build, build' || (normalizedKey === 'build' && normalizedName === 'build')) {
return { ...mode, name: 'Build' };
}
if (normalizedName === 'plan/plan' || (normalizedKey === 'plan' && normalizedName === 'plan')) {
return { ...mode, name: 'Plan' };
}
return mode;
}
export function hackModes<T extends HackableMode>(modes: T[]): T[] {
return modes.map(hackMode);
}