@wezom/cli-arguments
Advanced tools
Comparing version 0.1.1 to 0.1.2
@@ -5,2 +5,3 @@ import { Argv } from 'yargs'; | ||
constructor(source?: string[]); | ||
protected getArgvValue(key: string): unknown; | ||
getString(key: string): string | null; | ||
@@ -7,0 +8,0 @@ getNumber(key: string): number | null; |
@@ -1,1 +0,1 @@ | ||
"use strict";var r=require("yargs"),e=require("yargs/helpers");exports.CliArguments=class{constructor(t=process.argv){const n=r(e.hideBin(t)).argv;if("object"!=typeof n||null===n||"then"in n)throw new Error("CliArguments got Argv as Promise!");this.argv=n}getString(r){const e=this.argv[r];return"string"==typeof e&&e.length>0?e:null}getNumber(r){const e=this.argv[r];return"number"==typeof e&&Number.isFinite(e)?e:null}getBoolean(r){const e=this.argv[r];return"boolean"==typeof e?e:null}}; | ||
"use strict";var r=require("yargs"),e=require("yargs/helpers");exports.CliArguments=class{constructor(t=process.argv){const n=r(e.hideBin(t)).argv;if("object"!=typeof n||null===n||"then"in n)throw new Error("CliArguments got Argv as Promise!");this.argv=n}getArgvValue(r){const e=this.argv[r];return Array.isArray(e)?e[e.length-1]:e}getString(r){const e=this.getArgvValue(r);return"string"==typeof e&&e.length>0?e:null}getNumber(r){const e=this.getArgvValue(r);return"number"==typeof e&&Number.isFinite(e)?e:null}getBoolean(r){const e=this.getArgvValue(r);return"boolean"==typeof e?e:null}}; |
{ | ||
"name": "@wezom/cli-arguments", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "The tiny wrapper over the `yargs` lib", | ||
@@ -69,5 +69,5 @@ "main": "lib/index.js", | ||
"format": "prettier \"./src/**/*.ts\" --write --check", | ||
"local-pr-ready-check": "pnpm run format && pnpm run lint-with-autofix && pnpm run test", | ||
"local-pr-ready-check": "pnpm run format && pnpm run lint-with-autofix && pnpm run test-with-coverage && pnpm run build", | ||
"ci-test": "pnpm run lint && pnpm run test" | ||
} | ||
} |
@@ -11,6 +11,6 @@ # @wezom/cli-arguments | ||
| Statements | Branches | Functions | Lines | | ||
| --------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | | ||
| ![Statements](https://img.shields.io/badge/statements-90%25-brightgreen.svg?style=flat) | ![Branches](https://img.shields.io/badge/branches-87.5%25-yellow.svg?style=flat) | ![Functions](https://img.shields.io/badge/functions-100%25-brightgreen.svg?style=flat) | ![Lines](https://img.shields.io/badge/lines-90%25-brightgreen.svg?style=flat) | | ||
| Statements | Branches | Functions | Lines | | ||
| ------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | | ||
| ![Statements](https://img.shields.io/badge/statements-91.66%25-brightgreen.svg?style=flat) | ![Branches](https://img.shields.io/badge/branches-88.88%25-yellow.svg?style=flat) | ![Functions](https://img.shields.io/badge/functions-100%25-brightgreen.svg?style=flat) | ![Lines](https://img.shields.io/badge/lines-91.66%25-brightgreen.svg?style=flat) | | ||
--- |
Sorry, the diff of this file is not supported yet
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
7029
18