INNER CODE UNIT · TypeScript
isUsageError
nodejs/corepack · sources/main.ts:44
function isUsageError(error: any): error is UsageError {
return error?.name === `UsageError`;
}
export async function runMain(argv: Array<string>) {
const engine = new Engine();
const [firstArg, ...restArgs] = argv;
const request = getPackageManagerRequestFromCli(firstArg, engine);
if (!request) {
// If the first argument doesn't match any supported package manager, we fallback to the standard Corepack CLI
const cli = new Cli({
binaryLabel: `Corepack`,
binaryName: `corepack`,
binaryVersion: corepackVersion,
});