[@types/underscore] Object Tests - MapObject, Pairs, and FindKey#46422
Conversation
|
@reubenrybnik Thank you for submitting this PR! This is a live comment which I will keep updated. Code ReviewsBecause you edited one package and updated the tests (👏), I can help you merge this PR once someone else signs off on it. Status
All of the items on the list are green. To merge, you need to post a comment including the string "Ready to merge" to bring in your changes. Diagnostic Information: What the bot saw about this PR{
"type": "info",
"now": "-",
"pr_number": 46422,
"author": "reubenrybnik",
"owners": [
"borisyankov",
"jbaldwin",
"ccurrens",
"confususs",
"jgonggrijp",
"ffflorian",
"regevbr",
"peterblazejewicz",
"reubenrybnik"
],
"dangerLevel": "ScopedAndTested",
"headCommitAbbrOid": "1b03f4d",
"headCommitOid": "1b03f4d13078717e6c797e315c34517ad13d86e7",
"mergeIsRequested": true,
"stalenessInDays": 0,
"lastPushDate": "2020-07-31T17:29:27.000Z",
"lastCommentDate": "2020-07-31T23:44:51.000Z",
"maintainerBlessed": false,
"reviewLink": "https://github.com/DefinitelyTyped/DefinitelyTyped/pull/46422/files",
"hasMergeConflict": false,
"authorIsOwner": true,
"isFirstContribution": false,
"popularityLevel": "Popular",
"anyPackageIsNew": false,
"packages": [
"underscore"
],
"files": [
{
"path": "types/underscore/index.d.ts",
"kind": "definition",
"package": "underscore"
},
{
"path": "types/underscore/underscore-tests.ts",
"kind": "test",
"package": "underscore"
}
],
"hasDismissedReview": false,
"ciResult": "pass",
"lastReviewDate": "2020-07-31T22:53:23.000Z",
"reviewersWithStaleReviews": [],
"approvalFlags": 2,
"isChangesRequested": false
} |
|
🔔 @borisyankov @jbaldwin @ccurrens @confususs @jgonggrijp @ffflorian @regevbr @peterblazejewicz — please review this PR in the next few days. Be sure to explicitly select |
|
As a quick disclaimer here, my company's solution does not use |
|
Well, I can still take the test code and verify that it does the things I expect in JS at least. |
|
👋 Hi there! I’ve run some quick measurements against master and your PR. These metrics should help the humans reviewing this PR gauge whether it might negatively affect compile times or editor responsiveness for users who install these typings. Let’s review the numbers, shall we? Comparison details 📊
It looks like nothing changed too much. I won’t post performance data again unless it gets worse. |
jgonggrijp
left a comment
There was a problem hiding this comment.
This review seems familiar, somehow...
As always, I should acknowledge that your changes are already an improvement over the old situation!
|
@reubenrybnik One or more reviewers has requested changes. Please address their comments. I'll be back once they sign off or you've pushed new commits or comments. If you disagree with the reviewer's comments, you can "dismiss" the review using GitHub's review UI. Thank you! |
…of _.object (and to refer to _.object at all in the case of Underscore and _Chain).
|
@jgonggrijp Thank you for reviewing this PR! The author has pushed new commits since your last review. Could you take another look and submit a fresh review? |
…t that resolved to Partial<any> in the non-collection case now, which is probably more or less object (though it might be worth converting that to object if that's not the case).
|
As a quick point of interest, I've found that |
…re objects and technically work.
|
Thanks @jgonggrijp, it's much nicer to have the iteratee types consolidated and to be providing more specific results for |
…in paris as recommended by @jgonggrijp.
|
Awesome @jgonggrijp, hope you're having a great time! Let me know if you'd like me to hold off on further PRs for a bit 😄 |
|
Also thanks for the extra-excellent review on this one! |
|
Ready to merge |
|
I just published |
|
My pleasure, @reubenrybnik! You don't need to hold off for me, but feel free to do it anyway, of course. Since this appears to be a natural moment for a break in your series, I'd like to briefly mention my Patreon page. I believe that improving what is already there, rather than creating something new from scratch, is the best way to move forward as a planet. This is why I contribute to open source software, including reviews like these. While I will never stop contributing, receiving more donations would help me dedicate more time to the common good. If you, your company, or anyone else reading this would be willing to make a pledge, that would be great. |
…apObject, Pairs, and FindKey by @reubenrybnik * Updating type definitions for mapObject, pairs, and findKey and adding tests. * Also updating Underscore.property to match the update to UnderscoreStatic.property. * Adding a few more tests. * Combining Iteratee with ObjectIteratee and IterateeResult with ObjectIterateeResult. * Improving the condition for choosing between Partial<T> and object. * Fixing a test that breaks slightly with iteratee changes. * Updating findKey to result in keyof V rather than just string. * Updating the documentation of pairs to refer to a specific signature of _.object (and to refer to _.object at all in the case of Underscore and _Chain). * Dropping object and just going with Partial<T> because I realized that that resolved to Partial<any> in the non-collection case now, which is probably more or less object (though it might be worth converting that to object if that's not the case). * Handling the possibility of a property that is a type union as well as I can. * Switching constraints from dictionaries to collections since arrays are objects and technically work. * Adding a comment above the assignability test. * Defaulting to a collection type of any for non-collections when evaluating iteratee results. * Using Extract instead of making up a new type and also using keyof V in paris as recommended by @jgonggrijp.
npm test.)npm run lint package-name(ortscif notslint.jsonis present).This PR is an addendum to the original the planned set for #45201 and includes the following changes:
mapObject,pairs, andfindKey.never.ObjectIterateeandObjectIterateeResulttype.mapObjectto useObjectIterateeandObjectIterateeResult.pairsto try to figure out what its value element is if it can.findKeyto useObjectIteratee.mapObjectandfindKeyinUnderscoreand_Chainto be more in sync withUnderscoreStatic.