UNPKG

@base-ui-components/react

Version:

Base UI is a library of headless ('unstyled') React components and low-level hooks. You gain complete control over your app's CSS and accessibility features.

20 lines (19 loc) 491 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.resolvePromiseOptions = resolvePromiseOptions; function resolvePromiseOptions(options, result) { if (typeof options === 'string') { return { description: options }; } if (typeof options === 'function') { const resolvedOptions = options(result); return typeof resolvedOptions === 'string' ? { description: resolvedOptions } : resolvedOptions; } return options; }