.gitignore added
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / prettier-tslint / node_modules / has-flag / index.js
diff --git a/.config/coc/extensions/node_modules/coc-prettier/node_modules/prettier-tslint/node_modules/has-flag/index.js b/.config/coc/extensions/node_modules/coc-prettier/node_modules/prettier-tslint/node_modules/has-flag/index.js
new file mode 100644 (file)
index 0000000..5139728
--- /dev/null
@@ -0,0 +1,8 @@
+'use strict';
+module.exports = (flag, argv) => {
+       argv = argv || process.argv;
+       const prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');
+       const pos = argv.indexOf(prefix + flag);
+       const terminatorPos = argv.indexOf('--');
+       return pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos);
+};