property-lolscriptors

0.1.0 • Public • Published

property lolscriptors Build Status

patches property descriptor functions so you can configure "non-configurable" properties of objects

Install

npm install property-lolscriptors

Use

var patchPropertyDescriptors = require('property-lolscriptors');
var redefine = patchPropertyDescriptors();
 
var x = {};
 
Object.defineProperty(x, 'y', {
  value: 5
});
 
// x.y => 5
 
// throws TypeError:
Object.defineProperty(x, 'y', {
  value: 5
});
 
// x.y => 5
 
// will not throw TypeError
redefine(x, 'y', {
  value: 10
});
 
// x.y => 10

license

MIT

Package Sidebar

Install

npm i property-lolscriptors

Weekly Downloads

0

Version

0.1.0

License

MIT

Last publish

Collaborators

  • btford