UNPKG

pubchem

Version:

pubchem simplifies the data retrieval from the PubChem API.

15 lines 516 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.checkCompoundsResult = checkCompoundsResult; function checkCompoundsResult(compounds) { if (!Array.isArray(compounds) || compounds.length === 0) { throw new Error('No compound found'); } if (compounds.length !== 1) { throw new Error('More than one compound found'); } if (!('id' in compounds[0].id)) { throw new Error('No compound found'); } } //# sourceMappingURL=handleError.js.map