[Logs UI] Use stable json stringify for log item values (#30930)

This commit is contained in:
Felix Stürmer 2019-02-14 18:51:23 +01:00 committed by GitHub
parent fc16a93221
commit dcf2a4ff93
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4,8 +4,10 @@
* you may not use this file except in compliance with the Elastic License.
*/
import stringify from 'json-stable-stringify';
import { isArray, isPlainObject } from 'lodash';
import { JsonObject } from 'x-pack/plugins/infra/common/typed_json';
import { JsonObject } from '../../../../common/typed_json';
import { InfraLogItemField } from '../../../graphql/types';
const isJsonObject = (subject: any): subject is JsonObject => {
@ -14,7 +16,7 @@ const isJsonObject = (subject: any): subject is JsonObject => {
const serializeValue = (value: any): string => {
if (isArray(value) || isPlainObject(value)) {
return JSON.stringify(value);
return stringify(value);
}
return `${value}`;
};