From 989cb4d4acd710c8d2c1d401aa9ba48688f0d1a6 Mon Sep 17 00:00:00 2001 From: Mike Testa Date: Tue, 21 Feb 2017 09:08:17 -0700 Subject: [PATCH] Fix for https://github.com/radswiat/webpack-auto-inject-version/issues/1 --- dist/core/utils.js | 4 +++- src/core/utils.ts | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/dist/core/utils.js b/dist/core/utils.js index c0476f2..d1a7248 100644 --- a/dist/core/utils.js +++ b/dist/core/utils.js @@ -2,7 +2,9 @@ var Utils = (function () { function Utils() { } Utils.isArgv = function (arg) { - return process.argv.indexOf("--" + arg) >= 0 ? true : false; + return Boolean(process.argv.find(function (item) { + return item.substr(0, 2) === '--' && item.indexOf(arg) > -1; + })); }; Utils.merge = function (obj1, obj2) { var obj3 = {}; diff --git a/src/core/utils.ts b/src/core/utils.ts index 6c3fc2c..2cb602e 100644 --- a/src/core/utils.ts +++ b/src/core/utils.ts @@ -1,7 +1,9 @@ class Utils{ static isArgv(arg) { - return process.argv.indexOf(`--${arg}`) >= 0 ? true : false; + return Boolean(process.argv.find(function(item) { + return item.substr(0, 2) === '--' && item.indexOf(arg) > -1; + })); } /**