main
Last change
on this file since 0c6b92a was 0c6b92a, checked in by stefan toskovski <stefantoska84@…>, 5 weeks ago |
Pred finalna verzija
|
-
Property mode
set to
100644
|
File size:
330 bytes
|
Rev | Line | |
---|
[d565449] | 1 | 'use strict';
|
---|
[0c6b92a] | 2 |
|
---|
| 3 | module.exports = (flag, argv = process.argv) => {
|
---|
[d565449] | 4 | const prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');
|
---|
[0c6b92a] | 5 | const position = argv.indexOf(prefix + flag);
|
---|
| 6 | const terminatorPosition = argv.indexOf('--');
|
---|
| 7 | return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
|
---|
[d565449] | 8 | };
|
---|
Note:
See
TracBrowser
for help on using the repository browser.