Skip to content

wasExplicit

Generated reference page for the wasExplicit function export.

Signatures

ts
function wasExplicit(source: ResolutionProvenance | undefined): boolean;
ParameterTypeDescription
sourceResolutionProvenance | undefinedThe provenance record of one input, or undefined.

Members

Members

wasExplicit

Whether a value came from somewhere other than its declared default.

Every stage but 'default' means the value was supplied: typed on the command line, piped, exported, written in a config file, or answered at a prompt. An input that resolved no value at all has no record and is not explicit.

Read stage directly for a narrower question, such as stage === 'cli' for "the user typed it on this command line".

ts
(source: ResolutionProvenance | undefined): boolean;

Examples

ts
command('build')
  .flag('out', flag.string().default('dist'))
  .action(({ sources, out }) => {
    if (wasExplicit(sources.flags.out)) out.info('using an overridden output');
  });

See Also

Released under the MIT License.