UNPKG

accelerator-core

Version:

[![Build Status](https://travis-ci.org/furkleindustries/accelerator-core.svg?branch=master)](https://travis-ci.org/furkleindustries/accelerator-core)

20 lines (18 loc) 419 B
import { assertValid, } from 'ts-assertions'; export function getHelperVariant({ family, style, variants, weight, }) { return assertValid( variants.find(({ fontStyle, fontWeight, }) => style === fontStyle && String(weight) === fontWeight), `A matching web font could not be found for the font family "${family}" ` + `with the style "${style}" and weight "${weight}".`, ); }