Urara-Blog/node_modules/.pnpm-store/v3/files/17/4b5d7ec4108f929bfe28012503ef50a56e823a3dd8133d58b9f5fa18870d0f8b890edb9ab4d654e27cf6cf659a09ff4b005ee1edf5bfe1afbc89f27bc4e2c0
2022-08-14 01:14:53 +08:00

8 lines
330 B
Text

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