inngest
Version:
Official SDK for Inngest.com. Inngest is the reliability layer for modern applications. Inngest combines durable execution, events, and queues into a zero-infra platform with built-in observability.
14 lines (13 loc) • 475 B
JavaScript
//#region src/components/triggers/typeHelpers.ts
/**
* Type guard to check if an object has a `validate` method. The use case is for
* safely validating an event payload that might have a `validate` method
*/
function isValidatable(value) {
if (typeof value !== "object" || value === null) return false;
if (!("validate" in value)) return false;
return typeof value.validate === "function";
}
//#endregion
export { isValidatable };
//# sourceMappingURL=typeHelpers.js.map