Repository navigation
fix: handle edge cases in ranges, translate, parsefiles, and fetching - #125
Merged
Merged
Conversation
- translate: reject names inherited from Object.prototype and return a copy - ranges: fall back to the other lts range for lts/active's bounds when one is empty - parsefiles: list only the id's own directory for win-*-exe, and parse osx-x86-tar - core, fetchindex: throw with the URL and status on a non-OK response - ci: use --workspaces, since npm 12 rejects -ws
Draft
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.
Fixes five bugs, each with a regression test.
translate.
translate()looked terms up on a plain object, sotranslate('toString'),'constructor','hasOwnProperty'and'__proto__'resolved toObject.prototypemembers instead of rejecting. It now checks withObject.hasOwn. It also returned its internal arrays, so pushing onto a result changed later results. It now returns a copy.ranges.
lts/activetook its newest bounds only fromlts/latestand its oldest bounds only fromlts/maintenance. When either was empty those fields wereundefinedeven thoughlts/activehad versions. On 2024-10-23 it had 36 versions and nonewestLts. It now uses the other range when one is empty. Running main's ranges and this branch's on every day from 2009-06-01 to 2026-10-01,lts/active's fallback fields are the only difference.currentandlts/latestkeep the first-line-only bounds from #92. The filter checks now go through onewants()helper instead of repeated=== || .includes()conditions, which also did substring matching on string filters. A dead conditional and some wrong comments are gone.docs/pages/ranges.mddescribes the fallback.parsefiles.
win-x64-exeandwin-x86-exeeach listed both architectures' files. Each id now lists only its own directory, so a futurewin-arm64-exeworks too.osx-x86-tarwas never turned into a file name; it now givesnode-v<version>-darwin-x86.tar.gz. The two exe entries intest/data/expected.jsonare updated.fetching. core's
versions.jsandschedule.jsand@nodevu/fetchindexnow throwFetching <url> failed: <status> <statusText>on a non-OK response instead of failing to parse an error page as JSON.ci.
npm install -wsis nownpm install --workspacesinci.ymlandnightly-static-build.yaml. npm 12 rejects-ws.