This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React,{Component} from 'react'; | |
import {View, ToastAndroid, TextInput,Text, StyleSheet, Dimensions, Measure, Keyboard, FlatList, TouchableWithoutFeedback, ViewPropTypes} from 'react-native'; | |
import PropTypes from 'prop-types'; | |
import BorderTextInput from './BorderTextInput'; | |
import constants from '../../configurations/constants'; | |
import Icon from 'react-native-vector-icons/Ionicons'; | |
import _ from 'lodash'; | |
import { NativeModulesCall } from '../../services/helperFunctions'; | |
//Created By: Ashish Ranjan |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Param1: Nested Object | |
//Param2: Array of keys in the desired order | |
//Return: Final value from given object based on the given key order if exists, else undefined | |
function nestedObjValue(obj, keyOrder){ | |
return keyOrder.reduce((a,b) => typeof a !== 'object' || !a ? undefined : a[b] , obj) | |
} | |
//Examples | |
nestedObjValue({a: {b: {c : {d: {e: 3}}}}}, ['a','b', 'c', 'd', 'e']) //3 |