You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
unboundedpress/node_modules/ava/lib/serialize-error.js

21 lines
402 B
JavaScript

6 years ago
'use strict';
var cleanYamlObject = require('clean-yaml-object');
var beautifyStack = require('./beautify-stack');
function filter(propertyName, isRoot, source, target) {
if (!isRoot) {
return true;
}
if (propertyName === 'stack') {
target.stack = beautifyStack(source.stack);
return false;
}
return true;
}
module.exports = function (error) {
return cleanYamlObject(error, filter);
};