Travis build: 342 [cron]
This commit is contained in:
@ -1,17 +1,6 @@
|
||||
const deepFreeze = obj => {
|
||||
Object.freeze(obj);
|
||||
|
||||
Object.getOwnPropertyNames(obj).forEach(function(prop) {
|
||||
if (
|
||||
obj.hasOwnProperty(prop) &&
|
||||
obj[prop] !== null &&
|
||||
(typeof obj[prop] === 'object' || typeof obj[prop] === 'function') &&
|
||||
!Object.isFrozen(obj[prop])
|
||||
) {
|
||||
deepFreeze(obj[prop]);
|
||||
}
|
||||
});
|
||||
|
||||
return obj;
|
||||
};
|
||||
const deepFreeze = obj =>
|
||||
Object.keys(obj).forEach(
|
||||
prop =>
|
||||
!obj[prop] instanceof Object || Object.isFrozen(obj[prop]) ? null : deepFreeze(obj[prop])
|
||||
) || Object.freeze(obj);
|
||||
module.exports = deepFreeze;
|
||||
|
||||
3238
test/testlog
3238
test/testlog
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user