Get type of rune entity

It is possible to obtain rune entities that are around the hero by writing the following code: runes = Entities:FindAllByClassnameWithin("dota_item_rune", hero:GetAbsOrigin(), hero:GetCurrentVisionRange())

You can then loop through them and get their origin/id. For example id can then be used by the hero to pickup any rune using: local rune = EntIndexToHScript( hero:PickupRune(rune)

What I am struggling with is how to get a type of the rune? If it is stored as item, then is there a function that would return me the type of it? (So I can then for example compare it with one of the DOTA_RUNES constants?)

(The function here: int GetRuneType( nRuneLoc ) doesn't work/is outdated )