From f2b088e251441cfaa8ab8104a3410ee877d4f08b Mon Sep 17 00:00:00 2001 From: Diana Derevyankina Date: Mon, 1 Mar 2021 17:03:27 +0300 Subject: [PATCH] Refactor accessors.tsx --- src/plugins/vis_type_xy/public/utils/accessors.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/vis_type_xy/public/utils/accessors.tsx b/src/plugins/vis_type_xy/public/utils/accessors.tsx index 0f73ebe7eed86..7bd9f52513e9f 100644 --- a/src/plugins/vis_type_xy/public/utils/accessors.tsx +++ b/src/plugins/vis_type_xy/public/utils/accessors.tsx @@ -27,7 +27,9 @@ const getFieldName = (fieldName: string, index?: number) => { }; export const isRangeAggType = (type: string | null) => - type === BUCKET_TYPES.DATE_RANGE || type === BUCKET_TYPES.RANGE || type === BUCKET_TYPES.IP_RANGE; + [BUCKET_TYPES.DATE_RANGE, BUCKET_TYPES.RANGE, BUCKET_TYPES.IP_RANGE].includes( + type as BUCKET_TYPES + ); /** * Returns accessor function for complex accessor types