From 750838969e9785c60781a176508a0f28601669d8 Mon Sep 17 00:00:00 2001 From: derekpierre Date: Thu, 1 Aug 2024 10:11:54 -0400 Subject: [PATCH] Try using @astronautlabs/jsonpath fork of jsonpath instead. --- packages/taco/package.json | 2 +- packages/taco/src/conditions/base/json-api.ts | 4 ++-- pnpm-lock.yaml | 13 ++++++++++--- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/packages/taco/package.json b/packages/taco/package.json index ff213a01..923f3c38 100644 --- a/packages/taco/package.json +++ b/packages/taco/package.json @@ -39,11 +39,11 @@ "typedoc": "typedoc" }, "dependencies": { + "@astronautlabs/jsonpath": "^1.1.2", "@nucypher/nucypher-core": "*", "@nucypher/shared": "workspace:*", "@nucypher/taco-auth": "workspace:*", "ethers": "*", - "jsonpath": "^1.1.1", "semver": "^7.5.2", "zod": "*" }, diff --git a/packages/taco/src/conditions/base/json-api.ts b/packages/taco/src/conditions/base/json-api.ts index 7e96cd64..22032cb3 100644 --- a/packages/taco/src/conditions/base/json-api.ts +++ b/packages/taco/src/conditions/base/json-api.ts @@ -1,4 +1,4 @@ -import { parse } from 'jsonpath'; +import { JSONPath } from '@astronautlabs/jsonpath'; import { z } from 'zod'; import { Condition } from '../condition'; @@ -8,7 +8,7 @@ export const JsonApiConditionType = 'json-api'; const validateJSONPath = (jsonPath: string): boolean => { try { - parse(jsonPath); + JSONPath.parse(jsonPath); return true; } catch (error) { return false; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9b8887ec..65832430 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -540,6 +540,9 @@ importers: packages/taco: dependencies: + '@astronautlabs/jsonpath': + specifier: ^1.1.2 + version: 1.1.2 '@nucypher/nucypher-core': specifier: ^0.14.5 version: 0.14.5 @@ -552,9 +555,6 @@ importers: ethers: specifier: '*' version: 5.7.2(bufferutil@4.0.8)(utf-8-validate@5.0.10) - jsonpath: - specifier: ^1.1.1 - version: 1.1.1 semver: specifier: ^7.5.2 version: 7.6.2 @@ -640,6 +640,9 @@ packages: resolution: {integrity: sha512-NqJDx39sHN0o7BpxpQzishoZjGBzvXqSVxO+bRm6OPP/Oe+Kb51R5x8dWvW9i3amO3QNdocg/p4jFRCwzqy2Gg==} engines: {node: '>=11.0.0'} + '@astronautlabs/jsonpath@1.1.2': + resolution: {integrity: sha512-FqL/muoreH7iltYC1EB5Tvox5E8NSOOPGkgns4G+qxRKl6k5dxEVljUjB5NcKESzkqwnUqWjSZkL61XGYOuV+A==} + '@babel/code-frame@7.24.6': resolution: {integrity: sha512-ZJhac6FkEd1yhG2AHOmfcXG4ceoLltoCVJjN5XsWN9BifBQr+cHJbWi0h68HZuSORq+3WtJ2z0hwF2NG1b5kcA==} engines: {node: '>=6.9.0'} @@ -9053,6 +9056,10 @@ snapshots: transitivePeerDependencies: - debug + '@astronautlabs/jsonpath@1.1.2': + dependencies: + static-eval: 2.0.2 + '@babel/code-frame@7.24.6': dependencies: '@babel/highlight': 7.24.6