@effect/io
Advanced tools
Comparing version 0.38.1 to 0.38.2
@@ -7,2 +7,3 @@ /** | ||
import type * as ConfigProvider from "@effect/io/Config/Provider"; | ||
import type * as Console from "@effect/io/Console"; | ||
import type * as FiberRef from "@effect/io/FiberRef"; | ||
@@ -15,3 +16,3 @@ import type * as Random from "@effect/io/Random"; | ||
*/ | ||
export type DefaultServices = Clock.Clock | Random.Random | ConfigProvider.ConfigProvider | Tracer.Tracer; | ||
export type DefaultServices = Clock.Clock | Console.Console | Random.Random | ConfigProvider.ConfigProvider | Tracer.Tracer; | ||
/** | ||
@@ -18,0 +19,0 @@ * @since 1.0.0 |
@@ -13,2 +13,3 @@ "use strict"; | ||
var core = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/io/internal/core")); | ||
var console_ = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/io/internal/defaultServices/console")); | ||
var random = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/io/internal/random")); | ||
@@ -19,3 +20,3 @@ var tracer = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/io/internal/tracer")); | ||
/** @internal */ | ||
const liveServices = /*#__PURE__*/Context.add(tracer.tracerTag, tracer.nativeTracer)( /*#__PURE__*/Context.add(configProvider.configProviderTag, configProvider.fromEnv())( /*#__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(tracer.tracerTag, tracer.nativeTracer)( /*#__PURE__*/Context.add(configProvider.configProviderTag, configProvider.fromEnv())( /*#__PURE__*/Context.add(random.randomTag, random.make(Math.random() * 4294967296 >>> 0))( /*#__PURE__*/Context.add(console_.consoleTag, console_.defaultConsole)( /*#__PURE__*/Context.add(clock.clockTag, clock.make())( /*#__PURE__*/Context.empty()))))); | ||
/** | ||
@@ -22,0 +23,0 @@ * The `FiberRef` holding the default `Effect` services. |
@@ -6,4 +6,4 @@ "use strict"; | ||
}); | ||
exports.takeWhile = exports.takeUntil = exports.tagMetrics = exports.summarized = exports.succeedSome = exports.succeedNone = exports.spanLinks = exports.spanAnnotations = exports.some = exports.sleep = exports.setFiberRefs = exports.serviceFunctionEffect = exports.serviceFunction = exports.sandbox = exports.repeatN = exports.reduceWhile = exports.reduceRight = exports.reduce = exports.random = exports.provideServiceEffect = exports.provideService = exports.promise = exports.patchFiberRefs = exports.parallelErrors = exports.orElseSucceed = exports.orElseFail = exports.optionFromOptional = exports.option = exports.once = exports.none = exports.negate = exports.merge = exports.memoize = exports.match = exports.mapErrorCause = exports.mapAccum = exports.makeSpan = exports.loop = exports.logWarning = exports.logTrace = exports.logInfo = exports.logFatal = exports.logError = exports.logDebug = exports.logAnnotations = exports.log = exports.linkSpans = exports.labelMetricsSet = exports.labelMetrics = exports.iterate = exports.isSuccess = exports.isFailure = exports.inheritFiberRefs = exports.ignoreLogged = exports.ignore = exports.head = exports.getFiberRefs = exports.gen = exports.fromNullable = exports.forever = exports.flipWith = exports.firstSuccessOf = exports.findFirst = exports.filterOrFail = exports.filterOrElse = exports.filterOrDieMessage = exports.filterOrDie = exports.filterMap = exports.every = exports.eventually = exports.dropWhile = exports.dropUntil = exports.diffFiberRefs = exports.descriptorWith = exports.descriptor = exports.delay = exports.currentTimeNanosTracing = exports.currentSpan = exports.currentParentSpan = exports.contextWith = exports.clockWith = exports.clock = exports.cause = exports.catchTags = exports.catchTag = exports.catchSomeDefect = exports.catchSomeCause = exports.catchAllDefect = exports.bindValue = exports.bindTo = exports.bind = exports.asyncOption = exports.asSomeError = exports.asSome = exports.annotateSpans = exports.annotateLogs = exports.annotateCurrentSpan = exports.allowInterrupt = exports._catch = exports.Do = void 0; | ||
exports.withSpan = exports.withParentSpan = exports.withMetric = exports.withLogSpan = exports.whenRef = exports.whenFiberRef = exports.when = exports.useSpan = exports.updateService = exports.updateFiberRefs = exports.unsandbox = exports.unlessEffect = exports.unless = exports.try_ = exports.tryPromise = exports.tryMapPromise = exports.tryMap = exports.tracerWith = exports.tracer = exports.timedWith = exports.timed = exports.tapErrorTag = exports.tapErrorCause = exports.tapError = exports.tapDefect = exports.tapBoth = void 0; | ||
exports.summarized = exports.succeedSome = exports.succeedNone = exports.spanLinks = exports.spanAnnotations = exports.some = exports.sleep = exports.setFiberRefs = exports.serviceMembers = exports.serviceFunctions = exports.serviceFunctionEffect = exports.serviceFunction = exports.serviceConstants = exports.sandbox = exports.repeatN = exports.reduceWhile = exports.reduceRight = exports.reduce = exports.random = exports.provideServiceEffect = exports.provideService = exports.promise = exports.patchFiberRefs = exports.parallelErrors = exports.orElseSucceed = exports.orElseFail = exports.optionFromOptional = exports.option = exports.once = exports.none = exports.negate = exports.merge = exports.memoize = exports.match = exports.mapErrorCause = exports.mapAccum = exports.makeSpan = exports.loop = exports.logWarning = exports.logTrace = exports.logInfo = exports.logFatal = exports.logError = exports.logDebug = exports.logAnnotations = exports.log = exports.linkSpans = exports.labelMetricsSet = exports.labelMetrics = exports.iterate = exports.isSuccess = exports.isFailure = exports.inheritFiberRefs = exports.ignoreLogged = exports.ignore = exports.head = exports.getFiberRefs = exports.gen = exports.fromNullable = exports.forever = exports.flipWith = exports.firstSuccessOf = exports.findFirst = exports.filterOrFail = exports.filterOrElse = exports.filterOrDieMessage = exports.filterOrDie = exports.filterMap = exports.every = exports.eventually = exports.dropWhile = exports.dropUntil = exports.diffFiberRefs = exports.descriptorWith = exports.descriptor = exports.delay = exports.currentTimeNanosTracing = exports.currentSpan = exports.currentParentSpan = exports.contextWith = exports.clockWith = exports.clock = exports.cause = exports.catchTags = exports.catchTag = exports.catchSomeDefect = exports.catchSomeCause = exports.catchAllDefect = exports.bindValue = exports.bindTo = exports.bind = exports.asyncOption = exports.asSomeError = exports.asSome = exports.annotateSpans = exports.annotateLogs = exports.annotateCurrentSpan = exports.allowInterrupt = exports._catch = exports.Do = void 0; | ||
exports.withSpan = exports.withParentSpan = exports.withMetric = exports.withLogSpan = exports.whenRef = exports.whenFiberRef = exports.when = exports.useSpan = exports.updateService = exports.updateFiberRefs = exports.unsandbox = exports.unlessEffect = exports.unless = exports.try_ = exports.tryPromise = exports.tryMapPromise = exports.tryMap = exports.tracerWith = exports.tracer = exports.timedWith = exports.timed = exports.tapErrorTag = exports.tapErrorCause = exports.tapError = exports.tapDefect = exports.tapBoth = exports.takeWhile = exports.takeUntil = exports.tagMetrics = void 0; | ||
var Chunk = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/data/Chunk")); | ||
@@ -797,2 +797,22 @@ var Context = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/data/Context")); | ||
const serviceFunction = (service, f) => (...args) => core.map(service, a => f(a)(...args)); | ||
/** @internal */ | ||
exports.serviceFunction = serviceFunction; | ||
const serviceFunctions = tag => new Proxy({}, { | ||
get(_target, prop, _receiver) { | ||
return (...args) => core.flatMap(tag, s => s[prop](...args)); | ||
} | ||
}); | ||
/** @internal */ | ||
exports.serviceFunctions = serviceFunctions; | ||
const serviceConstants = tag => new Proxy({}, { | ||
get(_target, prop, _receiver) { | ||
return core.flatMap(tag, s => s[prop]); | ||
} | ||
}); | ||
/** @internal */ | ||
exports.serviceConstants = serviceConstants; | ||
const serviceMembers = tag => ({ | ||
functions: serviceFunctions(tag), | ||
constants: serviceConstants(tag) | ||
}); | ||
// ----------------------------------------------------------------------------- | ||
@@ -802,3 +822,3 @@ // tracing | ||
/* @internal */ | ||
exports.serviceFunction = serviceFunction; | ||
exports.serviceMembers = serviceMembers; | ||
const annotateCurrentSpan = function () { | ||
@@ -805,0 +825,0 @@ const args = arguments; |
{ | ||
"name": "@effect/io", | ||
"version": "0.38.1", | ||
"version": "0.38.2", | ||
"description": "Functional programming in TypeScript", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -7,2 +7,3 @@ /** | ||
import type * as ConfigProvider from "@effect/io/Config/Provider" | ||
import type * as Console from "@effect/io/Console" | ||
import type * as FiberRef from "@effect/io/FiberRef" | ||
@@ -17,3 +18,8 @@ import * as internal from "@effect/io/internal/defaultServices" | ||
*/ | ||
export type DefaultServices = Clock.Clock | Random.Random | ConfigProvider.ConfigProvider | Tracer.Tracer | ||
export type DefaultServices = | ||
| Clock.Clock | ||
| Console.Console | ||
| Random.Random | ||
| ConfigProvider.ConfigProvider | ||
| Tracer.Tracer | ||
@@ -20,0 +26,0 @@ /** |
@@ -13,2 +13,3 @@ import type * as Chunk from "@effect/data/Chunk" | ||
import * as core from "@effect/io/internal/core" | ||
import * as console_ from "@effect/io/internal/defaultServices/console" | ||
import * as random from "@effect/io/internal/random" | ||
@@ -23,2 +24,3 @@ import * as tracer from "@effect/io/internal/tracer" | ||
Context.add(clock.clockTag, clock.make()), | ||
Context.add(console_.consoleTag, console_.defaultConsole), | ||
Context.add(random.randomTag, random.make((Math.random() * 4294967296) >>> 0)), | ||
@@ -25,0 +27,0 @@ Context.add(configProvider.configProviderTag, configProvider.fromEnv()), |
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 too big to display
Sorry, the diff of this file is too big to display
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
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
6524078
1037
116482