1 | const isProcess = (list) => {
|
2 | let result = false;
|
3 | const index = process.argv.findIndex(value => list.includes(value));
|
4 | const isBoolean = (process.argv[index + 1] === 'true' || process.argv[index + 1] === 'false');
|
5 | if (index >= 0) {
|
6 | if (isBoolean || process.argv[index + 1] !== 'false') result = true;
|
7 | }
|
8 | return result;
|
9 | };
|
10 |
|
11 | module.exports = isProcess; |
\ | No newline at end of file |