Last active
          September 1, 2021 14:30 
        
      - 
      
- 
        Save extrimua/71a8b46e5da2b3e4f8814caf4a86f00a to your computer and use it in GitHub Desktop. 
    deepFreeze
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | const deepFreeze = obj => { | |
| Object.keys(obj).forEach(prop => { | |
| if (typeof obj[prop] === 'object') deepFreeze(obj[prop]); | |
| }); | |
| return Object.freeze(obj); | |
| }; | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment