You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The interface Intl.Segments lacks an undefined in the return type for containing:
interfaceSegments{// Should be SegmentData | undefinedcontaining(codeUnitIndex?: number): SegmentData;}
Sample Code
constsegmenter=newIntl.Segmenter();constsegments=segmenter.segment("Hello world");// @ts-expect-error This should report an errorconsts: Intl.SegmentData=segments.containing(40);// This should be fineconsts: Intl.SegmentData|undefined=segments.containing(40);
⚙ Compilation target
ESNext
⚙ Library
ESNext
Missing / Incorrect Definition
The interface
Intl.Segments
lacks anundefined
in the return type forcontaining
:Sample Code
Documentation Link
MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter/segment/Segments/containing#return_value
The text was updated successfully, but these errors were encountered: