1.0.0 • Published 9 years ago

value-error v1.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
9 years ago

value-error Build Status

Extract the data from an Error to a plain object

Install

$ npm install --save value-error

Usage

var valueError = require('value-error')
var err = new Error('OH NO')
err.data = {foo: 'bar'}
valueError(err)
//=> {message: 'OH NO', data: {foo: 'bar'}}

API

valueError(err) -> object

err

Required
Type: error

An Error instance to be copied into a plain object. All enumerable properties will be copied. The message will be copied even if it is non-enumerable. Other non-enumerable/inherited properties like stack and name will not be included.

License

MIT © Ben Drucker