Since Typst v0.8.0, type(x) returns a proper type instead of a string.
Right now we are comparing types using strings (which was emphasized for v0.0.6). In the future, in order to maintain compatibility with both older and newer typst versions, we should compare types using type on objects of known type, e.g. instead of _type(thing) == "array" use type(thing) == type(()) or something like that, which would be compatible from v0.2.0 to v0.8.0.
Since Typst v0.8.0,
type(x)
returns a proper type instead of a string.Right now we are comparing types using strings (which was emphasized for v0.0.6). In the future, in order to maintain compatibility with both older and newer typst versions, we should compare types using
type
on objects of known type, e.g. instead of_type(thing) == "array"
usetype(thing) == type(())
or something like that, which would be compatible from v0.2.0 to v0.8.0.