Comparing version 3.3.0 to 3.4.0
@@ -225,2 +225,4 @@ /// <reference types="node" /> | ||
parse(args?: string[]): Parsed<C>; | ||
loadEnvDefaults(): void; | ||
applyDefaults(p: Parsed<C>): void; | ||
/** | ||
@@ -238,2 +240,3 @@ * Only parse the command line arguments passed in. | ||
validate(o: unknown): asserts o is Parsed<C>['values']; | ||
writeEnv(p: Parsed<C>): void; | ||
/** | ||
@@ -240,0 +243,0 @@ * Add a heading to the usage output banner |
@@ -368,5 +368,9 @@ "use strict"; | ||
parse(args = process.argv) { | ||
if (args === process.argv) { | ||
args = args.slice(process._eval !== undefined ? 1 : 2); | ||
} | ||
this.loadEnvDefaults(); | ||
const p = this.parseRaw(args); | ||
this.applyDefaults(p); | ||
this.writeEnv(p); | ||
return p; | ||
} | ||
loadEnvDefaults() { | ||
if (this.#envPrefix) { | ||
@@ -381,3 +385,4 @@ for (const [field, my] of Object.entries(this.#configSet)) { | ||
} | ||
const p = this.parseRaw(args); | ||
} | ||
applyDefaults(p) { | ||
for (const [field, c] of Object.entries(this.#configSet)) { | ||
@@ -389,4 +394,2 @@ if (c.default !== undefined && !(field in p.values)) { | ||
} | ||
this.#writeEnv(p); | ||
return p; | ||
} | ||
@@ -400,2 +403,5 @@ /** | ||
parseRaw(args) { | ||
if (args === process.argv) { | ||
args = args.slice(process._eval !== undefined ? 1 : 2); | ||
} | ||
const options = toParseArgsOptionsConfig(this.#configSet); | ||
@@ -575,3 +581,3 @@ const result = (0, parse_args_js_1.parseArgs)({ | ||
} | ||
#writeEnv(p) { | ||
writeEnv(p) { | ||
if (!this.#env || !this.#envPrefix) | ||
@@ -578,0 +584,0 @@ return; |
@@ -225,2 +225,4 @@ /// <reference types="node" resolution-mode="require"/> | ||
parse(args?: string[]): Parsed<C>; | ||
loadEnvDefaults(): void; | ||
applyDefaults(p: Parsed<C>): void; | ||
/** | ||
@@ -238,2 +240,3 @@ * Only parse the command line arguments passed in. | ||
validate(o: unknown): asserts o is Parsed<C>['values']; | ||
writeEnv(p: Parsed<C>): void; | ||
/** | ||
@@ -240,0 +243,0 @@ * Add a heading to the usage output banner |
@@ -360,5 +360,9 @@ import { inspect } from 'node:util'; | ||
parse(args = process.argv) { | ||
if (args === process.argv) { | ||
args = args.slice(process._eval !== undefined ? 1 : 2); | ||
} | ||
this.loadEnvDefaults(); | ||
const p = this.parseRaw(args); | ||
this.applyDefaults(p); | ||
this.writeEnv(p); | ||
return p; | ||
} | ||
loadEnvDefaults() { | ||
if (this.#envPrefix) { | ||
@@ -373,3 +377,4 @@ for (const [field, my] of Object.entries(this.#configSet)) { | ||
} | ||
const p = this.parseRaw(args); | ||
} | ||
applyDefaults(p) { | ||
for (const [field, c] of Object.entries(this.#configSet)) { | ||
@@ -381,4 +386,2 @@ if (c.default !== undefined && !(field in p.values)) { | ||
} | ||
this.#writeEnv(p); | ||
return p; | ||
} | ||
@@ -392,2 +395,5 @@ /** | ||
parseRaw(args) { | ||
if (args === process.argv) { | ||
args = args.slice(process._eval !== undefined ? 1 : 2); | ||
} | ||
const options = toParseArgsOptionsConfig(this.#configSet); | ||
@@ -567,3 +573,3 @@ const result = parseArgs({ | ||
} | ||
#writeEnv(p) { | ||
writeEnv(p) { | ||
if (!this.#env || !this.#envPrefix) | ||
@@ -570,0 +576,0 @@ return; |
{ | ||
"name": "jackspeak", | ||
"version": "3.3.0", | ||
"version": "3.4.0", | ||
"description": "A very strict and proper argument parser.", | ||
@@ -5,0 +5,0 @@ "tshy": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
296911
2726