From d536532d7e4e463a8517d69c35b2a1e49ddd2251 Mon Sep 17 00:00:00 2001 From: Roman Date: Mon, 24 Aug 2026 19:36:26 +0100 Subject: [PATCH] chore: use modern import of 'neotraverse' --- src/resolver/specmap/helpers.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/resolver/specmap/helpers.js b/src/resolver/specmap/helpers.js index 0b4913c69..d2d0570de 100644 --- a/src/resolver/specmap/helpers.js +++ b/src/resolver/specmap/helpers.js @@ -1,4 +1,4 @@ -import traverse from 'neotraverse/legacy'; +import { forEach } from 'neotraverse'; import { url } from '@swagger-api/apidom-reference/configuration/empty'; import { DEFAULT_BASE_URL } from '../../constants.js'; @@ -59,12 +59,12 @@ export function generateAbsoluteRefPatches( ) { const patches = []; - traverse(obj).forEach(function callback() { - if (targetKeys.includes(this.key) && typeof this.node === 'string') { - const nodePath = this.path; // this node's path, relative to `obj` - const fullPath = basePath.concat(this.path); + forEach(obj, (ctx, node) => { + if (targetKeys.includes(ctx.key) && typeof node === 'string') { + const nodePath = ctx.path; // this node's path, relative to `obj` + const fullPath = basePath.concat(ctx.path); - const absolutifiedRefValue = absolutifyPointer(this.node, getBaseUrlForNodePath(nodePath)); + const absolutifiedRefValue = absolutifyPointer(node, getBaseUrlForNodePath(nodePath)); patches.push(specmap.replace(fullPath, absolutifiedRefValue)); }