effect
4.1.4 · 11 Nov 2026MIT67.1M / weekRepositoryHomepagenpmAtom feed
3.22.5 is the newest release of 3.x.
In short
3 fixed
Security
2 advisories affect 3.12.3; 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
Improve pattern handling by merging multiple patterns into a union, closes #4243.
Previously, the algorithm always prioritized the first pattern when multiple patterns were encountered.
This fix introduces a merging strategy that combines patterns into a union (e.g.,
(?:${pattern1})|(?:${pattern2})). By doing so, all patterns have an equal chance to generate values when usingFastCheck.stringMatching.Example
import { Arbitrary, FastCheck, Schema } from "effect" // /^[^A-Z]*$/ (given by Lowercase) + /^0x[0-9a-f]{40}$/ const schema = Schema.Lowercase.pipe(Schema.pattern(/^0x[0-9a-f]{40}$/)) const arb = Arbitrary.make(schema) // Before this fix, the first pattern would always dominate, // making it impossible to generate values const sample = FastCheck.sample(arb, { numRuns: 100 }) console.log(sample)Correct
Arbitrary.maketo support nestedTemplateLiterals.Previously,
Arbitrary.makedid not properly handle nestedTemplateLiteralschemas, resulting in incorrect or empty outputs. This fix ensures that nested template literals are processed correctly, producing valid arbitrary values.Before
import { Arbitrary, FastCheck, Schema as S } from "effect" const schema = S.TemplateLiteral( "<", S.TemplateLiteral("h", S.Literal(1, 2)), ">" ) const arb = Arbitrary.make(schema) console.log(FastCheck.sample(arb, { numRuns: 10 })) /* Output: [ '<>', '<>', '<>', '<>', '<>', '<>', '<>', '<>', '<>', '<>' ] */After
import { Arbitrary, FastCheck, Schema as S } from "effect" const schema = S.TemplateLiteral( "<", S.TemplateLiteral("h", S.Literal(1, 2)), ">" ) const arb = Arbitrary.make(schema) console.log(FastCheck.sample(arb, { numRuns: 10 })) /* Output: [ '<h2>', '<h2>', '<h2>', '<h2>', '<h2>', '<h1>', '<h2>', '<h1>', '<h1>', '<h1>' ] */Allow
Schema.TemplateLiteralto handle strings with linebreaks, closes #4251.Before
import { Schema } from "effect" const schema = Schema.TemplateLiteral("a: ", Schema.String) console.log(Schema.decodeSync(schema)("a: b \n c")) // throws: ParseError: Expected `a: ${string}`, actual "a: b \n c"After
import { Schema } from "effect" const schema = Schema.TemplateLiteral("a: ", Schema.String) console.log(Schema.decodeSync(schema)("a: b \n c")) /* Output: a: b c */
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.