inspector-with-exceptions

1.0.3 • Public • Published

Install

$ npm install inspector-with-exceptions

Usage

import MyCustomException from './MyCustomException';

const Inspector = require('inspector-with-exceptions');

Example

import MyCustomException from './MyCustomException';

const Inspector = require('inspector-with-exceptions');

const value = null;

/**
 * Some logic
 */

try {
  Inspector.isNumber(value, 'Must be a number', MyCustomException);
} catch (e) {
  if (e instanceof MyCustomException) {
    console.log('MyCustomException');
  }
}

Package Sidebar

Install

npm i inspector-with-exceptions

Weekly Downloads

4

Version

1.0.3

License

MIT

Unpacked Size

99.2 kB

Total Files

9

Last publish

Collaborators

  • doox911