Repository URL to install this package:
|
Version:
6.0.4 ▾
|
import { AnyArrayOrObj } from '../_typings';
declare const _default: <Value = any>(obj: AnyArrayOrObj, path: string | string[], fallback: Value) => any[] | import("../_typings/Serializable").AnyObj | (import("../_typings/Serializable").AnyObj & any[]) | Value;
/**
* @desc dot-prop get at path
* @namespace dot
* @memberOf dot
* @since 3.0.0
*
* @alias dotGet
* @alias get
*
* @param obj the object to retrieve the nested property from.
* @param path dot-prop-path to use
* @param fallback use when there is no value at specified path
* @return value at path or fallback
*
* @func
* @extends dot/getPathSegments
*
* {@link https://github.com/jashkenas/underscore/blob/master/underscore.js#L150 underscore-deep-get}
* @see {@link underscore-deep-get}
*
* @example
*
* dot.get({a: {b: 2}}, 'a.b') //=> 2
* dot.get({a: {b: 2}}, ['a', 'b']) //=> 2
* dot.get({c: {b: 2}}, ['a', 'b']) //=> undefined
*
*/
export default _default;