@effect/io
Advanced tools
Comparing version 0.0.19 to 0.0.20
@@ -34,6 +34,2 @@ /** | ||
traceExecutionLogEnabled: boolean; | ||
/** | ||
* Enable debugger on execution | ||
*/ | ||
debuggerEnabled: boolean; | ||
} | ||
@@ -62,6 +58,2 @@ /** | ||
export declare const getCallTrace: () => string | undefined; | ||
/** | ||
* @since 1.0.0 | ||
*/ | ||
export declare const debugAs: <F extends Function, G extends Function>(f: F, g: G) => G; | ||
//# sourceMappingURL=Debug.d.ts.map |
12
Debug.js
@@ -6,3 +6,3 @@ "use strict"; | ||
}); | ||
exports.withCallTrace = exports.runtimeDebug = exports.isTraceEnabled = exports.getCallTraceFromNewError = exports.getCallTrace = exports.debugAs = void 0; | ||
exports.withCallTrace = exports.runtimeDebug = exports.isTraceEnabled = exports.getCallTraceFromNewError = exports.getCallTrace = void 0; | ||
var _Function = /*#__PURE__*/require("@fp-ts/data/Function"); | ||
@@ -23,4 +23,3 @@ /** | ||
traceFilter: () => true, | ||
traceExecutionLogEnabled: false, | ||
debuggerEnabled: false | ||
traceExecutionLogEnabled: false | ||
}; | ||
@@ -89,10 +88,3 @@ /** | ||
}; | ||
/** | ||
* @since 1.0.0 | ||
*/ | ||
exports.getCallTrace = getCallTrace; | ||
const debugAs = (f, g) => Object.assign(g, { | ||
debugAs: "debugAs" in f ? f["debugAs"] : f | ||
}); | ||
exports.debugAs = debugAs; | ||
//# sourceMappingURL=Debug.js.map |
@@ -5,2 +5,3 @@ /** | ||
import type * as Clock from "@effect/io/Clock"; | ||
import type * as ConfigProvider from "@effect/io/Config/Provider"; | ||
import type * as FiberRef from "@effect/io/FiberRef"; | ||
@@ -13,3 +14,3 @@ import type * as Random from "@effect/io/Random"; | ||
*/ | ||
export type DefaultServices = Clock.Clock | Random.Random; | ||
export type DefaultServices = Clock.Clock | Random.Random | ConfigProvider.ConfigProvider; | ||
/** | ||
@@ -16,0 +17,0 @@ * @since 1.0.0 |
@@ -202,9 +202,12 @@ /** | ||
/** | ||
* @macro traced | ||
* @since 1.0.0 | ||
* @category fiberRefs | ||
*/ | ||
export declare const currentExecutionDebug: FiberRef<boolean>; | ||
/** | ||
* @since 1.0.0 | ||
* @category fiberRefs | ||
*/ | ||
export declare const currentEnvironment: FiberRef<Context.Context<never>>; | ||
/** | ||
* @macro traced | ||
* @since 1.0.0 | ||
@@ -211,0 +214,0 @@ * @category fiberRefs |
@@ -6,3 +6,3 @@ "use strict"; | ||
}); | ||
exports.updateSomeAndGet = exports.updateSome = exports.updateAndGet = exports.update = exports.unsafeMakeSupervisor = exports.unsafeMakePatch = exports.unsafeMakeHashSet = exports.unsafeMakeEnvironment = exports.unsafeMake = exports.set = exports.reset = exports.modifySome = exports.modify = exports.makeWith = exports.makeRuntimeFlags = exports.makeEnvironment = exports.make = exports.locallyWith = exports.locallyScopedWith = exports.locallyScoped = exports.locally = exports.interruptedCause = exports.getWith = exports.getAndUpdateSome = exports.getAndUpdate = exports.getAndSet = exports.get = exports.delete = exports.currentSupervisor = exports.currentRuntimeFlags = exports.currentParallelism = exports.currentLoggers = exports.currentLogSpan = exports.currentLogLevel = exports.currentLogAnnotations = exports.currentEnvironment = exports.FiberRefTypeId = void 0; | ||
exports.updateSomeAndGet = exports.updateSome = exports.updateAndGet = exports.update = exports.unsafeMakeSupervisor = exports.unsafeMakePatch = exports.unsafeMakeHashSet = exports.unsafeMakeEnvironment = exports.unsafeMake = exports.set = exports.reset = exports.modifySome = exports.modify = exports.makeWith = exports.makeRuntimeFlags = exports.makeEnvironment = exports.make = exports.locallyWith = exports.locallyScopedWith = exports.locallyScoped = exports.locally = exports.interruptedCause = exports.getWith = exports.getAndUpdateSome = exports.getAndUpdate = exports.getAndSet = exports.get = exports.delete = exports.currentSupervisor = exports.currentRuntimeFlags = exports.currentParallelism = exports.currentLoggers = exports.currentLogSpan = exports.currentLogLevel = exports.currentLogAnnotations = exports.currentExecutionDebug = exports.currentEnvironment = exports.FiberRefTypeId = void 0; | ||
var core = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/io/internal/core")); | ||
@@ -198,3 +198,2 @@ var fiberRuntime = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/io/internal/fiberRuntime")); | ||
/** | ||
* @macro traced | ||
* @since 1.0.0 | ||
@@ -204,5 +203,10 @@ * @category fiberRefs | ||
exports.locallyScopedWith = locallyScopedWith; | ||
const currentExecutionDebug = core.currentExecutionDebug; | ||
/** | ||
* @since 1.0.0 | ||
* @category fiberRefs | ||
*/ | ||
exports.currentExecutionDebug = currentExecutionDebug; | ||
const currentEnvironment = core.currentEnvironment; | ||
/** | ||
* @macro traced | ||
* @since 1.0.0 | ||
@@ -209,0 +213,0 @@ * @category fiberRefs |
@@ -6,4 +6,4 @@ "use strict"; | ||
}); | ||
exports.fiberRefSet = exports.fiberRefReset = exports.fiberRefModifySome = exports.fiberRefModify = exports.fiberRefLocallyWith = exports.fiberRefLocally = exports.fiberRefGetWith = exports.fiberRefGetAndUpdateSome = exports.fiberRefGetAndSet = exports.fiberRefGet = exports.fiberRefDelete = exports.fiberIdWith = exports.fiberId = exports.failSync = exports.failCauseSync = exports.failCause = exports.fail = exports.exitZipWith = exports.exitZipRight = exports.exitZipParRight = exports.exitZipParLeft = exports.exitZipPar = exports.exitZipLeft = exports.exitZip = exports.exitUnit = exports.exitUnannotate = exports.exitSucceed = exports.exitMatchEffect = exports.exitMatch = exports.exitMapErrorCause = exports.exitMapError = exports.exitMapBoth = exports.exitMap = exports.exitIsSuccess = exports.exitIsInterrupted = exports.exitIsFailure = exports.exitIsExit = exports.exitInterrupt = exports.exitGetOrElse = exports.exitFromOption = exports.exitFromEither = exports.exitForEachEffect = exports.exitFlatten = exports.exitFlatMapEffect = exports.exitFlatMap = exports.exitFailCause = exports.exitFail = exports.exitExists = exports.exitDie = exports.exitCollectAllPar = exports.exitCollectAll = exports.exitCauseOption = exports.exitAsUnit = exports.exitAs = exports.exit = exports.environmentWithEffect = exports.environment = exports.either = exports.done = exports.dieSync = exports.die = exports.deferredUnsafeMake = exports.deferredUnsafeDone = exports.deferredSync = exports.deferredSucceed = exports.deferredPoll = exports.deferredMakeAs = exports.deferredMake = exports.deferredIsDone = exports.deferredInterruptWith = exports.deferredInterrupt = exports.deferredFailSync = exports.deferredFailCauseSync = exports.deferredFailCause = exports.deferredFail = exports.deferredDone = exports.deferredDieSync = exports.deferredDie = exports.deferredCompleteWith = exports.deferredComplete = exports.deferredAwait = exports.currentScheduler = exports.currentParallelism = exports.currentLogSpan = exports.currentLogLevel = exports.currentLogAnnotations = exports.currentEnvironment = exports.checkInterruptible = exports.catchAllCause = exports.asyncInterrupt = exports.async = exports.asUnit = exports.as = exports.acquireUseRelease = exports.ScopeTypeId = exports.RevertFlags = exports.FiberRefTypeId = exports.EffectTypeId = exports.EffectErrorTypeId = exports.CloseableScopeTypeId = void 0; | ||
exports.zipWith = exports.zipRight = exports.zipLeft = exports.zip = exports.yieldNow = exports.withRuntimeFlags = exports.withParallelismUnbounded = exports.withParallelism = exports.withFiberRuntime = exports.whileLoop = exports.whenEffect = exports.updateRuntimeFlags = exports.unit = exports.uninterruptibleMask = exports.uninterruptible = exports.transplant = exports.traced = exports.tap = exports.sync = exports.suspendSucceed = exports.succeed = exports.serviceWithEffect = exports.serviceWith = exports.service = exports.scopeFork = exports.scopeClose = exports.scopeAddFinalizerExit = exports.scopeAddFinalizer = exports.runtimeFlags = exports.releaseMapReplace = exports.releaseMapRemove = exports.releaseMapRelease = exports.releaseMapMake = exports.releaseMapGet = exports.releaseMapAddIfOpen = exports.releaseMapAdd = exports.provideSomeEnvironment = exports.provideEnvironment = exports.proto = exports.partitionMap = exports.onInterrupt = exports.onExit = exports.onError = exports.never = exports.map = exports.makeEffectError = exports.logLevelWarning = exports.logLevelTrace = exports.logLevelNone = exports.logLevelInfo = exports.logLevelFatal = exports.logLevelError = exports.logLevelDebug = exports.logLevelAll = exports.isEffectError = exports.isEffect = exports.intoDeferred = exports.interruptibleMask = exports.interruptible = exports.interruptedCause = exports.interruptWithFiber = exports.interruptWith = exports.interruptFiber = exports.interrupt = exports.ifEffect = exports.forkScopeOverride = exports.forEachDiscard = exports.forEach = exports.foldEffect = exports.foldCauseEffect = exports.foldCause = exports.flip = exports.flatten = exports.flatMap = exports.fiberRefgetAndUpdate = exports.fiberRefUpdateSomeAndGet = exports.fiberRefUpdateSome = exports.fiberRefUpdateAndGet = exports.fiberRefUpdate = exports.fiberRefUnsafeMakeRuntimeFlags = exports.fiberRefUnsafeMakePatch = exports.fiberRefUnsafeMakeHashSet = exports.fiberRefUnsafeMakeEnvironment = exports.fiberRefUnsafeMake = void 0; | ||
exports.fiberRefModify = exports.fiberRefLocallyWith = exports.fiberRefLocally = exports.fiberRefGetWith = exports.fiberRefGetAndUpdateSome = exports.fiberRefGetAndSet = exports.fiberRefGet = exports.fiberRefDelete = exports.fiberIdWith = exports.fiberId = exports.failSync = exports.failCauseSync = exports.failCause = exports.fail = exports.exitZipWith = exports.exitZipRight = exports.exitZipParRight = exports.exitZipParLeft = exports.exitZipPar = exports.exitZipLeft = exports.exitZip = exports.exitUnit = exports.exitUnannotate = exports.exitSucceed = exports.exitMatchEffect = exports.exitMatch = exports.exitMapErrorCause = exports.exitMapError = exports.exitMapBoth = exports.exitMap = exports.exitIsSuccess = exports.exitIsInterrupted = exports.exitIsFailure = exports.exitIsExit = exports.exitInterrupt = exports.exitGetOrElse = exports.exitFromOption = exports.exitFromEither = exports.exitForEachEffect = exports.exitFlatten = exports.exitFlatMapEffect = exports.exitFlatMap = exports.exitFailCause = exports.exitFail = exports.exitExists = exports.exitDie = exports.exitCollectAllPar = exports.exitCollectAll = exports.exitCauseOption = exports.exitAsUnit = exports.exitAs = exports.exit = exports.environmentWithEffect = exports.environment = exports.either = exports.done = exports.dieSync = exports.die = exports.deferredUnsafeMake = exports.deferredUnsafeDone = exports.deferredSync = exports.deferredSucceed = exports.deferredPoll = exports.deferredMakeAs = exports.deferredMake = exports.deferredIsDone = exports.deferredInterruptWith = exports.deferredInterrupt = exports.deferredFailSync = exports.deferredFailCauseSync = exports.deferredFailCause = exports.deferredFail = exports.deferredDone = exports.deferredDieSync = exports.deferredDie = exports.deferredCompleteWith = exports.deferredComplete = exports.deferredAwait = exports.currentScheduler = exports.currentParallelism = exports.currentLogSpan = exports.currentLogLevel = exports.currentLogAnnotations = exports.currentExecutionDebug = exports.currentEnvironment = exports.checkInterruptible = exports.catchSome = exports.catchAllCause = exports.catchAll = exports.asyncInterrupt = exports.async = exports.asUnit = exports.as = exports.acquireUseRelease = exports.ScopeTypeId = exports.RevertFlags = exports.FiberRefTypeId = exports.EffectTypeId = exports.EffectErrorTypeId = exports.CloseableScopeTypeId = void 0; | ||
exports.zipWith = exports.zipRight = exports.zipLeft = exports.zip = exports.yieldNow = exports.withRuntimeFlags = exports.withParallelismUnbounded = exports.withParallelism = exports.withFiberRuntime = exports.withExecutionDebug = exports.whileLoop = exports.whenEffect = exports.updateRuntimeFlags = exports.unit = exports.uninterruptibleMask = exports.uninterruptible = exports.tryOrElse = exports.transplant = exports.traced = exports.tap = exports.sync = exports.suspendSucceed = exports.succeed = exports.serviceWithEffect = exports.serviceWith = exports.service = exports.scopeFork = exports.scopeClose = exports.scopeAddFinalizerExit = exports.scopeAddFinalizer = exports.runtimeFlags = exports.releaseMapReplace = exports.releaseMapRemove = exports.releaseMapRelease = exports.releaseMapMake = exports.releaseMapGet = exports.releaseMapAddIfOpen = exports.releaseMapAdd = exports.provideSomeEnvironment = exports.provideEnvironment = exports.proto = exports.partitionMap = exports.orElse = exports.orDieWith = exports.orDie = exports.onInterrupt = exports.onExit = exports.onError = exports.never = exports.mapError = exports.map = exports.makeEffectError = exports.logLevelWarning = exports.logLevelTrace = exports.logLevelNone = exports.logLevelInfo = exports.logLevelFatal = exports.logLevelError = exports.logLevelDebug = exports.logLevelAll = exports.isEffectError = exports.isEffect = exports.intoDeferred = exports.interruptibleMask = exports.interruptible = exports.interruptedCause = exports.interruptWithFiber = exports.interruptWith = exports.interruptFiber = exports.interrupt = exports.ifEffect = exports.fromOption = exports.fromEither = exports.forkScopeOverride = exports.forEachDiscard = exports.forEach = exports.foldEffect = exports.foldCauseEffect = exports.foldCause = exports.flip = exports.flatten = exports.flatMap = exports.fiberRefgetAndUpdate = exports.fiberRefUpdateSomeAndGet = exports.fiberRefUpdateSome = exports.fiberRefUpdateAndGet = exports.fiberRefUpdate = exports.fiberRefUnsafeMakeRuntimeFlags = exports.fiberRefUnsafeMakePatch = exports.fiberRefUnsafeMakeHashSet = exports.fiberRefUnsafeMakeEnvironment = exports.fiberRefUnsafeMake = exports.fiberRefSet = exports.fiberRefReset = exports.fiberRefModifySome = void 0; | ||
var Cause = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/io/Cause")); | ||
@@ -163,2 +163,30 @@ var _Debug = /*#__PURE__*/require("@effect/io/Debug"); | ||
exports.catchAllCause = catchAllCause; | ||
const catchAll = f => { | ||
const trace = (0, _Debug.getCallTrace)(); | ||
return self => { | ||
return foldEffect(f, succeed)(self).traced(trace); | ||
}; | ||
}; | ||
/** @internal */ | ||
exports.catchAll = catchAll; | ||
const catchSome = pf => { | ||
const trace = (0, _Debug.getCallTrace)(); | ||
return self => { | ||
return foldCauseEffect(cause => { | ||
const either = Cause.failureOrCause(cause); | ||
switch (either._tag) { | ||
case "Left": | ||
{ | ||
return Option.getOrElse(() => failCause(cause))(pf(either.left)); | ||
} | ||
case "Right": | ||
{ | ||
return failCause(either.right); | ||
} | ||
} | ||
}, succeed)(self).traced(trace); | ||
}; | ||
}; | ||
/** @internal */ | ||
exports.catchSome = catchSome; | ||
const checkInterruptible = f => { | ||
@@ -300,3 +328,3 @@ const trace = (0, _Debug.getCallTrace)(); | ||
return self => { | ||
return foldCauseEffect((0, _Debug.debugAs)(onFailure, cause => { | ||
return foldCauseEffect(cause => { | ||
const either = Cause.failureOrCause(cause); | ||
@@ -313,3 +341,3 @@ switch (either._tag) { | ||
} | ||
}), onSuccess)(self).traced(trace); | ||
}, onSuccess)(self).traced(trace); | ||
}; | ||
@@ -344,2 +372,32 @@ }; | ||
exports.forEachDiscard = forEachDiscard; | ||
const fromOption = option => { | ||
const trace = (0, _Debug.getCallTrace)(); | ||
switch (option._tag) { | ||
case "None": | ||
{ | ||
return fail(Option.none).traced(trace); | ||
} | ||
case "Some": | ||
{ | ||
return succeed(option.value).traced(trace); | ||
} | ||
} | ||
}; | ||
/** @internal */ | ||
exports.fromOption = fromOption; | ||
const fromEither = either => { | ||
const trace = (0, _Debug.getCallTrace)(); | ||
switch (either._tag) { | ||
case "Left": | ||
{ | ||
return fail(either.left).traced(trace); | ||
} | ||
case "Right": | ||
{ | ||
return succeed(either.right).traced(trace); | ||
} | ||
} | ||
}; | ||
/** @internal */ | ||
exports.fromEither = fromEither; | ||
const ifEffect = (onTrue, onFalse) => { | ||
@@ -403,2 +461,22 @@ const trace = (0, _Debug.getCallTrace)(); | ||
exports.map = map; | ||
const mapError = f => { | ||
const trace = (0, _Debug.getCallTrace)(); | ||
return self => { | ||
return foldCauseEffect(cause => { | ||
const either = Cause.failureOrCause(cause); | ||
switch (either._tag) { | ||
case "Left": | ||
{ | ||
return failSync(() => f(either.left)); | ||
} | ||
case "Right": | ||
{ | ||
return failCause(either.right); | ||
} | ||
} | ||
}, succeed)(self).traced(trace); | ||
}; | ||
}; | ||
/** @internal */ | ||
exports.mapError = mapError; | ||
const never = () => { | ||
@@ -445,2 +523,44 @@ const trace = (0, _Debug.getCallTrace)(); | ||
exports.onInterrupt = onInterrupt; | ||
const orElse = that => { | ||
const trace = (0, _Debug.getCallTrace)(); | ||
return self => { | ||
return tryOrElse(that, succeed)(self).traced(trace); | ||
}; | ||
}; | ||
/** @internal */ | ||
exports.orElse = orElse; | ||
const orDie = self => { | ||
const trace = (0, _Debug.getCallTrace)(); | ||
return orDieWith(_Function.identity)(self).traced(trace); | ||
}; | ||
/** @internal */ | ||
exports.orDie = orDie; | ||
const orDieWith = f => { | ||
const trace = (0, _Debug.getCallTrace)(); | ||
return self => { | ||
return foldEffect(e => die(f(e)), succeed)(self).traced(trace); | ||
}; | ||
}; | ||
/** @internal */ | ||
exports.orDieWith = orDieWith; | ||
const tryOrElse = (that, onSuccess) => { | ||
const trace = (0, _Debug.getCallTrace)(); | ||
return self => { | ||
return foldCauseEffect(cause => { | ||
const option = Cause.keepDefects(cause); | ||
switch (option._tag) { | ||
case "None": | ||
{ | ||
return that(); | ||
} | ||
case "Some": | ||
{ | ||
return failCause(option.value); | ||
} | ||
} | ||
}, onSuccess)(self).traced(trace); | ||
}; | ||
}; | ||
/** @internal */ | ||
exports.tryOrElse = tryOrElse; | ||
const partitionMap = (elements, f) => { | ||
@@ -471,2 +591,8 @@ return Array.from(elements).reduceRight(([lefts, rights], current) => { | ||
exports.provideEnvironment = provideEnvironment; | ||
const withExecutionDebug = self => { | ||
const trace = (0, _Debug.getCallTrace)(); | ||
return fiberRefLocally(true)(currentExecutionDebug)(self).traced(trace); | ||
}; | ||
/** @internal */ | ||
exports.withExecutionDebug = withExecutionDebug; | ||
const provideSomeEnvironment = f => { | ||
@@ -966,2 +1092,5 @@ const trace = (0, _Debug.getCallTrace)(); | ||
exports.fiberRefUnsafeMakeRuntimeFlags = fiberRefUnsafeMakeRuntimeFlags; | ||
const currentExecutionDebug = /*#__PURE__*/fiberRefUnsafeMake(false); | ||
/** @internal */ | ||
exports.currentExecutionDebug = currentExecutionDebug; | ||
const currentEnvironment = /*#__PURE__*/fiberRefUnsafeMakeEnvironment( /*#__PURE__*/Context.empty()); | ||
@@ -968,0 +1097,0 @@ /** @internal */ |
@@ -6,5 +6,6 @@ "use strict"; | ||
}); | ||
exports.withClock = exports.sleep = exports.shuffle = exports.randomWith = exports.nextRange = exports.nextIntBetween = exports.nextInt = exports.nextBoolean = exports.next = exports.liveServices = exports.currentTimeMillis = exports.currentServices = exports.clockWith = void 0; | ||
exports.withConfigProvider = exports.withClock = exports.sleep = exports.shuffle = exports.randomWith = exports.nextRange = exports.nextIntBetween = exports.nextInt = exports.nextBoolean = exports.next = exports.liveServices = exports.currentTimeMillis = exports.currentServices = exports.configProviderWith = exports.configOrDie = exports.config = exports.clockWith = void 0; | ||
var _Debug = /*#__PURE__*/require("@effect/io/Debug"); | ||
var clock = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/io/internal/clock")); | ||
var configProvider = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/io/internal/configProvider")); | ||
var core = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/io/internal/core")); | ||
@@ -17,3 +18,3 @@ var random = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/io/internal/random")); | ||
/** @internal */ | ||
const liveServices = /*#__PURE__*/Context.add(random.randomTag)(random.make(Math.random() * 4294967296 >>> 0))( /*#__PURE__*/Context.add(clock.clockTag)(clock.make())( /*#__PURE__*/Context.empty())); | ||
const liveServices = /*#__PURE__*/Context.add(configProvider.configProviderTag)(configProvider.env())( /*#__PURE__*/Context.add(random.randomTag)(random.make(Math.random() * 4294967296 >>> 0))( /*#__PURE__*/Context.add(clock.clockTag)(clock.make())( /*#__PURE__*/Context.empty()))); | ||
/** | ||
@@ -54,5 +55,26 @@ * The `FiberRef` holding the default `Effect` services. | ||
}; | ||
// circular with ConfigProvider | ||
/** @internal */ | ||
exports.withClock = withClock; | ||
const withConfigProvider = value => { | ||
const trace = (0, _Debug.getCallTrace)(); | ||
return effect => { | ||
return core.fiberRefLocallyWith(Context.add(configProvider.configProviderTag)(value))(currentServices)(effect).traced(trace); | ||
}; | ||
}; | ||
/** @internal */ | ||
exports.withConfigProvider = withConfigProvider; | ||
const configProviderWith = f => { | ||
const trace = (0, _Debug.getCallTrace)(); | ||
return core.fiberRefGetWith(services => f(Context.get(configProvider.configProviderTag)(services)))(currentServices).traced(trace); | ||
}; | ||
/** @internal */ | ||
exports.configProviderWith = configProviderWith; | ||
const config = config => configProviderWith(_ => _.load(config)); | ||
/** @internal */ | ||
exports.config = config; | ||
const configOrDie = config => core.orDie(configProviderWith(_ => _.load(config))); | ||
// circular with Random | ||
/** @internal */ | ||
exports.withClock = withClock; | ||
exports.configOrDie = configOrDie; | ||
const randomWith = f => { | ||
@@ -59,0 +81,0 @@ const trace = (0, _Debug.getCallTrace)(); |
@@ -1206,3 +1206,3 @@ "use strict"; | ||
const repeatOrElseEitherEffectLoop = (self, driver, orElse, value) => { | ||
return core.foldEffect(() => core.map(Either.right)(effect.orDie(driver.last())), b => core.foldEffect(error => core.map(Either.left)(orElse(error, Option.some(b))), value => repeatOrElseEitherEffectLoop(self, driver, orElse, value))(self))(driver.next(value)); | ||
return core.foldEffect(() => core.map(Either.right)(core.orDie(driver.last())), b => core.foldEffect(error => core.map(Either.left)(orElse(error, Option.some(b))), value => repeatOrElseEitherEffectLoop(self, driver, orElse, value))(self))(driver.next(value)); | ||
}; | ||
@@ -1275,3 +1275,3 @@ /** @internal */ | ||
const retryN_EffectLoop = (self, n) => { | ||
return effect.catchAll(e => n < 0 ? core.fail(e) : core.flatMap(() => retryN_EffectLoop(self, n - 1))(core.yieldNow()))(self); | ||
return core.catchAll(e => n < 0 ? core.fail(e) : core.flatMap(() => retryN_EffectLoop(self, n - 1))(core.yieldNow()))(self); | ||
}; | ||
@@ -1296,3 +1296,3 @@ /** @internal */ | ||
const retryOrElseEither_EffectLoop = (self, driver, orElse) => { | ||
return effect.catchAll(e => core.foldEffect(() => core.flatMap(out => core.map(Either.left)(orElse(e, out)))(effect.orDie(driver.last())), () => retryOrElseEither_EffectLoop(self, driver, orElse))(driver.next(e)))(core.map(Either.right)(self)); | ||
return core.catchAll(e => core.foldEffect(() => core.flatMap(out => core.map(Either.left)(orElse(e, out)))(core.orDie(driver.last())), () => retryOrElseEither_EffectLoop(self, driver, orElse))(driver.next(e)))(core.map(Either.right)(self)); | ||
}; | ||
@@ -1311,3 +1311,3 @@ /** @internal */ | ||
return self => { | ||
return effect.catchAll(e => core.flatMap(b => b ? core.fail(e) : core.flatMap(() => retryUntilEffect_Effect(f)(self))(core.yieldNow()))(f(e)))(self).traced(trace); | ||
return core.catchAll(e => core.flatMap(b => b ? core.fail(e) : core.flatMap(() => retryUntilEffect_Effect(f)(self))(core.yieldNow()))(f(e)))(self).traced(trace); | ||
}; | ||
@@ -1365,4 +1365,4 @@ }; | ||
const scheduleFrom_EffectLoop = (self, initial, driver) => { | ||
return core.foldEffect(() => effect.orDie(driver.last()), () => core.flatMap(a => scheduleFrom_EffectLoop(self, a, driver))(self))(driver.next(initial)); | ||
return core.foldEffect(() => core.orDie(driver.last()), () => core.flatMap(a => scheduleFrom_EffectLoop(self, a, driver))(self))(driver.next(initial)); | ||
}; | ||
//# sourceMappingURL=schedule.js.map |
@@ -0,1 +1,2 @@ | ||
import type * as Config from "@effect/io/Config"; | ||
import type * as Effect from "@effect/io/Effect"; | ||
@@ -7,5 +8,9 @@ export type EnforceNonEmptyRecord<R> = keyof R extends never ? never : R; | ||
export type NonEmptyArrayEffect = [Effect.Effect<any, any, any>, ...Array<Effect.Effect<any, any, any>>]; | ||
export type TupleA<T extends NonEmptyArrayEffect> = { | ||
export type NonEmptyArrayConfig = [Config.Config<any>, ...Array<Config.Config<any>>]; | ||
export type TupleEffect<T extends NonEmptyArrayEffect> = { | ||
[K in keyof T]: [T[K]] extends [Effect.Effect<any, any, infer A>] ? A : never; | ||
}; | ||
export type TupleConfig<T extends NonEmptyArrayConfig> = { | ||
[K in keyof T]: [T[K]] extends [Config.Config<infer A>] ? A : never; | ||
}; | ||
//# sourceMappingURL=types.d.ts.map |
{ | ||
"name": "@effect/io", | ||
"version": "0.0.19", | ||
"version": "0.0.20", | ||
"license": "MIT", | ||
@@ -22,3 +22,3 @@ "repository": { | ||
"types": "./*.d.ts", | ||
"default": "./_mjs/*.mjs" | ||
"default": "./mjs/*.mjs" | ||
}, | ||
@@ -25,0 +25,0 @@ "require": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5411514
926
107056
4
1