Skip to content

Commit

Permalink
Schema: version 0.68.0 (#2906)
Browse files Browse the repository at this point in the history
  • Loading branch information
gcanti authored Jun 17, 2024
1 parent a67b8fe commit f6c7977
Show file tree
Hide file tree
Showing 146 changed files with 2,897 additions and 2,127 deletions.
447 changes: 447 additions & 0 deletions .changeset/green-seals-count.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/cli/src/internal/args.ts
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ export const withSchema = dual<
return mapEffect(self, (_) =>
Effect.mapError(
decode(_ as any),
(error) => InternalHelpDoc.p(TreeFormatter.formatIssueSync(error.error))
(error) => InternalHelpDoc.p(TreeFormatter.formatErrorSync(error))
))
})

Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/internal/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,7 @@ export const withSchema = dual<
return mapEffect(self, (_) =>
Effect.mapError(
decode(_ as any),
(error) => InternalValidationError.invalidValue(InternalHelpDoc.p(TreeFormatter.formatIssueSync(error.error)))
(error) => InternalValidationError.invalidValue(InternalHelpDoc.p(TreeFormatter.formatErrorSync(error)))
))
})

Expand Down
2 changes: 1 addition & 1 deletion packages/cli/test/Args.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ describe("Args", () => {
expect(result).toEqual(ValidationError.invalidArgument(HelpDoc.p(
"Positive\n" +
"└─ Predicate refinement failure\n" +
" └─ Expected Positive (a positive number), actual -123"
" └─ Expected Positive, actual -123"
)))
}).pipe(runEffect))

Expand Down
20 changes: 10 additions & 10 deletions packages/effect/src/Array.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @since 2.0.0
*/

import type { Either } from "./Either.js"
import type { Either as array_ } from "./Either.js"
import * as E from "./Either.js"
import * as Equal from "./Equal.js"
import * as Equivalence from "./Equivalence.js"
Expand Down Expand Up @@ -2220,11 +2220,11 @@ export const filterMapWhile: {
* @since 2.0.0
*/
export const partitionMap: {
<A, B, C>(f: (a: A, i: number) => Either<C, B>): (self: Iterable<A>) => [left: Array<B>, right: Array<C>]
<A, B, C>(self: Iterable<A>, f: (a: A, i: number) => Either<C, B>): [left: Array<B>, right: Array<C>]
<A, B, C>(f: (a: A, i: number) => array_<C, B>): (self: Iterable<A>) => [left: Array<B>, right: Array<C>]
<A, B, C>(self: Iterable<A>, f: (a: A, i: number) => array_<C, B>): [left: Array<B>, right: Array<C>]
} = dual(
2,
<A, B, C>(self: Iterable<A>, f: (a: A, i: number) => Either<C, B>): [left: Array<B>, right: Array<C>] => {
<A, B, C>(self: Iterable<A>, f: (a: A, i: number) => array_<C, B>): [left: Array<B>, right: Array<C>] => {
const left: Array<B> = []
const right: Array<C> = []
const as = fromIterable(self)
Expand Down Expand Up @@ -2273,7 +2273,7 @@ export const getSomes: <T extends Iterable<Option<X>>, X = any>(
* @category filtering
* @since 2.0.0
*/
export const getLefts = <T extends Iterable<Either<any, any>>>(self: T): Array<Either.Left<ReadonlyArray.Infer<T>>> => {
export const getLefts = <T extends Iterable<array_<any, any>>>(self: T): Array<array_.Left<ReadonlyArray.Infer<T>>> => {
const out: Array<any> = []
for (const a of self) {
if (E.isLeft(a)) {
Expand All @@ -2298,9 +2298,9 @@ export const getLefts = <T extends Iterable<Either<any, any>>>(self: T): Array<E
* @category filtering
* @since 2.0.0
*/
export const getRights = <T extends Iterable<Either<any, any>>>(
export const getRights = <T extends Iterable<array_<any, any>>>(
self: T
): Array<Either.Right<ReadonlyArray.Infer<T>>> => {
): Array<array_.Right<ReadonlyArray.Infer<T>>> => {
const out: Array<any> = []
for (const a of self) {
if (E.isRight(a)) {
Expand Down Expand Up @@ -2382,9 +2382,9 @@ export const partition: {
* @category filtering
* @since 2.0.0
*/
export const separate: <T extends Iterable<Either<any, any>>>(
export const separate: <T extends Iterable<array_<any, any>>>(
self: T
) => [Array<Either.Left<ReadonlyArray.Infer<T>>>, Array<Either.Right<ReadonlyArray.Infer<T>>>] = partitionMap(
) => [Array<array_.Left<ReadonlyArray.Infer<T>>>, Array<array_.Right<ReadonlyArray.Infer<T>>>] = partitionMap(
identity
)

Expand Down Expand Up @@ -2530,7 +2530,7 @@ export const flatMapNullable: {
* @since 2.0.0
*/
export const liftEither = <A extends Array<unknown>, E, B>(
f: (...a: A) => Either<B, E>
f: (...a: A) => array_<B, E>
) =>
(...a: A): Array<B> => {
const e = f(...a)
Expand Down
8 changes: 4 additions & 4 deletions packages/experimental/src/Persistence.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ export type PersistenceError = PersistenceParseError | PersistenceBackingError
export class PersistenceParseError extends TypeIdError(ErrorTypeId, "PersistenceError")<{
readonly reason: "ParseError"
readonly method: string
readonly error: ParseResult.ParseError["error"]
readonly error: ParseResult.ParseError["issue"]
}> {
/**
* @since 1.0.0
*/
static make(method: string, error: ParseResult.ParseError["error"]) {
static make(method: string, error: ParseResult.ParseError["issue"]) {
return new PersistenceParseError({ reason: "ParseError", method, error })
}

Expand Down Expand Up @@ -214,7 +214,7 @@ export const layerResult = Layer.effect(
) =>
Effect.mapError(
Serializable.deserializeExit(key, value),
(_) => PersistenceParseError.make(method, _.error)
(_) => PersistenceParseError.make(method, _.issue)
)
const encode = <R, IE, E, IA, A>(
method: string,
Expand All @@ -223,7 +223,7 @@ export const layerResult = Layer.effect(
) =>
Effect.mapError(
Serializable.serializeExit(key, value),
(_) => PersistenceParseError.make(method, _.error)
(_) => PersistenceParseError.make(method, _.issue)
)
const makeKey = <R, IE, E, IA, A>(
key: ResultPersistence.Key<R, IE, E, IA, A>
Expand Down
4 changes: 1 addition & 3 deletions packages/platform/src/Http/UrlParams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,7 @@ export const fromInput = (input: Input): UrlParams => {
*/
export const schema: Schema.Schema<UrlParams, ReadonlyArray<readonly [string, string]>> = Schema.Array(
Schema.Tuple(Schema.String, Schema.String)
).pipe(
Schema.identifier("UrlParams")
)
).annotations({ identifier: "UrlParams" })

/**
* @since 1.0.0
Expand Down
Loading

0 comments on commit f6c7977

Please sign in to comment.