From 0801ab1f8df8dec6052c35f71d6fc491430d1aec Mon Sep 17 00:00:00 2001 From: Jacob Smith <3012099+JakobJingleheimer@users.noreply.github.com> Date: Thu, 31 Jul 2025 17:20:56 +0200 Subject: [PATCH] dep(lodash.get): remove obsolete dependency --- package.json | 4 +--- src/estimators/directive/index.ts | 3 +-- yarn.lock | 5 ----- 3 files changed, 2 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index ec522db..622a00e 100644 --- a/package.json +++ b/package.json @@ -23,9 +23,7 @@ "directories": { "lib": "./dist" }, - "dependencies": { - "lodash.get": "^4.4.2" - }, + "dependencies": {}, "peerDependencies": { "graphql": "^15.0.0 || ^16.0.0" }, diff --git a/src/estimators/directive/index.ts b/src/estimators/directive/index.ts index 0d727e7..309ff9f 100644 --- a/src/estimators/directive/index.ts +++ b/src/estimators/directive/index.ts @@ -11,7 +11,6 @@ import { GraphQLDirective, DirectiveLocation, } from 'graphql'; -import get from 'lodash.get'; export type ComplexityDirectiveOptions = { name?: string; @@ -64,7 +63,7 @@ export default function ( if (values.multipliers && Array.isArray(values.multipliers)) { totalMultiplier = values.multipliers.reduce( (aggregated: number, multiplier: string) => { - const multiplierValue = get(args.args, multiplier); + const multiplierValue = args.args?.[multiplier]; if (typeof multiplierValue === 'number') { return aggregated * multiplierValue; diff --git a/yarn.lock b/yarn.lock index 40c8db9..d1fa7b3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -806,11 +806,6 @@ locate-path@^6.0.0: dependencies: p-locate "^5.0.0" -lodash.get@^4.4.2: - version "4.4.2" - resolved "https://registry.yarnpkg.com/lodash.get/-/lodash.get-4.4.2.tgz#2d177f652fa31e939b4438d5341499dfa3825e99" - integrity sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk= - lodash.merge@^4.6.2: version "4.6.2" resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a"