import * as tsplus_module_1 from "@effect/core/io/FiberRef/operations/initital";
import * as tsplus_module_2 from "@effect/core/io/FiberRefs/operations/get";
import * as tsplus_module_3 from "@tsplus/stdlib/data/Maybe/getOrElse";
/**
 * Gets the value of the specified `FiberRef` in this collection of `FiberRef`
 * values if it exists or the `initial` value of the `FiberRef` otherwise.
 *
 * @tsplus fluent ets/FiberRefs getOrDefault
 */

export function getOrDefault_(self, fiberRef) {
  return tsplus_module_3.getOrElse_(tsplus_module_2.get_(self, fiberRef), () => tsplus_module_1.initial(fiberRef));
}
/**
 * Gets the value of the specified `FiberRef` in this collection of `FiberRef`
 * values if it exists or the `initial` value of the `FiberRef` otherwise.
 *
 * @tsplus static ets/FiberRefs/Aspects getOrDefault
 */

export const getOrDefault = fiberRef => self => getOrDefault_(self, fiberRef);
//# sourceMappingURL=getOrDefault.mjs.map