mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-14 16:46:25 +00:00
e7a969016d
* refactor(logger): Update logger internals * Check the entire logger directory * Refactor sanitizeValue function * Backport changes * Backport test too
30 lines
766 B
TypeScript
30 lines
766 B
TypeScript
import traverse from 'traverse';
|
|
import type { RenovateConfig } from '../config/types';
|
|
|
|
export default function configSerializer(
|
|
config: RenovateConfig
|
|
): RenovateConfig {
|
|
const templateFields = ['prBody'];
|
|
const contentFields = [
|
|
'content',
|
|
'contents',
|
|
'packageLockParsed',
|
|
'yarnLockParsed',
|
|
];
|
|
const arrayFields = ['packageFiles', 'upgrades'];
|
|
|
|
return traverse(config).map(function scrub(val: string) {
|
|
if (this.key && val) {
|
|
if (templateFields.includes(this.key)) {
|
|
this.update('[Template]');
|
|
}
|
|
if (contentFields.includes(this.key)) {
|
|
this.update('[content]');
|
|
}
|
|
// istanbul ignore if
|
|
if (arrayFields.includes(this.key)) {
|
|
this.update('[Array]');
|
|
}
|
|
}
|
|
});
|
|
}
|