return (value, path = new Path()) => {
    if (typeof value !== 'string') {
      return failure('value must be a string', path);
    }
    const out = enumValues[value];
    if (out == null) {
      return failure(
        `value is not one of ${Object.keys(enumValues).join(', ')}`,
        path,
      );
    }
    return success(out, []);
  }
Checker to assert if a mixed value matches a union of string literals.
Legal values are provided as key/values in an object and may be translated by
providing different values in the object.

For example:
```jsx
const suitChecker = stringLiterals({
  heart: 'heart',
  spade: 'spade',
  club: 'club',
  diamond: 'diamond',
});

const suit: 'heart' | 'spade' | 'club' | 'diamond' = assertion(suitChecker())(x);
```

Strings can also be mapped to new values:
```jsx
const placeholderChecker = stringLiterals({
  foo: 'spam',
  bar: 'eggs',
});
```

It can be useful to have a single source of truth for your literals.  To
only specify them once and use it for both the Flow union type and the
runtime checker you can use the following pattern:
```jsx
const suits = {
  heart: 'heart',
  spade: 'spade',
  club: 'club',
  diamond: 'diamond',
};
type Suit = $Values<typeof suits>;
const suitChecker = stringLiterls(suits);
```