From c0aaff1f9fa3b55074906254fefc10c5f4d66452 Mon Sep 17 00:00:00 2001 From: fratzinger <22286818+fratzinger@users.noreply.github.com> Date: Sun, 21 Jul 2024 22:42:34 +0200 Subject: [PATCH] feat: neotraverse/legacy; v0.6.14 (#756) * Push * Remove this type for traverse * ci: update gh actions versions * ci: use node@22.5.1 explicitly --------- Co-authored-by: Puru Vijay --- .github/workflows/nodejs.yml | 10 +++++----- package-lock.json | 14 +++++++------- package.json | 2 +- src/common/traverse.ts | 2 +- src/hooks/mongo-keys.ts | 4 ++-- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 075bc6b..93cf86b 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -5,11 +5,11 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - node-version: [18.x, 20.x, 22.x] + node-version: [18.x, 20.x, 22.5.1] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} - run: npm install @@ -18,9 +18,9 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Use Node.js 20.x - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 20.x - run: npm install diff --git a/package-lock.json b/package-lock.json index 976e15a..c4fe75a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,7 +14,7 @@ "debug": "^4.3.5", "graphql": "^16.9.0", "lodash": "^4.17.21", - "neotraverse": "^0.6.11" + "neotraverse": "^0.6.14" }, "devDependencies": { "@feathers-plus/batch-loader": "^0.3.6", @@ -7893,9 +7893,9 @@ } }, "node_modules/neotraverse": { - "version": "0.6.11", - "resolved": "https://registry.npmjs.org/neotraverse/-/neotraverse-0.6.11.tgz", - "integrity": "sha512-OdydhNAkoRxXyxz1d8Cx2rQS0wfTcoSlBNIuv/PMC/0CrwTYUBMy+kIa7h3y18lVyvgARazb4ugVZ5n/aly2PA==", + "version": "0.6.14", + "resolved": "https://registry.npmjs.org/neotraverse/-/neotraverse-0.6.14.tgz", + "integrity": "sha512-co+mqQYo1wf3CRWRHWOT1ZgG7gsdNZSrrQkWxVnGAlD/UA/IZuPlE9UNkGZRwTLeml+dT5BytRW4ANqzPQeNLg==", "license": "MIT", "engines": { "node": ">= 18" @@ -17816,9 +17816,9 @@ "dev": true }, "neotraverse": { - "version": "0.6.11", - "resolved": "https://registry.npmjs.org/neotraverse/-/neotraverse-0.6.11.tgz", - "integrity": "sha512-OdydhNAkoRxXyxz1d8Cx2rQS0wfTcoSlBNIuv/PMC/0CrwTYUBMy+kIa7h3y18lVyvgARazb4ugVZ5n/aly2PA==" + "version": "0.6.14", + "resolved": "https://registry.npmjs.org/neotraverse/-/neotraverse-0.6.14.tgz", + "integrity": "sha512-co+mqQYo1wf3CRWRHWOT1ZgG7gsdNZSrrQkWxVnGAlD/UA/IZuPlE9UNkGZRwTLeml+dT5BytRW4ANqzPQeNLg==" }, "node-gyp": { "version": "9.4.0", diff --git a/package.json b/package.json index d4d6cd7..015b6cc 100644 --- a/package.json +++ b/package.json @@ -67,7 +67,7 @@ "debug": "^4.3.5", "graphql": "^16.9.0", "lodash": "^4.17.21", - "neotraverse": "^0.6.11" + "neotraverse": "^0.6.14" }, "devDependencies": { "@feathers-plus/batch-loader": "^0.3.6", diff --git a/src/common/traverse.ts b/src/common/traverse.ts index a33d6b2..58212a0 100755 --- a/src/common/traverse.ts +++ b/src/common/traverse.ts @@ -1,4 +1,4 @@ -import traverser from 'neotraverse'; +import traverser from 'neotraverse/legacy'; export function traverse>( items: T | T[], diff --git a/src/hooks/mongo-keys.ts b/src/hooks/mongo-keys.ts index b8819ff..07f7c71 100755 --- a/src/hooks/mongo-keys.ts +++ b/src/hooks/mongo-keys.ts @@ -1,5 +1,5 @@ import type { HookContext } from '@feathersjs/feathers'; -import traverse from 'neotraverse'; +import traverse from 'neotraverse/legacy'; import { checkContext } from '../utils/check-context'; /** @@ -26,7 +26,7 @@ export function mongoKeys( checkContext(context, 'before', null, 'mongoKeys'); const query = context.params.query || {}; - traverse(query).forEach(function (this: any, node: any) { + traverse(query).forEach(function (node: any) { const typeofNode = typeof node; const key = this.key; const path = this.path;