UNPKG

dsl-builder

Version:

OpenSearch Query Builder - Extract from OpenSearch Dashboards

26 lines (25 loc) 793 B
"use strict"; /* * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * * Any modifications Copyright OpenSearch Contributors. See * GitHub history for details. */ Object.defineProperty(exports, "__esModule", { value: true }); exports.getFromSavedObject = void 0; const lodash_1 = require("lodash"); function getFromSavedObject(savedObject) { if ((0, lodash_1.get)(savedObject, 'attributes.fields') === undefined) { return; } return { id: savedObject.id, fields: JSON.parse(savedObject.attributes.fields), title: savedObject.attributes.title, }; } exports.getFromSavedObject = getFromSavedObject;