#(baileyc889) How to get map deep keys based on #input

10 messages · Page 1 of 1 (latest)

viral quarry
#

Say I have a map:

    test:
        pass:
            fail:
                succeed: yay```

is there a tag that returns how deep a key is, and a tag that returns a key based on the input number of deepness?


like <map[thismap].key_depth[pass]>   would return "3"
or   <map[thismap].key_get[3]>  would return "pass"
tranquil sinewBOT
#

(baileyc889) How to get map deep keys based on #input

tranquil sinewBOT
#

Hi I'm AutoThreadBot! Don't mind me, I'll just be adding the helper team to this thread so they can see it. A human will get to you soon.

hearty phoenix
#

"pass" is not 3 deep, pass is 0 deep and unset

#

map.test.pass is 3 deep

#

which you can determine by counting the . characters

#

get[3] style tag wouldn't make sense, what are you getting? The whole point of a map is there's many keys at each level. Which key are you reading?

#

If you have a very linear set of values, you don't want a map, you want a list

viral quarry
#

good point. I should change up how I want to do this then