Skip to content

Commit

Permalink
test for readonly type in getTags
Browse files Browse the repository at this point in the history
  • Loading branch information
polgfred authored and gcanti committed Dec 10, 2024
1 parent 0a0b0c3 commit e22897a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -657,6 +657,10 @@ function isRecursiveC(codec: Any): codec is RecursiveType<Any> {
return (codec as any)._tag === 'RecursiveType'
}

function isReadonlyC(codec: Any): codec is ReadonlyType<Any> {
return (codec as any)._tag === 'ReadonlyType'
}

const lazyCodecs: Array<Any> = []

/**
Expand All @@ -679,7 +683,7 @@ export function getTags(codec: Any): Tags {
}
}
return index
} else if (isExactC(codec) || isRefinementC(codec)) {
} else if (isExactC(codec) || isRefinementC(codec) || isReadonlyC(codec)) {
return getTags(codec.type)
} else if (isIntersectionC(codec)) {
return codec.types.reduce((tags, codec) => mergeTags(tags, getTags(codec)), emptyTags)
Expand Down

0 comments on commit e22897a

Please sign in to comment.