Repository navigation
fix(core): reject versions and dates it can't read, and skip duplicate versions - #160
Open
botandbang wants to merge 1 commit into
Open
botandbang wants to merge 1 commit into
botandbang wants to merge 1 commit into
Conversation
This branch has not been deployed
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.
Closes #154. Part of #153: these are the cases its properties found that change core's behavior. The rest of #153's properties pass on main and are in the test PR.
Changed:
versionthatsemver.coercecan't read (null, a string with no digits, an object). It used to reject withTypeError: Cannot read properties of null (reading 'major')from core/index.js#L139, and the comment above it said this couldn't happen.nowisn't an ISO 8601 date or a validDateTime, with an error naming it. An unreadablenow, including a JavaScriptDate, used to leave every release line'sphases.currentas{}with no error.v1.0.0and then1.0.0), core keeps the first entry and skips the rest. Before, the later, older entry overwrote the release and the version showed up twice insecurity.all.nodevu()say when it rejects, and theline.releasesdocs say the first entry wins.core/types/index.d.tsis regenerated from the JSDoc.Added:
core/test/errors.js. One puts an unreadable version anywhere in a generated index and checks core names it in a plainError, not aTypeError. The other generates anowluxon can't read (strings,Dates, an invalidDateTime) and checks core names it without callingfetch. Both failed on main, shrinking toversion: nullandnow: " ".core/test/duplicates.js, which inserts repeats of generated versions after their first entry, some without thevand with different fields, and checks the result equals core's result on the index without them. It failed on main.The existing example in
errors.jspasses either way, since it only checks that core rejects.