refactor: Replace _.flatMap
usage
#9948
+21
−11
Merged
_.flatMap
usage
#9948