securityos/node_modules/next/dist/esm/lib/get-validated-args.js

19 lines
512 B
JavaScript
Raw Normal View History

2024-09-06 15:32:35 +00:00
import arg from "next/dist/compiled/arg/index.js";
import { printAndExit } from "../server/lib/utils";
import isError from "./is-error";
export function getValidatedArgs(validArgs, argv) {
let args;
try {
args = arg(validArgs, {
argv
});
} catch (error) {
if (isError(error) && error.code === "ARG_UNKNOWN_OPTION") {
printAndExit(error.message, 1);
}
throw error;
}
return args;
}
//# sourceMappingURL=get-validated-args.js.map