Skip to content

Commit

Permalink
fix typo (isExact -> exact) and make internal toASTAnnotations
Browse files Browse the repository at this point in the history
…more general (Effect-TS#2998)
  • Loading branch information
gcanti authored Jun 16, 2024
1 parent 3b15e1b commit 0ff11d7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
4 changes: 2 additions & 2 deletions packages/schema/src/ParseResult.ts
Original file line number Diff line number Diff line change
Expand Up @@ -710,7 +710,7 @@ export const validate = <A, I, R>(
getEffect(AST.typeAST(schema.ast), true, options)

/**
* By default the option `isExact` is set to `true`.
* By default the option `exact` is set to `true`.
*
* @category validation
* @since 0.67.0
Expand All @@ -722,7 +722,7 @@ export const is = <A, I, R>(schema: Schema.Schema<A, I, R>, options?: AST.ParseO
}

/**
* By default the option `isExact` is set to `true`.
* By default the option `exact` is set to `true`.
*
* @category validation
* @since 0.67.0
Expand Down
10 changes: 7 additions & 3 deletions packages/schema/src/Schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,12 @@ const variance = {
_R: (_: never) => _
}

interface AllAnnotations<A, TypeParameters extends ReadonlyArray<any>>
extends Annotations.Schema<A, TypeParameters>, PropertySignature.Annotations<A>
{}

const toASTAnnotations = <A, TypeParameters extends ReadonlyArray<any>>(
annotations?: Annotations.Schema<A, TypeParameters>
annotations?: AllAnnotations<A, TypeParameters>
): AST.Annotations => {
if (!annotations) {
return {}
Expand Down Expand Up @@ -326,7 +330,7 @@ export const typeSchema = <A, I, R>(schema: Schema<A, I, R>): SchemaClass<A> =>
/* c8 ignore start */
export {
/**
* By default the option `isExact` is set to `true`.
* By default the option `exact` is set to `true`.
*
* @category validation
* @since 0.67.0
Expand Down Expand Up @@ -373,7 +377,7 @@ export {
*/
encodeUnknownSync,
/**
* By default the option `isExact` is set to `true`.
* By default the option `exact` is set to `true`.
*
* @category validation
* @since 0.67.0
Expand Down

0 comments on commit 0ff11d7

Please sign in to comment.