import { isArrayCount, isString } from "./";
export default function objectPath(data, prop) {
    if (isString(prop)) {
        if (prop.indexOf('.') > -1) {
            const arrProp = prop.split('.');
            let result = undefined;
            if (isArrayCount(arrProp)) {
                arrProp.forEach((propName, i) => {
                    if (i === 0) {
                        result = data[propName];
                    }
                    else {
                        result = result[propName];
                    }
                });
            }
            return result;
        }
        return data[prop];
    }
}
