Issue with `Schema.TemplateLiteral` and Linebreak Characters in Strings

I may have found unexpected behaviour with Schema.TemplateLiteral and strings containing linebreak characters:

import { Schema } from "effect"

type T = `passage: ${string}`;
const x = 'passage: Singapore \n14 December' satisfies T;

console.log(Schema.decodeSync(Schema.TemplateLiteral('passage: ', Schema.String))('passage: Singapore \n14 December'))


the type is satisfied, but when running this the output is:

{
  _id: 'ParseError',
  message: 'Expected `passage: ${string}`, actual "passage: Singapore \\n14 December"'
}
Was this page helpful?