1. sorry, no idProperty. res can be boolean.
2. "true" != true, I think that if res == true and required == "true" then this function should return true. Others types isn't have such double-digit situations.

This situation happens, but I'm not sure what it should include in general use. If you tell me to clean - I'll clean.