Skip to content

Commit 9e31545

Browse files
author
Mark Lagendijk
committed
Update lodash-deep.js
Improved `Node.js` check.
1 parent a79d1c7 commit 9e31545

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lodash-deep.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@
99
// Node.js support
1010
var _;
1111
var mixins = {};
12-
if(typeof require === 'function'){
12+
if (typeof module !== 'undefined' && module.exports){
1313
_ = require('lodash');
1414
module.exports = mixins;
15-
} else{
15+
}
16+
else{
1617
_ = window._;
1718
}
1819

@@ -58,7 +59,7 @@
5859
return true;
5960
},
6061
/**
61-
* Retreives the value of a property in an object tree.
62+
* Retrieves the value of a property in an object tree.
6263
* @param {Object} object - The root object of the object tree.
6364
* @param {string} propertyPath - The dot separated propertyPath.
6465
* @returns {*} - The value, or undefined if it doesn't exists.

0 commit comments

Comments
 (0)