@onehat/ui
Version:
Base UI for OneHat apps
13 lines (11 loc) • 299 B
JavaScript
import UiGlobals from '../UiGlobals.js';
import _ from 'lodash';
export default function getComponentFromType(type) {
if (_.isString(type)) {
if (UiGlobals.components[type]) {
return UiGlobals.components[type];
}
throw new Error('No mapping for ' + type + ' exists!');
}
return type;
}