effect
4.1.4 · 11 Nov 2026MIT67.1M / weekRepositoryHomepagenpmAtom feed
Your version
3.22.5 is the newest release of 3.x.
In short
2 new1 fixed
Security
2 advisories affect 3.11.9; 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: Support template literals in
Schema.Config.Example
import { Schema } from "effect" // const config: Config<`a${string}`> const config = Schema.Config( "A", Schema.TemplateLiteral(Schema.Literal("a"), Schema.String) )Schema: Add support for
TemplateLiteralparameters inTemplateLiteral, closes #4166.This update also adds support for
TemplateLiteralandTemplateLiteralParserparameters inTemplateLiteralParser.Before
import { Schema } from "effect" const schema = Schema.TemplateLiteralParser( "<", Schema.TemplateLiteralParser("h", Schema.Literal(1, 2)), ">" ) /* throws: Error: Unsupported template literal span schema (TemplateLiteral): `h${"1" | "2"}` */After
import { Schema } from "effect" // Schema<readonly ["<", readonly ["h", 2 | 1], ">"], "<h2>" | "<h1>", never> const schema = Schema.TemplateLiteralParser( "<", Schema.TemplateLiteralParser("h", Schema.Literal(1, 2)), ">" ) console.log(Schema.decodeUnknownSync(schema)("<h1>")) // Output: [ '<', [ 'h', 1 ], '>' ]Schema: Fix bug in
TemplateLiteralParserwhere unions of numeric literals were not coerced correctly.Before
import { Schema } from "effect" const schema = Schema.TemplateLiteralParser("a", Schema.Literal(1, 2)) console.log(Schema.decodeUnknownSync(schema)("a1")) /* throws: ParseError: (`a${"1" | "2"}` <-> readonly ["a", 1 | 2]) └─ Type side transformation failure └─ readonly ["a", 1 | 2] └─ [1] └─ 1 | 2 ├─ Expected 1, actual "1" └─ Expected 2, actual "1" */After
import { Schema } from "effect" const schema = Schema.TemplateLiteralParser("a", Schema.Literal(1, 2)) console.log(Schema.decodeUnknownSync(schema)("a1")) // Output: [ 'a', 1 ] console.log(Schema.decodeUnknownSync(schema)("a2")) // Output: [ 'a', 2 ] console.log(Schema.decodeUnknownSync(schema)("a3")) /* throws: ParseError: (`a${"1" | "2"}` <-> readonly ["a", 1 | 2]) └─ Encoded side transformation failure └─ Expected `a${"1" | "2"}`, actual "a3" */
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.