Skip to content

fix(compat/keysIn, compat/defaults): match lodash for inherited keys - #2203

Open
D-Sketon wants to merge 3 commits into
toss:mainfrom
D-Sketon:re5
Open

D-Sketon wants to merge 3 commits into
toss:mainfrom
D-Sketon:re5

Conversation

@D-Sketon

@D-Sketon D-Sketon commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

lodash

_.keysIn(Object.create({ constructor: 1, inherited: 2 }))
// ['inherited']

const source = Object.create({ 0: 'a' });
source.length = 1;

_.keysIn(source)
// ['length', '0']

_.defaults({}, Object.create({ inherited: 1 }))
// { inherited: 1 }

compat

compat.keysIn(Object.create({ constructor: 1, inherited: 2 }))
// ['constructor', 'inherited']

const source = Object.create({ 0: 'a' });
source.length = 1;

compat.keysIn(source)
// ['length']

compat.defaults({}, Object.create({ inherited: 1 }))
// {}

@vercel

vercel Bot commented Nov 8, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
es-toolkit Ready Ready Preview Nov 8, 2026 12:11pm UTC

Request Review

This branch was successfully deployed

1 active deployment
Preview — f6dcbbf9 Deployed Nov 8, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant