@thi.ng/args
Advanced tools
Comparing version 2.0.0 to 2.0.1
import type { Fn } from "@thi.ng/api"; | ||
import type { ArgSpec, KVDict, KVMultiDict, Tuple } from "./api"; | ||
import type { ArgSpec, KVDict, KVMultiDict, Tuple } from "./api.js"; | ||
/** | ||
@@ -4,0 +4,0 @@ * Returns a full {@link ArgSpec} for a boolean flag. The mere presence of this |
import { repeat } from "@thi.ng/strings/repeat"; | ||
import { coerceFloat, coerceFloats, coerceHexInt, coerceHexInts, coerceInt, coerceInts, coerceJson, coerceKV, coerceOneOf, coerceTuple, } from "./coerce"; | ||
import { coerceFloat, coerceFloats, coerceHexInt, coerceHexInts, coerceInt, coerceInts, coerceJson, coerceKV, coerceOneOf, coerceTuple, } from "./coerce.js"; | ||
const $single = (coerce, hint) => (spec) => ({ | ||
@@ -4,0 +4,0 @@ coerce, |
@@ -6,2 +6,10 @@ # Change Log | ||
## [2.0.1](https://github.com/thi-ng/umbrella/compare/@thi.ng/args@2.0.0...@thi.ng/args@2.0.1) (2021-10-13) | ||
**Note:** Version bump only for package @thi.ng/args | ||
# [2.0.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/args@1.1.1...@thi.ng/args@2.0.0) (2021-10-12) | ||
@@ -8,0 +16,0 @@ |
import type { Fn } from "@thi.ng/api"; | ||
import { KVDict, KVMultiDict, Tuple } from "./api"; | ||
import { KVDict, KVMultiDict, Tuple } from "./api.js"; | ||
export declare const coerceString: (x: string) => string; | ||
@@ -4,0 +4,0 @@ export declare const coerceFloat: (x: string) => number; |
import { isHex } from "@thi.ng/checks/is-hex"; | ||
import { isNumericFloat, isNumericInt } from "@thi.ng/checks/is-numeric"; | ||
import { illegalArgs } from "@thi.ng/errors/illegal-arguments"; | ||
import { Tuple } from "./api"; | ||
import { Tuple } from "./api.js"; | ||
export const coerceString = (x) => x; | ||
@@ -6,0 +6,0 @@ export const coerceFloat = (x) => isNumericFloat(x) |
@@ -1,6 +0,6 @@ | ||
export * from "./api"; | ||
export * from "./args"; | ||
export * from "./coerce"; | ||
export * from "./parse"; | ||
export * from "./usage"; | ||
export * from "./api.js"; | ||
export * from "./args.js"; | ||
export * from "./coerce.js"; | ||
export * from "./parse.js"; | ||
export * from "./usage.js"; | ||
//# sourceMappingURL=index.d.ts.map |
10
index.js
@@ -1,5 +0,5 @@ | ||
export * from "./api"; | ||
export * from "./args"; | ||
export * from "./coerce"; | ||
export * from "./parse"; | ||
export * from "./usage"; | ||
export * from "./api.js"; | ||
export * from "./args.js"; | ||
export * from "./coerce.js"; | ||
export * from "./parse.js"; | ||
export * from "./usage.js"; |
{ | ||
"name": "@thi.ng/args", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "Declarative, functional & typechecked CLI argument/options parser, value coercions etc.", | ||
@@ -37,9 +37,9 @@ "type": "module", | ||
"dependencies": { | ||
"@thi.ng/api": "^8.0.0", | ||
"@thi.ng/checks": "^3.0.0", | ||
"@thi.ng/errors": "^2.0.0", | ||
"@thi.ng/strings": "^3.0.0" | ||
"@thi.ng/api": "^8.0.1", | ||
"@thi.ng/checks": "^3.0.1", | ||
"@thi.ng/errors": "^2.0.1", | ||
"@thi.ng/strings": "^3.0.1" | ||
}, | ||
"devDependencies": { | ||
"@thi.ng/testament": "^0.1.0" | ||
"@thi.ng/testament": "^0.1.1" | ||
}, | ||
@@ -65,2 +65,5 @@ "keywords": [ | ||
}, | ||
"engines": { | ||
"node": ">=12.7" | ||
}, | ||
"files": [ | ||
@@ -93,3 +96,3 @@ "*.js", | ||
}, | ||
"gitHead": "9ac1344b38b565eb894306fbf72233b6c0b2d115" | ||
"gitHead": "2e6b3d7c0f4c5686c1e9bdb4902ed7d3f90bcc19" | ||
} |
import type { IObjectOf } from "@thi.ng/api"; | ||
import type { Args, ParseOpts, ParseResult } from "./api"; | ||
import type { Args, ParseOpts, ParseResult } from "./api.js"; | ||
export declare const parse: <T extends IObjectOf<any>>(specs: Args<T>, argv: string[], opts?: Partial<ParseOpts> | undefined) => ParseResult<T> | undefined; | ||
//# sourceMappingURL=parse.d.ts.map |
import { isArray } from "@thi.ng/checks/is-array"; | ||
import { illegalArgs } from "@thi.ng/errors/illegal-arguments"; | ||
import { camel } from "@thi.ng/strings/case"; | ||
import { usage } from "./usage"; | ||
import { usage } from "./usage.js"; | ||
export const parse = (specs, argv, opts) => { | ||
@@ -6,0 +6,0 @@ opts = { start: 2, showUsage: true, help: ["--help", "-h"], ...opts }; |
@@ -65,6 +65,7 @@ <!-- This file is generated - DO NOT EDIT! --> | ||
For NodeJS (v14.6+): | ||
For Node.js REPL: | ||
```text | ||
node --experimental-specifier-resolution=node --experimental-repl-await | ||
# with flag only for < v16 | ||
node --experimental-repl-await | ||
@@ -71,0 +72,0 @@ > const args = await import("@thi.ng/args"); |
import type { IObjectOf } from "@thi.ng/api"; | ||
import { Args, UsageOpts } from "./api"; | ||
import { Args, UsageOpts } from "./api.js"; | ||
export declare const usage: <T extends IObjectOf<any>>(specs: Args<T>, opts?: Partial<UsageOpts>) => string; | ||
//# sourceMappingURL=usage.d.ts.map |
@@ -7,3 +7,3 @@ import { lengthAnsi } from "@thi.ng/strings/ansi"; | ||
import { SPLIT_ANSI, wordWrapLines } from "@thi.ng/strings/word-wrap"; | ||
import { DEFAULT_THEME } from "./api"; | ||
import { DEFAULT_THEME, } from "./api.js"; | ||
export const usage = (specs, opts = {}) => { | ||
@@ -10,0 +10,0 @@ opts = { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
55299
237
Updated@thi.ng/api@^8.0.1
Updated@thi.ng/checks@^3.0.1
Updated@thi.ng/errors@^2.0.1
Updated@thi.ng/strings@^3.0.1