Skip to content

Theemo / @theemo/tokens / findConstrainedValue

Function: findConstrainedValue()

ts
function findConstrainedValue(value, constraints): 
  | undefined
| ConstrainedValue<keyof TokenTypeRegistry>;

Defined in: packages/tokens/src/token-values.ts:12

Finds the value matching the provided constraints

Parameters

ParameterTypeDescription
valueunknownthe Token value
constraintsPartialthe constraints for lookup

Returns

| undefined | ConstrainedValue<keyof TokenTypeRegistry>

the matched token value or nothing