akkoma-fe/src/services/component_utils/component_utils.js

11 lines
277 B
JavaScript
Raw Normal View History

import isFunction from 'lodash/isFunction'
const getComponentOptions = (Component) => (isFunction(Component)) ? Component.options : Component
const getComponentProps = (Component) => getComponentOptions(Component).props
export {
getComponentOptions,
getComponentProps
}