TKK_E32230148/node_modules/firebase-functions/lib/common/utilities/assertions.js

18 lines
501 B
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//#region src/common/utilities/assertions.ts
/** @hidden
* @file Provides common assertion helpers which can be used to improve
* strictness of both type checking and runtime.
*/
/**
* Checks that the given value is of type `never` — the type thats left after
* all other cases have been removed.
*
* @param x A value of type `never`.
*/
function assertNever(x) {
throw new Error(`Unhandled discriminated union member: ${JSON.stringify(x)}.`);
}
//#endregion
exports.assertNever = assertNever;