Error when composing schemas with `Schema.compose` and `Schema.pipe` in Effect Typescript library

Hello i can not add my Schema.filter to Schema.compouse

const StringsArrayFromString = Schema.transform(Schema.String, Schema.Array(Schema.String), {
  strict: true,
  decode: (string) =>
    string
      .split(/[;,\s]+/)
      .map(String.trim)
      .filter(String.isNonEmpty),
  encode: (stringArray) => stringArray.join(','),
});


const uniqueStringsInListSchema = Schema.filter<Schema.Array$<typeof Schema.String>>(
  (stringsList) => {
    const seen = new Set();
    for (const string of stringsList) {
      if (seen.has(string)) {
        return ${string} is a duplicate; // sends validation error message
      }
      seen.add(string);
    }
    return true;
  },
);


const b = Schema.compose(Schema.Trim, StringsArrayFromString).pipe(uniqueStringsInListSchema);


b gives me this ts error
telegram-cloud-photo-size-2-5197502717491279889-y.jpg
Was this page helpful?