hasFlags
Checks if the current process's arguments contain the specified flags.
- Use
Array.prototype.every()
andArray.prototype.includes()
to check ifprocess.argv
contains all the specified flags. - Use a regular expression to test if the specified flags are prefixed with
-
or--
and prefix them accordingly.