@augment-vir/common
Version:
A collection of augments, helpers types, functions, and classes for any JavaScript environment.
15 lines (14 loc) • 625 B
JavaScript
/**
* This is a type helper that ensures the given input matches the given generic type. The generic is
* setup in such a way that if it is omitted (which is typically allowed in TypeScript, resulting in
* the generic being inferred from the inputs), there will actually be a type error. This forces
* each usage of this function to explicitly specify the generic, thus giving us type safety for the
* input.
*
* @category Type
* @category Package : @augment-vir/common
* @package [`@augment-vir/common`](https://www.npmjs.com/package/@augment-vir/common)
*/
export function ensureType(input) {
return input;
}