diff --git a/dist/smartcli.getters.js b/dist/smartcli.getters.js index 7c792b1..69cd7b9 100644 --- a/dist/smartcli.getters.js +++ b/dist/smartcli.getters.js @@ -46,12 +46,12 @@ exports.commandArgs = function () { var argsArray = exports.commandArray().slice(0); argsArray.shift(); for (var item in argsArray) { - var commandArgument = { + var commandArgument_1 = { specified: true, name: argsArray[item], - level: item + 1 + level: parseInt(item) + 1 }; - commandArgs.push(commandArgument); + commandArgs.push(commandArgument_1); } return commandArgs; }; @@ -100,4 +100,4 @@ exports.cwd = function () { }; }; -//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNtYXJ0Y2xpLmdldHRlcnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsMENBQTBDO0FBQzFDLGlEQUFpRDs7QUFFakQsSUFBTyxPQUFPLFdBQVcsb0JBQW9CLENBQUMsQ0FBQztBQUMvQyxJQUFPLGNBQWMsV0FBVyxtQkFBbUIsQ0FBQyxDQUFDO0FBRXJEOzs7O0dBSUc7QUFDUSxlQUFPLEdBQUc7SUFDakIsSUFBSSxVQUFVLEdBQUc7UUFDYixTQUFTLEVBQUUsY0FBYyxDQUFDLGVBQWUsRUFBRTtRQUMzQyxJQUFJLEVBQUUsT0FBTyxDQUFDLElBQUksQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO1FBQ3ZCLFNBQVMsRUFBRSxtQkFBVyxFQUFFO0tBQzNCLENBQUE7SUFDRCxNQUFNLENBQUMsVUFBVSxDQUFDO0FBQ3RCLENBQUMsQ0FBQztBQUVGOzs7O0dBSUc7QUFDUSx1QkFBZSxHQUFHLFVBQVMsYUFBYTtJQUMvQyxJQUFJLGVBQWUsR0FBc0I7UUFDckMsU0FBUyxFQUFFLEtBQUs7UUFDaEIsSUFBSSxFQUFFLFdBQVc7UUFDakIsS0FBSyxFQUFDLGFBQWE7S0FDdEIsQ0FBQztJQUNGLEVBQUUsQ0FBQSx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cbiAqL1xyXG5leHBvcnQgbGV0IGN3ZCA9IGZ1bmN0aW9uKCk6RGlyZWN0b3J5IHtcclxuICAgIHJldHVybiB7XHJcbiAgICAgICAgcGF0aDogcHJvY2Vzcy5jd2QoKVxyXG4gICAgfVxyXG59OyJdfQ== diff --git a/ts/smartcli.getters.ts b/ts/smartcli.getters.ts index b6ea049..9d3e96f 100644 --- a/ts/smartcli.getters.ts +++ b/ts/smartcli.getters.ts @@ -48,11 +48,11 @@ export let commandArgs = function():CliCommandArgument[] { var commandArgs:CliCommandArgument[] = []; var argsArray = commandArray().slice(0); argsArray.shift(); - for (var item in argsArray){ - var commandArgument:CliCommandArgument = { + for (let item in argsArray){ + let commandArgument:CliCommandArgument = { specified:true, name:argsArray[item], - level: item + 1 + level: parseInt(item) + 1 } commandArgs.push(commandArgument); }