Skip to content

Commit

Permalink
Change trimmed json-schema pattern (#2775)
Browse files Browse the repository at this point in the history
Co-authored-by: maksim.khramtsov <maksim.khramtsov@btsdigital.kz>
  • Loading branch information
KhraksMamtsov and maksim.khramtsov committed May 20, 2024
1 parent 19da8d0 commit 5432fff
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/gentle-tools-nail.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@effect/schema": patch
---

change trimmed json-schema pattern
2 changes: 1 addition & 1 deletion packages/schema/src/Schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3563,7 +3563,7 @@ export const trimmed =
filter((a) => a === a.trim(), {
typeId: TrimmedTypeId,
description: "a string with no leading or trailing whitespace",
jsonSchema: { pattern: "^.*[a-zA-Z0-9]+.*$" },
jsonSchema: { pattern: "^\\S.*\\S$|^\\S$|^$" },
...annotations
})
)
Expand Down

0 comments on commit 5432fff

Please sign in to comment.