'use strict'; module.exports = function serializeError(error) { /* The `name`, `message` and `stack` properties are not always enumerable, so we need to add them explicitly. */ return Object.assign({}, error, { stack: error.stack, message: error.message, name: error.name }); };