Skip to content

fix: normalize bin metadata in getPaths - #187

Open
martinrrm wants to merge 1 commit into
mainfrom
fix/normalize-bin-paths
Open

fix: normalize bin metadata in getPaths#187
martinrrm wants to merge 1 commit into
mainfrom
fix/normalize-bin-paths

Conversation

@martinrrm

Copy link
Copy Markdown

Summary

lib/link-bins.js already uses npm-normalize-package-bin before iterating over package bin entries. getPaths() derives the corresponding paths but previously operated on the package metadata directly, which could produce behavior inconsistent with bin creation for non-canonical entries.

This change applies the same normalization in getPaths() so both APIs interpret bin metadata consistently. It normalizes a shallow copy to avoid modifying the caller's package object.

The tests cover normalized bin names on POSIX and Windows and verify that the original package metadata remains unchanged.

Testing

  • targeted get-paths tests
  • ESLint

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 3ff4d6b3-8027-46d4-9024-3bb9e4fc495c
@martinrrm
martinrrm requested a review from a team as a code owner August 12, 2026 17:52
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