您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

9 行
330B

  1. 'use strict';
  2. module.exports = (flag, argv = process.argv) => {
  3. const prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');
  4. const position = argv.indexOf(prefix + flag);
  5. const terminatorPosition = argv.indexOf('--');
  6. return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
  7. };