Skip to content

Commit

Permalink
refactor: migrate traverse to neotraverse (#30573)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jayllyz authored Aug 5, 2024
1 parent 9fc7d19 commit 607d7e3
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 42 deletions.
9 changes: 5 additions & 4 deletions lib/logger/config-serializer.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import traverse from 'traverse';
import traverse from 'neotraverse/legacy';
import type { RenovateConfig } from '../config/types';

export default function configSerializer(
Expand All @@ -15,14 +15,15 @@ export default function configSerializer(

return traverse(config).map(function scrub(val: string) {
if (this.key && val) {
if (templateFields.includes(this.key)) {
const key = this.key.toString();
if (templateFields.includes(key)) {
this.update('[Template]');
}
if (contentFields.includes(this.key)) {
if (contentFields.includes(key)) {
this.update('[content]');
}
// istanbul ignore if
if (arrayFields.includes(this.key)) {
if (arrayFields.includes(key)) {
this.update('[Array]');
}
}
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@
"moo": "0.5.2",
"ms": "2.1.3",
"nanoid": "3.3.7",
"neotraverse": "0.6.15",
"node-html-parser": "6.1.13",
"p-all": "3.0.0",
"p-map": "4.0.0",
Expand All @@ -235,7 +236,6 @@
"slugify": "1.6.6",
"source-map-support": "0.5.21",
"toml-eslint-parser": "0.10.0",
"traverse": "0.6.9",
"tslib": "2.6.3",
"upath": "2.0.1",
"url-join": "4.0.1",
Expand Down Expand Up @@ -297,7 +297,6 @@
"@types/semver-utils": "1.1.3",
"@types/tar": "6.1.13",
"@types/tmp": "0.2.6",
"@types/traverse": "0.6.37",
"@types/unist": "2.0.10",
"@types/url-join": "4.0.3",
"@types/validate-npm-package-name": "4.0.2",
Expand Down
44 changes: 9 additions & 35 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion test/exec-util.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import is from '@sindresorhus/is';
import traverse from 'traverse';
import traverse from 'neotraverse/legacy';
import upath from 'upath';
import { rawExec as _exec } from '../lib/util/exec/common';
import type { RawExecOptions } from '../lib/util/exec/types';
Expand Down

0 comments on commit 607d7e3

Please sign in to comment.