you can do an early return to reduce nesting-

if (!(prop in metadata)) return false;