var has = Object.prototype.hasOwnProperty;
export default function getFromPath(obj, path, defaultValue) {
    if (typeof path === 'string') {
        path = path.split('.');
    }
    path = path !== null && path !== void 0 ? path : [];
    var val = obj;
    for (var i = 0; i < path.length; i++) {
        var k = path[i];
        if (!has.call(val, k)) {
            return defaultValue;
        }
        val = val[k];
    }
    return path.length ? val : defaultValue;
}
