-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Simplify getSupportInfo
#7269
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simplify getSupportInfo
#7269
Conversation
src/main/support.js
Outdated
| delete newObject.deprecated; | ||
| delete newObject.redirect; | ||
| // eslint-disable-next-line no-unused-vars | ||
| const { deprecated, redirect, ...newObject } = Object.assign({}, object); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought about it, but I thought this case
const {a, ...b} = cif a and b both not used, it will not report an error.
But I'm not sure now.. not near my laptop.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW, Object.assign is not needed here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, missed this one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
Also enabled ignoreRestSiblings, works as expected
const {a, ...b} = cIf a&b not used, report b is not used.
If a used b not used, report b is not used.
If b used a not used, no error.
| .filter(option => filterSince(option) && filterDeprecated(option)) | ||
| .map(mapDeprecated) | ||
| .map(mapInternal) | ||
| .sort((a, b) => (a.name === b.name ? 0 : a.name < b.name ? -1 : 1)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed filter and sort order, so array for sort could be smaller.
docs/directory)changelog_unreleased/*/pr-XXXX.mdfile followingchangelog_unreleased/TEMPLATE.md.✨Try the playground for this PR✨