microsoft / microsoft/TypeScript
String case change methods should return intrinsic string manipulation types
Nessuno ha ancora preso questa issue.
- Lingua principale
- Go
- Stelle
- 111k
- Fork
- 14.3k
- Merge medio
- 1g 19h
- PR unite (30g)
- 117
Descrizione
lib Update Request
Configuration Check
My compilation target is ES2018 and my lib is ["ES2016", "dom"].
Missing / Incorrect Imprecise Definitions
At least toUpperCase and toLowerCase methods on String, maybe/probably also the Locale versions?
Sample Code
type LittleT = "t" | "tt";
type BigT = Uppercase<LittleT>;
declare const smol: LittleT;
const big: BigT = smol.toUpperCase(); // err, string is not assignable to "T" | "TT
Documentation Link
https://tc39.es/ecma262/#sec-string.prototype.tolowercase
Note
I'm not sure about the Locale versions of these methods because I don't know what algorithm the "intrinsic" Uppercase<T> / Lowercase<T> helper types are required to follow. (Do we need separate LocaleUppercase / LocaleLowercase helpers?)
Also worth mentioning: I think what I'm looking for is a return type of e.g. Uppercase<this>, which shouldn't have an impact on non-literal string types because Uppercase<string> is just string.
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia con le dichiarazioni della libreria ES2016 per String e i tipi intrinseci esistenti Uppercase e Lowercase. Verifica l’esempio rispetto ai tipi restituiti richiesti, quindi analizza se le varianti di locale richiedono una gestione separata; il lavoro è completato quando il caso di stringa letterale è rappresentato senza modificare il comportamento di string.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- typescript
- Ambito
- compilers
- Tipo di issue
- Funzionalità
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100