As discussed in D7077 we want to add type definition for Intl, because the type provided by flow doesn't include Segmenter field we need.
Here are the typescript types: https://github.com/microsoft/TypeScript/blob/main/src/lib/es2022.intl.d.ts
Details
Details
run flow in keyserver/. Checked that it is possible to use segment method of the returned object
Diff Detail
Diff Detail
- Repository
- rCOMM Comm
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
keyserver/src/utils/segmenter.js | ||
---|---|---|
48 ↗ | (On Diff #24336) | We should not be returning an any type... this ruins all of the work you've done elsewhere in the file. You would have the same effect if you replaced this whole file with this: function getSegmenter(): any { return new Intl.Segmenter('eng', { granularity: 'word' }); } Did you try using Segmenter instead of any here? Perhaps you tried that but got some Flow errors? We should try to resolve those errors. |
keyserver/src/utils/segmenter.js | ||
---|---|---|
48 ↗ | (On Diff #24336) | Of course, this is a mistake. I forgot to change this after I wrote all types |