Sha256: e9e921d4734fee9405bef5886c010c80a8f10fe958e5d71bd5d8eed5e616e78d

Contents?: true

Size: 330 Bytes

Versions: 131

Compression:

Stored size: 330 Bytes

Contents

'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);
};

Version data entries

131 entries across 129 versions & 12 rubygems

Version Path
immosquare-cleaner-0.1.62 node_modules/has-flag/index.js
immosquare-cleaner-0.1.61 node_modules/has-flag/index.js
immosquare-cleaner-0.1.60 node_modules/has-flag/index.js
immosquare-cleaner-0.1.59 node_modules/has-flag/index.js
immosquare-cleaner-0.1.58 node_modules/has-flag/index.js
immosquare-cleaner-0.1.57 node_modules/has-flag/index.js
immosquare-cleaner-0.1.56 node_modules/has-flag/index.js
immosquare-cleaner-0.1.55 node_modules/has-flag/index.js
immosquare-cleaner-0.1.54 node_modules/has-flag/index.js
immosquare-cleaner-0.1.53 node_modules/has-flag/index.js
immosquare-cleaner-0.1.52 node_modules/has-flag/index.js
trusty-cms-6.3.1 node_modules/log-symbols/node_modules/has-flag/index.js
trusty-cms-6.3.1 node_modules/stylelint/node_modules/has-flag/index.js
immosquare-cleaner-0.1.51 node_modules/has-flag/index.js
clapton-0.0.26 lib/clapton/javascripts/node_modules/has-flag/index.js
clapton-0.0.25 lib/clapton/javascripts/node_modules/has-flag/index.js
immosquare-cleaner-0.1.50 node_modules/has-flag/index.js
clapton-0.0.24 lib/clapton/javascripts/node_modules/has-flag/index.js
clapton-0.0.23 lib/clapton/javascripts/node_modules/has-flag/index.js
clapton-0.0.22 lib/clapton/javascripts/node_modules/has-flag/index.js