Skip to content

Improvement to getNarrowedType changes lodash's isArray #52827

Description

declarefunctionisArrayLike(value: any): value is {length: number};declareconstvalue: {[index: number]: boolean,length: number}|undefined;if(isArrayLike(value)){constresult: {length: number}=value;}else{constresult: undefined=value;}

Before #52282: value: undefined in the false branch.
After #52282: value: { [index: number]: boolean, length: number } | undefined in the false branch.

This is more consistent, although the full repro at DefinitelyTyped/DefinitelyTyped#64406 seems less consistent than the 4.9 semantics.

Metadata

Metadata

Labels

Fix AvailableA PR has been opened for this issueNeeds InvestigationThis issue needs a team member to investigate its status.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions