Transformer: map().flat() to flatMap()

Aperta
#213 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
68/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
javascript
Ambito
tooling

Direzione di ricerca

No files or tests are named in the issue. Start by locating the transformer implementation and its existing tests, then compare the behavior with the linked MDN and ECMAScript resources. Done means converting only statically verifiable array map().flat() calls with no flat() arguments to flatMap(), while leaving other cases unchanged.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

widely available
// before
const tags = posts.map((post) => post.tags).flat();

// after
const tags = posts.flatMap((post) => post.tags);

Only when the .map() receiver is a statically verifiable array and .flat() has no arguments.

Baseline: widely available (all browsers since 2020-01-15).

Resources: MDN · spec · webstatus

Lingua principale
JavaScript
Stelle
15
Fork
2
Merge medio
3h 58m
PR unite (30g)
6

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di codingjoe/esupgrade

Tutte le issue di codingjoe/esupgrade

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.