-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Closed
Closed
Copy link
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: lib.d.tsThe issue relates to the different libraries shipped with TypeScriptThe issue relates to the different libraries shipped with TypeScriptHelp WantedYou can do thisYou can do this
Milestone
Description
⚙ Compilation target
ESNext
⚙ Library
ESNext
Missing / Incorrect Definition
The interface Intl.Segments lacks an undefined in the return type for containing:
interface Segments {
// Should be SegmentData | undefined
containing(codeUnitIndex?: number): SegmentData;
}Sample Code
const segmenter = new Intl.Segmenter();
const segments = segmenter.segment("Hello world");
// @ts-expect-error This should report an error
const s: Intl.SegmentData = segments.containing(40);
// This should be fine
const s: Intl.SegmentData | undefined = segments.containing(40);Documentation Link
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: lib.d.tsThe issue relates to the different libraries shipped with TypeScriptThe issue relates to the different libraries shipped with TypeScriptHelp WantedYou can do thisYou can do this