fix(docs): improve predicate type (#148)

This commit is contained in:
Jacob
2023-01-21 19:54:30 +01:00
committed by GitHub
parent 989be532d8
commit 3abee4f89e
2 changed files with 6 additions and 3 deletions

View File

@@ -6,7 +6,6 @@ import Token from '@site/src/components/Api/Code/Token';
import TokenList, {ListType} from '@site/src/components/Api/Code/TokenList';
export default function MappedType({type}: {type: JSONOutput.MappedType}) {
// TODO Figure out what `type.asserts` does.
return (
<>
<TokenList type={ListType.Curly}>

View File

@@ -9,8 +9,12 @@ export default function PredicateType({
}: {
type: JSONOutput.PredicateType;
}) {
// TODO Figure out what `type.asserts` does.
return (
return type.asserts ? (
<>
<Token type="keyword">asserts </Token>
<Token>{type.name} </Token>
</>
) : (
<>
<Token>{type.name} </Token>
<Token type="keyword">is </Token>