Skip to content

Commit 0747699

Browse files
committed
Remove lodash.get because it's deprecated
1 parent 46248ff commit 0747699

File tree

3 files changed

+8
-11
lines changed

3 files changed

+8
-11
lines changed

packages/core/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,6 @@
187187
"execa": "^8.0.1",
188188
"humanize-duration": "^3.27.3",
189189
"jose": "^5.4.0",
190-
"lodash.get": "^4.4.2",
191190
"nanoid": "3.3.8",
192191
"prom-client": "^15.1.0",
193192
"socket.io": "4.7.4",

packages/core/src/v3/utils/ioSerialization.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { SemanticInternalAttributes } from "../semanticInternalAttributes.js";
1212
import { TriggerTracer } from "../tracer.js";
1313
import { zodfetch } from "../zodfetch.js";
1414
import { flattenAttributes } from "./flattenAttributes.js";
15-
import get from "lodash.get";
15+
import { JSONHeroPath } from "@jsonhero/path";
1616

1717
export type IOPacket = {
1818
data?: string | undefined;
@@ -536,7 +536,7 @@ export async function replaceSuperJsonPayload(original: string, newPayload: stri
536536
.map(([key]) => key);
537537

538538
const overridenUndefinedKeys = originalUndefinedKeys.filter(
539-
(key) => get(newPayloadObject, key) !== undefined
539+
(key) => getKeyFromObject(newPayloadObject, key) !== undefined
540540
);
541541

542542
overridenUndefinedKeys.forEach((key) => {
@@ -551,3 +551,9 @@ export async function replaceSuperJsonPayload(original: string, newPayload: stri
551551

552552
return superjson.deserialize(newSuperJson);
553553
}
554+
555+
function getKeyFromObject(object: unknown, key: string) {
556+
const jsonHeroPath = new JSONHeroPath(key);
557+
558+
return jsonHeroPath.first(object);
559+
}

pnpm-lock.yaml

Lines changed: 0 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)