I had this code
const argv = yargs
.option("applyChanges", {
alias: "a",
description: "Apply the changes",
type: "boolean"
})
.help()
.alias("help", "h").argv;
const options = {
applyChanges: argv.applyChanges ? argv.applyChanges : false
};
to get argv.applyChanges
boolean value. But after the latest update to yargs 17 I get an error on argv.applyChanges
saying
property 'applyChanges' does not exist on type '{ [x: string]: unknown; applyChanges: boolean | undefined; _: (string | number)[]; $0: string; } | Promise<{ [x: string]: unknown; applyChanges: boolean | undefined; _: (string | number)[]; $0: string; }>'. Property 'applyChanges' does not exist on type 'Promise<{ [x: string]: unknown; applyChanges: boolean | undefined; _: (string | number)[]; $0: string; }>'.
I tried to use await
but without success.
What should I do?
This code was working with the previous yargs version 16.x.x