Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

safer-object

Social Media Photo by freestocks.org on Unsplash

Build Status Coverage Status WebReflection status

Flattened objects with non configurable, and non writable fields (i.e. to freeze prototypes).

const obj = saferObject({
  __proto__: {
    name: 'shadowed',
    parent: 'super'
  },
  name: 'test'
});

obj.name = 'nope';
obj.parent = {nope: true};

console.assert(obj.name === 'test');
console.assert(obj.parent === 'super');
console.assert(obj.hasOwnProperty('parent'));
console.assert(obj.hasOwnProperty('hasOwnProperty'));

About

Flattened objects with non configurable, and non writable fields.

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages