pubchem
Version:
pubchem simplifies the data retrieval from the PubChem API.
15 lines • 516 B
JavaScript
;
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