Switch from lodash to es-toolkit for esm support#133
Open
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes broken ESM consumption by replacing lodash (CJS-only) imports with es-toolkit/compat (dual ESM+CJS), and bumps the package major version to reflect the peer dependency change.
Changes:
- Replace
lodashimports withes-toolkit/compatin the omit-related winston formats. - Swap the peer dependency from
lodashtoes-toolkitand remove@types/lodash. - Update README to reference
es-toolkitomit docs and bump package major version.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/omit-nil-format.ts | Switch isNil/omitBy import to es-toolkit/compat for ESM compatibility. |
| src/omit-format.ts | Switch omit import to es-toolkit/compat for ESM compatibility. |
| package.json | Major version bump; peer dep swap from lodash to es-toolkit; remove @types/lodash. |
| package-lock.json | Reflect peer dep swap and lockfile package entries. |
| README.md | Update docs link/wording to reference es-toolkit compat omit. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
mderriey
approved these changes
Apr 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem: ESM output does not work, only CJS works
The prior PR adding dual ESM + CJS output does not actually work for ESM due to the continued use of CJS only lodash.
Lodash does not have a single dual output library, lodash-es is ESM only.
We cannot just replace lodash with a simple function because the omit-by-dot-notation keys functionality is important and is used for omit logging config.
Solution
Swap to es-toolkit which provides modern dual ESM + CJS output with 100% lodash compatibility.
Implementation notes