A functional safe-dereferencer for complex JavaScript objects