Skip to content

refactor(utils): inline defaults and isArguments helpers#2107

Merged
PavelPashov merged 2 commits into
redis:mainfrom
PavelPashov:chore/remove-lodash
May 26, 2026
Merged

refactor(utils): inline defaults and isArguments helpers#2107
PavelPashov merged 2 commits into
redis:mainfrom
PavelPashov:chore/remove-lodash

Conversation

@PavelPashov
Copy link
Copy Markdown
Contributor

@PavelPashov PavelPashov commented Apr 22, 2026

Fixes #2106


Note

Medium Risk
Behavior must stay compatible with lodash.defaults/isarguments across connection parsing, option merging, and auto-pipelining; regressions would affect many code paths, though new unit tests reduce that risk.

Overview
Replaces the runtime dependencies lodash.defaults and lodash.isarguments with in-repo implementations under lib/utils/defaults.ts and lib/utils/isArguments.ts (adapted from es-toolkit compat / Lodash-style behavior, with license headers). lib/utils/lodash.ts now re-exports those modules instead of requireing the npm packages, and isArguments is also exported from lib/utils/index.ts.

package.json drops the two lodash packages and their @types/* devDependencies; package-lock.json reflects the slimmer tree. Unit tests in test/unit/utils.ts lock in lodash-like semantics for defaults and isArguments (multi-source merge, null vs undefined, iteratee guard, arguments detection).

Call sites (Redis, parseURL, cluster helpers, auto-pipelining) keep importing from ./utils/lodash—this is primarily a dependency footprint / vendoring change, not a new feature API.

Reviewed by Cursor Bugbot for commit dee0b74. Bugbot is set up for automated code reviews on this repo. Configure here.

@PavelPashov PavelPashov marked this pull request as ready for review May 22, 2026 08:58
@PavelPashov PavelPashov force-pushed the chore/remove-lodash branch from a02311a to 63aaed1 Compare May 22, 2026 09:50
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Reviewed by Cursor Bugbot for commit 63aaed1. Configure here.

Comment thread lib/utils/defaults.ts Outdated
@PavelPashov PavelPashov force-pushed the chore/remove-lodash branch from 63aaed1 to fe10102 Compare May 26, 2026 10:50
@PavelPashov PavelPashov merged commit 5359d4d into redis:main May 26, 2026
2 checks passed
@PavelPashov PavelPashov deleted the chore/remove-lodash branch May 26, 2026 11:28
@github-actions
Copy link
Copy Markdown

🎉 This PR is included in version 5.11.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Critical CVEs in lodash dependencies

2 participants