artdaq_node_server
v1_00_09
Main Page
Related Pages
Namespaces
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Variables
Pages
src
node_modules
xml2js
node_modules
xmlbuilder
node_modules
lodash
result.js
1
var castPath = require(
'./_castPath'
),
2
isFunction = require(
'./isFunction'
),
3
toKey = require(
'./_toKey'
);
4
34
function
result(
object
, path, defaultValue) {
35
path = castPath(path,
object
);
36
37
var index = -1,
38
length = path.length;
39
40
// Ensure the loop is entered when path is empty.
41
if
(!length) {
42
length = 1;
43
object
= undefined;
44
}
45
while
(++index < length) {
46
var value =
object
== null ? undefined :
object
[toKey(path[index])];
47
if
(value === undefined) {
48
index = length;
49
value = defaultValue;
50
}
51
object
= isFunction(value) ? value.call(
object
) : value;
52
}
53
return
object;
54
}
55
56
module.exports = result;
Generated on Tue Aug 8 2017 08:55:45 for artdaq_node_server by
1.8.5