import { SavedObject } from 'src/core/public' ; import { get } from 'lodash' ; import { IIndexPattern , IndexPatternAttributes } from '../..' ; export function getFromSavedObject ( savedObject ) { if ( get ( savedObject , 'attributes.fields' ) === undefined ) { return ; } return { id : savedObject . id , fields : JSON . parse ( savedObject . attributes . fields ! ) , title : savedObject . attributes . title , } ; }