effect
4.1.4 · 11 Nov 2026MIT67.1M / weekRepositoryHomepagenpmAtom feed
3.22.5 is the newest release of 3.x.
In short
8 new
Security
2 advisories affect 3.17.0; 3.22.1 fixes them
- HighEffect: ReDoS in Schema.TemplateLiteral compiled regexGHSA-7589-6fvf-x4pw · 19 Nov 2026Fixed in 3.22.1
- HighEffect `AsyncLocalStorage` context lost/contaminated inside Effect fibers under concurrent load with RPCGHSA-38f7-945m-qr2g · 20 Mar 2026Fixed in 3.20.0
Release note
Minor Changes
Added
Random.fixedto create a version of theRandomservice with fixed
values for testing.Add
Struct.entriesfunctionAdd
Layer.mockCreates a mock layer for testing purposes. You can provide a partial
implementation of the service, and any methods not provided will
throw anUnimplementedErrordefect when called.import { Context, Effect, Layer } from "effect" class MyService extends Context.Tag("MyService")< MyService, { one: Effect.Effect<number> two(): Effect.Effect<number> } >() {} const MyServiceTest = Layer.mock(MyService, { two: () => Effect.succeed(2) })Schedule output has been added into
CurrentIterationMetadataRemove global state index by version, make version mismatch a warning message
Array: Add findFirstWithIndex function
Add HashMap.countBy
import { HashMap } from "effect" const map = HashMap.make([1, "a"], [2, "b"], [3, "c"]) const result = HashMap.countBy(map, (_v, key) => key % 2 === 1) console.log(result) // 2Add Effect.ensure{Success,Error,Requirements}Type, for constraining Effect types
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.