hasType
hasType(
name,tag):TypeOfNode
Defined in: src/query/expression.ts:335
The attribute is set with exactly this type, whatever its value.
Useful when the same name is written with different types across entities — a comparison already asserts the type, so this is for asking about the type alone.
Parameters
Section titled “Parameters”string
The type tag: bool, i32, u256, dec, bytes32, str, addr or key.
Returns
Section titled “Returns”Throws
Section titled “Throws”If the tag is not a settable type, or the name is a system attribute (whose type is fixed).
Example
Section titled “Example”hasType("age", "i32") // TYPEOF(age) = i32