ljharb/ls-engines

Improper handling of OR ( || ) allows invalid result

オープン

#32 opened on 2025/01/16

 (2 件のコメント) (2 件のリアクション) (0 人の担当者)JavaScript (4 件のフォーク)github user discovery
bughelp wanted

Repository metrics

Stars
 (57 個のスター)
PR merge metrics
 (30d に merged PR はありません)

説明

Hello,

I have a project for which I'm trying to use ls-engines to identify the minimum node version for and upon inspecting the requirements myself I ran into a notable edge case that I'm not sure about the choices for:

Upon inspection, the minimatch package had the most recent engine requirement, stating 20 || >= 22. Notably, this explicitly excludes node version 21. However, the result of ls-engines produces >= 20 as the result, which will erroneously accept version 21.

I believe the desired behavior should be to either inherit the same requirement as minimatch in this case, or just default to the highest of the specified values (>=22). Practically speaking wrt implementation, it may make sense to track which versions are excluded by dependencies to validate the output does not conflict.

コントリビューターガイド