foundryvtt icon indicating copy to clipboard operation
foundryvtt copied to clipboard

Allow getProperty to traverse Collections/Maps

Open mkahvi opened this issue 3 years ago • 3 comments

User Experience

Currently getProperty() fails on these since getType() returns Map for both which is not supported by the function.

~~"key" in collection and collection[key] both work with both as far as I can tell, and these are just nice for organizing data, so getProperty() not failing on them would be nice addition to object and array traversal.~~ (Nope)

mkahvi avatar Sep 01 '22 12:09 mkahvi

My own personal use case is adding Collections to .system as part of prepareData, which gets partially copied into roll data where rolls then fail due to variable resolution relying on getProperty()

I don't absolutely need collections for this particular use case, so it's trivial fix for now.

mkahvi avatar Sep 01 '22 12:09 mkahvi

Nevermind, I guess, I have done the oopsies with bad testing and false assumptions. (it'd still be cool tho, there's just a lot more involved)

mkahvi avatar Sep 01 '22 12:09 mkahvi

Will keep it around as a feature request to consider.

aaclayton avatar Sep 01 '22 15:09 aaclayton