Repository URL to install this package:
|
Version:
7.1.47 ▾
|
if (!('toJSON' in Error.prototype)) {
Object.defineProperty(Error.prototype, 'toJSON', {
value() {
const serialized = {}
Object.getOwnPropertyNames(this).forEach(function(
this: Error,
key: string
) {
serialized[key] = this[key]
},
this)
return serialized
},
configurable: true,
writable: true,
})
}