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:
parent
17488bdea2
commit
155f4dfeb3
@ -9,7 +9,7 @@ export interface Orderable {
|
|||||||
readonly orderNumber: number;
|
readonly orderNumber: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const orderByOrderNumber = <T extends Orderable | {}>(maybeOrderables: T[]) =>
|
export const orderByOrderNumber = <T extends Orderable | object>(maybeOrderables: T[]) =>
|
||||||
sortBy(
|
sortBy(
|
||||||
(orderable) =>
|
(orderable) =>
|
||||||
"orderNumber" in orderable
|
"orderNumber" in orderable
|
||||||
|
|||||||
@ -12,7 +12,7 @@ export interface Showable {
|
|||||||
|
|
||||||
export type MaybeShowable = Partial<Showable>;
|
export type MaybeShowable = Partial<Showable>;
|
||||||
|
|
||||||
export const isShown = (showable: Showable | {}) => {
|
export const isShown = (showable: Showable | object) => {
|
||||||
if (!("isShown" in showable)) {
|
if (!("isShown" in showable)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user