0.1.0 • Published 11 years ago
obsolete v0.1.0
obsolete
Mark removed properties as obsolete so they throw an exception when used
Usage:
var obsolete = require('obsolete');
var foo = {};
obsolete(foo, 'bar');
// throws exceptions 'obsolete property "bar" removed'
foo.bar;
foo.bar = 1;
foo.bar();Uses Object.defineProperty()
with a custom getter and setter to throw Error exceptions on usage.
Useful to cause old dependant code that needs to be updated to
fail fast and fail early as possible, instead of returning and propagating
invalid data (undefined) leading to hard-to-track-down errors further down the line.
License
MIT
0.1.0
11 years ago
