import * as check from "../../../../generated/sync/check/maybe/function"; import {AssertError} from "../../../../sync/error/AssertError"; export function assertMaybeFunction (name : string, mixed : any) : (null|undefined|(Function))|never { const error = check.checkMaybeFunction(mixed); if (error === undefined) { return mixed; } else { throw new AssertError(name, error, mixed); } }