0.5.0 • Published 6 years ago

protect v0.5.0

Weekly downloads
3
License
GPL-3.0
Repository
github
Last release
6 years ago

protect

NPM version Linux Status Windows Status Dependency Status Coveralls

protect your object from being overridden

Installation

Install through NPM

npm install protect

or

git clone git://github.com/hex7c0/protect.git

API

inside nodejs project

var protect = require('protect');

var newObj = protect({
    foo: 'ciao'
});

newObj.ciao = 'ciao';
newObj.foo = 123;

with this exception

a.foo = 123;
      ^
TypeError: Cannot assign to read only property 'foo' of [object Object]

protect(obj, normal)

options

  • obj - Object Your object (default "required")
  • normal - Boolean Using {} constructor (default "Object.create(null)")

Examples

Take a look at my examples

License GPLv3

0.5.0

6 years ago

0.4.0

7 years ago

0.3.0

8 years ago

0.2.1

9 years ago

0.2.0

9 years ago

0.1.1

9 years ago

0.1.0

9 years ago

0.0.2

9 years ago

0.0.1

9 years ago