finki-main
main
|
Last change
on this file since 62b2964 was 81bc7da, checked in by Klimentina Efremova <klimentina08642@…>, 3 months ago |
|
Initial commit
|
-
Property mode
set to
100644
|
|
File size:
320 bytes
|
| Line | |
|---|
| 1 | 'use strict';
|
|---|
| 2 | module.exports = (flag, argv) => {
|
|---|
| 3 | argv = argv || process.argv;
|
|---|
| 4 | const prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');
|
|---|
| 5 | const pos = argv.indexOf(prefix + flag);
|
|---|
| 6 | const terminatorPos = argv.indexOf('--');
|
|---|
| 7 | return pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos);
|
|---|
| 8 | };
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.