effect
4.1.4 · 11 Nov 2026MIT67.1M / weekRepositoryHomepagenpmAtom feed
3.22.5 is the newest release of 3.x.
In short
1 new5 fixed
Security
2 advisories affect 3.13.11; 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
Patch Changes
Schema: Enhance the internal
formatUnknownfunction to handle various types including iterables, classes, and additional edge cases.Before
import { Schema } from "effect" const schema = Schema.Array(Schema.Number) Schema.decodeUnknownSync(schema)(new Set([1, 2])) // throws Expected ReadonlyArray<number>, actual {} class A { constructor(readonly a: number) {} } Schema.decodeUnknownSync(schema)(new A(1)) // throws Expected ReadonlyArray<number>, actual {"a":1}After
import { Schema } from "effect" const schema = Schema.Array(Schema.Number) Schema.decodeUnknownSync(schema)(new Set([1, 2])) // throws Expected ReadonlyArray<number>, actual Set([1,2]) class A { constructor(readonly a: number) {} } Schema.decodeUnknownSync(schema)(new A(1)) // throws Expected ReadonlyArray<number>, actual A({"a":1})Fix issue with generic filters when generating arbitraries, closes #4605.
Previously, applying a
filterto a schema when generating arbitraries could cause aTypeErrordue to missing properties. This fix ensures that arbitraries are generated correctly when filters are used.Before
import { Arbitrary, Schema } from "effect" const schema = Schema.BigIntFromSelf.pipe(Schema.filter(() => true)) Arbitrary.make(schema) // TypeError: Cannot read properties of undefined (reading 'min')After
import { Arbitrary, Schema } from "effect" const schema = Schema.BigIntFromSelf.pipe(Schema.filter(() => true)) const result = Arbitrary.make(schema) // Works correctlySchema: Simplify
StructandRecordreturn types.Improve clarity of the
TimeoutExceptionerror messageAdd support for refinements to
Schema.omit, closes #4603.Before
import { Schema } from "effect" const schema = Schema.Struct({ a: Schema.String, b: Schema.String }) const omitted = schema.pipe( Schema.filter(() => true), Schema.omit("a") ) console.log(String(omitted.ast)) // {} ❌After
import { Schema } from "effect" const schema = Schema.Struct({ a: Schema.String, b: Schema.String }) const omitted = schema.pipe( Schema.filter(() => true), Schema.omit("a") ) console.log(String(omitted.ast)) // { readonly b: string }Schema: Export
Fieldtype.Useful for creating a type that can be used to add custom constraints to the fields of a struct.
import { Schema } from "effect" const f = <Fields extends Record<"a" | "b", Schema.Struct.Field>>( schema: Schema.Struct<Fields> ) => { return schema.omit("a") } // ┌─── Schema.Struct<{ b: typeof Schema.Number; }> // ▼ const result = f(Schema.Struct({ a: Schema.String, b: Schema.Number }))
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.