@sentry/utils
Version:
Utilities for all Sentry JavaScript SDKs
15 lines • 842 B
TypeScript
/**
* Polyfill for the nullish coalescing operator (`??`), when used in situations where at least one of the values is the
* result of an async operation.
*
* Note that the RHS is wrapped in a function so that if it's a computed value, that evaluation won't happen unless the
* LHS evaluates to a nullish value, to mimic the operator's short-circuiting behavior.
*
* Adapted from Sucrase (https://github.com/alangpierce/sucrase)
*
* @param lhs The value of the expression to the left of the `??`
* @param rhsFn A function returning the value of the expression to the right of the `??`
* @returns The LHS value, unless it's `null` or `undefined`, in which case, the RHS value
*/
export declare function _asyncNullishCoalesce(lhs: unknown, rhsFn: () => unknown): Promise<unknown>;
//# sourceMappingURL=_asyncNullishCoalesce.d.ts.map