Skip to main content
variable hasFlags
import { hasFlags } from "https://deno.land/x/30_seconds_of_typescript@v1.0.1/util.ts";

Check if the current arguments contain the specified flags.

Use Array.prototype.every() and Array.prototype.includes() to check if args contains all the specified flags. Use a regular expression to test if the specified flags are prefixed with - or -- and prefix them accordingly.

type

(args: string[], ...flags: string[]) => unknown