UNPKG

wix-msi

Version:

Package node.js application to a standalone executable and pack it into a msi installer

18 lines (13 loc) 440 B
'use strict' // Check is option was provided by user on cli module.exports = (key, alias) => { const _alias = alias ?? key const regexp = `(^-\\w*[${key}]\\w*)` + // -k or -XkYZ `|(^--(${key}|${_alias})$)` + // --k (seems ok) or --alias `|(^--no-(${key}|${_alias})$)` // --no-k --no-alias const re = new RegExp(regexp) const result = process.argv .slice(2) .find(arg => re.test(arg)) return result !== undefined }