@benev/argv
Advanced tools
Comparing version 0.3.3 to 0.3.4
{ | ||
"name": "@benev/argv", | ||
"version": "0.3.3", | ||
"version": "0.3.4", | ||
"description": "command line argument parser", | ||
@@ -25,3 +25,3 @@ "license": "MIT", | ||
"devDependencies": { | ||
"@types/node": "^20.12.12", | ||
"@types/node": "^20.14.1", | ||
"chokidar-cli": "^3.0.0", | ||
@@ -28,0 +28,0 @@ "npm-run-all": "^4.1.5", |
@@ -206,7 +206,11 @@ | ||
export function list<T>({name: type, coerce}: Type<T>): Type<T[]> { | ||
export function list<T>( | ||
{name: type, coerce}: Type<T>, | ||
delimiter = ",", | ||
): Type<T[]> { | ||
return { | ||
name: `${type}-list`, | ||
coerce: string => string | ||
.split(",") | ||
.split(delimiter) | ||
.map(s => s.trim()) | ||
@@ -213,0 +217,0 @@ .map(coerce), |
@@ -15,2 +15,3 @@ | ||
export * from "./areas/analysis/types/units.js" | ||
export * from "./areas/analysis/types/analysis.js" | ||
export * from "./areas/analysis/types/commands.js" | ||
@@ -17,0 +18,0 @@ export * as helpers from "./areas/analysis/helpers.js" |
@@ -42,2 +42,2 @@ import { Command, CommandOptions } from "./types/commands.js"; | ||
}): Opts<T[]>; | ||
export declare function list<T>({ name: type, coerce }: Type<T>): Type<T[]>; | ||
export declare function list<T>({ name: type, coerce }: Type<T>, delimiter?: string): Type<T[]>; |
@@ -155,7 +155,7 @@ import { obmap } from "../../tooling/obmap.js"; | ||
} | ||
export function list({ name: type, coerce }) { | ||
export function list({ name: type, coerce }, delimiter = ",") { | ||
return { | ||
name: `${type}-list`, | ||
coerce: string => string | ||
.split(",") | ||
.split(delimiter) | ||
.map(s => s.trim()) | ||
@@ -162,0 +162,0 @@ .map(coerce), |
@@ -9,2 +9,3 @@ export * from "./errors/basic.js"; | ||
export * from "./areas/analysis/types/units.js"; | ||
export * from "./areas/analysis/types/analysis.js"; | ||
export * from "./areas/analysis/types/commands.js"; | ||
@@ -11,0 +12,0 @@ export * as helpers from "./areas/analysis/helpers.js"; |
@@ -12,2 +12,3 @@ // all errors | ||
export * from "./areas/analysis/types/units.js"; | ||
export * from "./areas/analysis/types/analysis.js"; | ||
export * from "./areas/analysis/types/commands.js"; | ||
@@ -14,0 +15,0 @@ export * as helpers from "./areas/analysis/helpers.js"; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
230038
4422