4
0
Fork 0
mirror of https://github.com/Azure/setup-helm.git synced 2025-11-07 21:16:57 +00:00
setup-helm/node_modules/underscore/amd/get.js
2022-06-27 14:17:15 -04:00

14 lines
501 B
JavaScript

define(['./_toPath', './_deepGet', './isUndefined'], function (_toPath, _deepGet, isUndefined) {
// Get the value of the (deep) property on `path` from `object`.
// If any property in `path` does not exist or if the value is
// `undefined`, return `defaultValue` instead.
// The `path` is normalized through `_.toPath`.
function get(object, path, defaultValue) {
var value = _deepGet(object, _toPath(path));
return isUndefined(value) ? defaultValue : value;
}
return get;
});