From 7923aa8942b55884320ef2428417e3ee4b121613 Mon Sep 17 00:00:00 2001 From: Minteck Date: Mon, 28 Nov 2022 17:31:34 +0100 Subject: Initial commit --- MistyCore/node_modules/has-flag/index.js | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 MistyCore/node_modules/has-flag/index.js (limited to 'MistyCore/node_modules/has-flag/index.js') diff --git a/MistyCore/node_modules/has-flag/index.js b/MistyCore/node_modules/has-flag/index.js new file mode 100644 index 0000000..b6f80b1 --- /dev/null +++ b/MistyCore/node_modules/has-flag/index.js @@ -0,0 +1,8 @@ +'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); +}; -- cgit