obsolete

0.1.0 • Public • Published

obsolete

Mark removed properties as obsolete so they throw an exception when used

Build Status

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

Readme

Keywords

Package Sidebar

Install

npm i obsolete

Weekly Downloads

12

Version

0.1.0

License

MIT

Last publish

Collaborators

  • deathcap