"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.updateAll = void 0;
exports.updateAll_ = updateAll_;

var _State = /*#__PURE__*/require("@effect/core/io/Scope/ReleaseMap/_internal/State");

/**
 * Updates the finalizers associated with this scope using the specified
 * function.
 *
 * @tsplus fluent ets/ReleaseMap updateAll
 */
function updateAll_(self, f, __tsplusTrace) {
  return self.ref.update(state => {
    switch (state._tag) {
      case "Exited":
        {
          return new _State.Exited(state.nextKey, state.exit, _ => f(state.update(_)));
        }

      case "Running":
        {
          return new _State.Running(state.nextKey, state.finalizers(), _ => f(state.update(_)));
        }
    }
  }, __tsplusTrace);
}
/**
 * Updates the finalizers associated with this scope using the specified
 * function.
 *
 * @tsplus static ets/ReleaseMap/Aspects updateAll
 */


const updateAll = (f, __tsplusTrace) => self => updateAll_(self, f, __tsplusTrace);

exports.updateAll = updateAll;
//# sourceMappingURL=updateAll.js.map