This package has been deprecated

Author message:

depricated

@yo1dog/extendable-error
TypeScript icon, indicating that this package has built-in type declarations

1.0.4 • Public • Published

node-extendable-error

Quick Start

const ExtendableError = require('@yo1dog/extendable-error');

class MyError extends ExtendableError {
  constructor(message) {
    super(message);
  }
}

throw new MyError('hello world');

/*
MyError: hello world
    at readme.js:9:1
    at Script.runInThisContext (vm.js:123:20)
    ...
*/

Docs

ExtendableError.setUnenumerable(obj, key, value)

param type description
obj Object Object to modify.
key string/number/Symbol Key to modify.
value any Value to set.

Sets a property on the given object and makes it unenumerable.

Equivalent to:

obj[key] = value;
Object.defineProperty(obj, key, {enumerable: false});

ExtendableError.makeUnenumerable(obj, key)

param type description
obj Object Object to modify.
key string/number/Symbol Key to modify.

Sets makes a property on the given object unenumerable.

Equivalent to:

Object.defineProperty(obj, key, {enumerable: false});

ExtendableError.prototype.setUnenumerable(key, value)

param type description
key string/number/Symbol Key to modify.
value any Value to set.

Equivalent to:

ExtendableError.setUnenumerable(this, key, value);

ExtendableError.prototype.makeUnenumerable(key)

param type description
key string/number/Symbol Key to modify.

Equivalent to:

ExtendableError.makeUnenumerable(this, key);

Readme

Keywords

none

Package Sidebar

Install

npm i @yo1dog/extendable-error

Weekly Downloads

0

Version

1.0.4

License

ISC

Unpacked Size

8.98 kB

Total Files

6

Last publish

Collaborators

  • yo1dog