UNPKG

pubchem

Version:

pubchem simplifies the data retrieval from the PubChem API.

20 lines 938 B
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.getComputedPropertySection = getComputedPropertySection; const jsonpath_1 = __importDefault(require("jsonpath")); /** * Returns a computed data section of a compound * * @param data Data of a compound data request to the PubChem API * @param sectionName Name of the section to be returned * @returns Computed Data section */ function getComputedPropertySection(data, sectionName) { const returnData = jsonpath_1.default.query(data, `$.Section[?(@.TOCHeading==="${sectionName}")].Information[*]`)[0]; returnData.Description = jsonpath_1.default.query(data, `$.Section[?(@.TOCHeading==="${sectionName}")].Description`)[0]; return returnData; } //# sourceMappingURL=getComputedPropertySection.js.map