Switch to correct type to indicate "object which might not contain a property"

Co-authored-by: Janne Savolainen <janne.savolainen@live.fi>

Signed-off-by: Iku-turso <mikko.aspiala@gmail.com>
This commit is contained in:
Iku-tursoandJanne Savolainen committed 2022-10-26 11:16:12 +03:00
1 parent 17488bdea2
commit 155f4dfeb3
2 files changed
+2 -2

No files matched your search

@@ -9,7 +9,7 @@ export interface Orderable {
readonly orderNumber: number;
}
export const orderByOrderNumber = <T extends Orderable | {}>(maybeOrderables: T[]) =>
export const orderByOrderNumber = <T extends Orderable | object>(maybeOrderables: T[]) =>
sortBy(
(orderable) =>
"orderNumber" in orderable
@@ -12,7 +12,7 @@ export interface Showable {
export type MaybeShowable = Partial<Showable>;
export const isShown = (showable: Showable | {}) => {
export const isShown = (showable: Showable | object) => {
if (!("isShown" in showable)) {
return true;
}