Skip to content

fix: preserve array items when deleting named properties - #10142

Open
drawliin wants to merge 1 commit into
npm:latestfrom
drawliin:fix/pkg-delete-array-property
Open

drawliin wants to merge 1 commit into
npm:latestfrom
drawliin:fix/pkg-delete-array-property

Conversation

@drawliin

Copy link
Copy Markdown

npm pkg delete keywords.missing removed the first keyword and exited successfully. the array deletion path passed the property name to splice().. which treated it as index 0.

only numeric keys now use splice(). named properties use normal property deletion.. leaving unrelated array items alone.

extends the existing helper and command tests. affected tests pass with 100% coverage.. repo lint and real CLI checks pass too.

closes #10141

@drawliin
drawliin requested a review from a team as a code owner October 19, 2026 10:37
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.

[BUG] npm pkg delete removes the first array item for a nonexistent property

1 participant