mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-06 01:47:48 +00:00
Ensure _.isPlainObject returns true for empty objects in older browsers. [closes #283]
Former-commit-id: d01d32b1cbd87d08bc8014d07eaa1842e3118a40
This commit is contained in:
13
build.js
13
build.js
@@ -1319,14 +1319,11 @@
|
||||
source = removeFunction(source, 'isNode');
|
||||
source = removeSupportProp(source, 'nodeClass');
|
||||
|
||||
// remove `support.nodeClass` from `shimIsPlainObject`
|
||||
source = source.replace(matchFunction(source, 'shimIsPlainObject'), function(match) {
|
||||
return match.replace(/\(support\.nodeClass[\s\S]+?\)\)/, 'true');
|
||||
});
|
||||
|
||||
// remove `support.nodeClass` from `_.clone`
|
||||
source = source.replace(matchFunction(source, 'clone'), function(match) {
|
||||
return match.replace(/\s*\|\|\s*\(!support\.nodeClass[\s\S]+?\)\)/, '');
|
||||
// remove `support.nodeClass` from `_.clone` and `shimIsPlainObject`
|
||||
_.each(['clone', 'shimIsPlainObject'], function(methodName) {
|
||||
source = source.replace(matchFunction(source, methodName), function(match) {
|
||||
return match.replace(/\s*\|\|\s*\(!support\.nodeClass[\s\S]+?\)\)/, '');
|
||||
});
|
||||
});
|
||||
|
||||
// remove `support.nodeClass` from `_.isEqual`
|
||||
|
||||
Reference in New Issue
Block a user