Every key parameter accepts, with values of type. The
parameter is a String, Number, TemplateLiteral, Enum,
Suspend or a union of them, on both its sides; another raises
ValueError.
Attributes#
| Attribute | Type | Description |
|---|---|---|
parameter | AST | |
type | AST |
Functions#
__init__#
__init__(parameter, type) -> None| Parameter | Type | Description |
|---|---|---|
parameter | AST | |
type | AST |
selects#
selects(key, options=None) -> boolkey is a value of the parameter's encoded side: a key of an input to decode.
| Parameter | Type | Description |
|---|---|---|
key | object | |
options | ParseOptions | None = None |
Returns bool
def selects(self, key: object, options: ParseOptions | None = None) -> bool:
"""``key`` is a value of the parameter's encoded side: a key of an input to decode."""
return type(self.parameter.flip().to_type().parse(key, options or {})) is Successselects_decoded#
selects_decoded(key) -> boolkey is a value of the parameter's decoded side: a key of a decoded value, which
is what derivations over decoded values (equivalence, formatter) read.
| Parameter | Type | Description |
|---|---|---|
key | object |
Returns bool
def selects_decoded(self, key: object) -> bool:
"""``key`` is a value of the parameter's decoded side: a key of a decoded value, which
is what derivations over decoded values (equivalence, formatter) read."""
return type(self.parameter.to_type().parse(key, {})) is Success