Skip to content

Commit

Permalink
Clean up some expressions types. (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
mistic authored Jun 30, 2020
2 parents 864755c + 90a88df commit 6ea3923
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const getParsedValue = (data: any, defaultValue: any) =>
const mergeQueries = (first: Query | Query[] = [], second: Query | Query[]) =>
uniqBy<Query>(
[...(Array.isArray(first) ? first : [first]), ...(Array.isArray(second) ? second : [second])],
(n: any) => JSON.stringify(n.query) as any
(n: any) => JSON.stringify(n.query)
);

export const kibanaContextFunction: ExpressionFunctionKibanaContext = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import { map, pick, zipObject } from 'lodash';

import { ExpressionTypeDefinition } from '../types';
import { PointSeries } from './pointseries';
import { PointSeries, PointSeriesColumn } from './pointseries';
import { ExpressionValueRender } from './render';

const name = 'datatable';
Expand Down Expand Up @@ -109,8 +109,8 @@ export const datatable: ExpressionTypeDefinition<typeof name, Datatable, Seriali
pointseries: (value: PointSeries) => ({
type: name,
rows: value.rows,
columns: map(value.columns, (val: any, colName) => {
return { name: colName!, type: val.type };
columns: map(value.columns, (val: PointSeriesColumn, colName) => {
return { name: colName, type: val.type };
}),
}),
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

import { map } from 'lodash';
import { SerializedFieldFormat } from '../../types/common';
import { Datatable, PointSeries } from '.';
import { Datatable, PointSeries, PointSeriesColumn } from '.';

const name = 'kibana_datatable';

Expand Down Expand Up @@ -62,7 +62,7 @@ export const kibanaDatatable = {
};
},
pointseries: (context: PointSeries) => {
const columns = map(context.columns, (column: any, n) => {
const columns = map(context.columns, (column: PointSeriesColumn, n) => {
return { id: n, name: n, ...column };
});
return {
Expand Down

0 comments on commit 6ea3923

Please sign in to comment.