Skip to content

Commit

Permalink
docs(biome_deserialize): update example is_type() with `visitable_t…
Browse files Browse the repository at this point in the history
…ype()` (#3817)
  • Loading branch information
minht11 authored Sep 7, 2024
1 parent d3dacc9 commit 26f4663
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions crates/biome_deserialize/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -249,11 +249,11 @@ impl Deserializable for Union {
name: &str,
diagnostics: &mut Vec<DeserializationDiagnostic>,
) -> Option<Self> {
if value.is_type(DeserializableTypes::BOOL) {
biome_deserialize::Deserializable::deserialize(value, rule_name, diagnostics)
if value.visitable_type()? == DeserializableType::Bool {
biome_deserialize::Deserializable::deserialize(value, name, diagnostics)
.map(Self::Bool)
} else {
biome_deserialize::Deserializable::deserialize(value, rule_name, diagnostics)
biome_deserialize::Deserializable::deserialize(value, name, diagnostics)
.map(Self::Str)
}
}
Expand Down

0 comments on commit 26f4663

Please sign in to comment.