fbonds-core
Version:
Banx protocol sdk
11 lines (10 loc) • 362 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getEnumIndex = getEnumIndex;
const lodash_1 = require("lodash");
function getEnumIndex(enumObj, value) {
const index = Object.values(enumObj).indexOf(value);
if ((0, lodash_1.isNil)(index))
throw new Error('Unable to determine enum index');
return index;
}