1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

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-turso 2022-10-26 11:16:12 +03:00
parent 17488bdea2
commit 155f4dfeb3
2 changed files with 2 additions and 2 deletions

View File

@ -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

View File

@ -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;
}