Skip to content

Commit

Permalink
fix: dataHasCause param and return types
Browse files Browse the repository at this point in the history
  • Loading branch information
legobeat committed May 13, 2024
1 parent 40e571d commit a44c9ac
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,9 @@ function serializeObject(object: RuntimeObject): Json {
* @param data - Optional data to validate.
* @returns Whether cause property is present and an object.
*/
export function dataHasCause(
data: OptionalDataWithOptionalCause,
): data is { cause: object } {
export function dataHasCause(data: unknown): data is {
[key: string]: Json | unknown;
cause: object;
} {
return isObject(data) && hasProperty(data, 'cause') && isObject(data.cause);
}

0 comments on commit a44c9ac

Please sign in to comment.