Skip to content
This repository has been archived by the owner on Jul 16, 2024. It is now read-only.

Refactor ParseResult module #690

Closed
wants to merge 18 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/breezy-rings-ring.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@effect/schema": patch
---

Schema: add more descriptions
5 changes: 5 additions & 0 deletions .changeset/friendly-drinks-double.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@effect/schema": minor
---

AST: simplify `createRefinement` return type
15 changes: 15 additions & 0 deletions .changeset/gentle-readers-call.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
"@effect/schema": minor
---

Refactor `ParseResult` module:

- add `Union` issue, and replace `UnionMember` with `Union`
- add `Tuple` issue, and replace `Index` with `Tuple`
- add `TypeLiteral` issue
- add `Transform` issue
- add `Refinement` issue
- add `ast` field to `Member`
- rename `UnionMember` to `Member`
- `Unexpected`: rename `ast` to `expected` and make the field required
- `Type`: rename `expected` to `ast`
5 changes: 5 additions & 0 deletions .changeset/rotten-flowers-jam.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@effect/schema": patch
---

add Format module
2 changes: 1 addition & 1 deletion docs/modules/AST.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@ export declare const createRefinement: <From extends AST>(
from: From,
filter: Refinement["filter"],
annotations?: Annotated["annotations"]
) => Transform | Refinement<From>
) => Refinement<From>
```

Added in v1.0.0
Expand Down
52 changes: 52 additions & 0 deletions docs/modules/Format.ts.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
title: Format.ts
nav_order: 5
parent: Modules
---

## Format overview

Added in v1.0.0

---

<h2 class="text-delta">Table of contents</h2>

- [formatting](#formatting)
- [format](#format)
- [formatAST](#formatast)
- [formatUnknown](#formatunknown)

---

# formatting

## format

**Signature**

```ts
export declare const format: <I, A>(schema: Schema.Schema<I, A>) => string
```

Added in v1.0.0

## formatAST

**Signature**

```ts
export declare const formatAST: (ast: AST.AST, verbose?: boolean) => string
```

Added in v1.0.0

## formatUnknown

**Signature**

```ts
export declare const formatUnknown: (u: unknown) => string
```

Added in v1.0.0
2 changes: 1 addition & 1 deletion docs/modules/JSONSchema.ts.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: JSONSchema.ts
nav_order: 6
nav_order: 7
parent: Modules
---

Expand Down
Loading
Loading