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.
21 lines
402 B
JavaScript
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);
|
||
|
};
|