Conversation
Type guards now remove from a union any type that includes numeric
index signatures when the guarded type does not. This changes lodash tests of `isArray` and
`isArrayObject`; the true branch now inserts a `{ length: number }` into
the union, and the false branch now has `{ [n: number]: boolean; length:
number }` instead of the true branch.
|
@sandersn Thank you for submitting this PR! This is a live comment which I will keep updated. 1 package in this PRCode ReviewsBecause this is a widely-used package, a DT maintainer will need to review it before it can be merged. You can test the changes of this PR in the Playground. Status
Once every item on this list is checked, I'll ask you for permission to merge and publish the changes. InactiveThis PR has been inactive for 10 days. Diagnostic Information: What the bot saw about this PR{
"type": "info",
"now": "-",
"pr_number": 64406,
"author": "sandersn",
"headCommitOid": "6a1c6c823f5e5bb02c3cafc112dea9a4e5cb7434",
"mergeBaseOid": "8f6f2bbf07dfb14124df0e88a408884108337048",
"lastPushDate": "2023-02-17T18:16:18.000Z",
"lastActivityDate": "2023-02-17T18:40:09.000Z",
"hasMergeConflict": false,
"isFirstContribution": false,
"tooManyFiles": false,
"hugeChange": false,
"popularityLevel": "Critical",
"pkgInfo": [
{
"name": "lodash",
"kind": "edit",
"files": [
{
"path": "types/lodash/lodash-tests.ts",
"kind": "test"
}
],
"owners": [
"bczengel",
"chrootsu",
"aj-r",
"e-cloud",
"thorn0",
"jtmthf",
"DomiR",
"WilliamChelman"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Critical"
}
],
"reviews": [],
"mainBotCommentID": 1435060476,
"ciResult": "pass"
} |
|
🔔 @bczengel @chrootsu @aj-r @e-cloud @thorn0 @jtmthf @DomiR @WilliamChelman — please review this PR in the next few days. Be sure to explicitly select |
|
Caused by microsoft/TypeScript#52282 -- I think it's a good change, but I'm checking with @ahejlsberg. |
|
Update: It is an acceptable break, but we're experimenting to see if we can improve things in 5.1. I'm going to merge this change for now since it looks like 5.0 will ship as-is. |
Type guards now remove from a union any type that includes numeric index signatures when the guarded type does not. This changes lodash tests of
isArrayandisArrayObject; the true branch now inserts a{ length: number }into the union, and the false branch now has{ [n: number]: boolean; length: number }instead of the true branch.