Skip to content

Commit

Permalink
fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
mariusheine committed Dec 11, 2023
1 parent 2d87ac6 commit 0c93a68
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,10 @@ export type ServiceModel<

export function isPaginated<T>(response: T | T[] | Paginated<T>): response is Paginated<T> {
const { total, limit, skip, data } = response as Paginated<T>;
return typeof total === 'number' && typeof limit === 'number' && (typeof skip === 'number' || typeof skip === 'string') && Array.isArray(data);
return (
typeof total === 'number' &&
typeof limit === 'number' &&
(typeof skip === 'number' || typeof skip === 'string') &&
Array.isArray(data)
);
}
2 changes: 1 addition & 1 deletion test/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,4 +116,4 @@ describe('isPaginated()', () => {
// then
expect(isPaginated<typeof response>(response)).toBe(false);
});
});
});

0 comments on commit 0c93a68

Please sign in to comment.