Skip to main content

Class: FunctionArg

An argument accepted by a function.

This is a specification for an argument at function definition time, not an argument passed at function call time.

Extends​

  • BaseClient

Constructors​

Constructor​

new FunctionArg(ctx?, _id?, _defaultPath?, _defaultValue?, _description?, _name?): FunctionArg

Constructor is used for internal usage only, do not create object from it.

Parameters​

ctx?​

Context

_id?​

FunctionArgID

_defaultPath?​

string

_defaultValue?​

JSON

_description?​

string

_name?​

string

Returns​

FunctionArg

Overrides​

BaseClient.constructor

Methods​

defaultPath()​

defaultPath(): Promise<string>

Only applies to arguments of type File or Directory. If the argument is not set, load it from the given path in the context directory

Returns​

Promise<string>


defaultValue()​

defaultValue(): Promise<JSON>

A default value to use for this argument when not explicitly set by the caller, if any.

Returns​

Promise<JSON>


description()​

description(): Promise<string>

A doc string for the argument, if any.

Returns​

Promise<string>


id()​

id(): Promise<FunctionArgID>

A unique identifier for this FunctionArg.

Returns​

Promise<FunctionArgID>


ignore()​

ignore(): Promise<string[]>

Only applies to arguments of type Directory. The ignore patterns are applied to the input directory, and matching entries are filtered out, in a cache-efficient manner.

Returns​

Promise<string[]>


name()​

name(): Promise<string>

The name of the argument in lowerCamelCase format.

Returns​

Promise<string>


sourceMap()​

sourceMap(): SourceMap

The location of this arg declaration.

Returns​

SourceMap


typeDef()​

typeDef(): TypeDef

The type of the argument.

Returns​

TypeDef