mirror of https://github.com/onivim/oni.git
Use `.some` to short circuit & native `.includes` (#2697)
`Array.prototype.some` short-circuits when a value is true which is better for performance and makes the intention more clear. Native `String.prototype.includes` is easier to read. Now reading it as English, "if some argument includes 'verbose'"...
This commit is contained in:
parent
ea0aed3213
commit
f4014abea8
|
@ -9,7 +9,7 @@ const logs = []
|
|||
let _isVerbose = false
|
||||
|
||||
const isVerbose = () =>
|
||||
process.argv.filter(arg => arg.indexOf("--verbose") >= 0).length > 0 || _isVerbose
|
||||
process.argv.some(arg => arg.includes("--verbose")) || _isVerbose
|
||||
|
||||
export const setVerbose = (verbose: boolean) => {
|
||||
_isVerbose = verbose
|
||||
|
|
Loading…
Reference in New Issue