Files
headlessui/packages/@headlessui-vue/src/utils/resolve-prop-value.ts
T
Robin Malfait 47b3ad1387 chore: Cleanup duplication (#109)
* remove duplicate calculate-active-index calculation

* make codebase a bit more consistent

* remove duplicate resolve-prop-value
2020-10-19 12:21:12 +02:00

6 lines
210 B
TypeScript

export function resolvePropValue<TProperty, TBag>(property: TProperty, bag: TBag) {
if (property === undefined) return undefined
if (typeof property === 'function') return property(bag)
return property
}