Object#entries and Object#values doesn't consider optional properties as potentially undefined #52045
Labels
Working as Intended
The behavior described is the intended behavior; this is not a bug
Bug Report
π Search Terms
π Version & Regression Information
β― Playground Link
π» Code
π Actual behavior
From v4.3 it doesnt consider optional object properties as potentially undefined (with exactOptionalPropertyTypes disabled) when using
Object#entries
orObject#values
π Expected behavior
Optional properties should mean the value when using
Object#entries
orObject#values
is potentially undefined when exactOptionalPropertyTypes is disabled, asundefined
could be assigned to the optional properties.This allows TS to compile code with potential runtime issues from using optional properties as if they were always defined.
The text was updated successfully, but these errors were encountered: