Skip to main content
Less oft-needed functions to manipulate Tokens.

Initializers


Static Functions


is_resolvable

Return whether the given object is an IResolvable object. This is different from Token.isUnresolved() which will also check for encoded Tokens, whereas this method will only do a type check on the given object.

objRequired

  • Type: typing.Any

resolve

Resolves an object by evaluating all tokens and removing any undefined or empty objects or arrays. Values can only be primitives, arrays or tokens. Other objects (i.e. with methods) will be rejected.

objRequired

  • Type: typing.Any
The object to resolve.

resolverRequired

The resolver to apply to any resolvable tokens found.

scopeRequired

  • Type: constructs.IConstruct
The scope from which resolution is performed.

preparingOptional

  • Type: bool
  • Default: false
Whether the resolution is being executed during the prepare phase or not.

reverse

Reverse any value into Resolvables, if possible.

xRequired

  • Type: typing.Any

reverse_list

Un-encode a Tokenized value from a list.

lRequired

  • Type: typing.List[str]

reverse_map

Un-encode a Tokenized value from a map.

mRequired

  • Type: typing.Mapping[typing.Any]

reverse_number

Un-encode a Tokenized value from a number.

nRequired

  • Type: typing.Union[int, float]

reverse_number_list

Un-encode a Tokenized value from a list.

lRequired

  • Type: typing.List[typing.Union[int, float]]

reverse_string

Un-encode a string potentially containing encoded tokens.

sRequired

  • Type: str

stringify_number

Stringify a number directly or lazily if it’s a Token. If it is an object (i.e., { Ref: ‘SomeLogicalId’ }), return it as-is.

xRequired

  • Type: typing.Union[int, float]