Add a utility to convert file URL or path to one of them?
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- JavaScript
- Sterne
- 122k
- Forks
- 37.3k
- Ø Merge
- 4 T. 2 Std.
- Gemergte PRs (30 T.)
- 283
Beschreibung
What is the problem this feature will solve?
It's a nice way to accept both URL and path string in API, but we need covert it to either string or URL, it would be nice to have a built-in method to do this.
What is the feature you are proposing to solve the problem?
For converting to string:
Maybe add path.from(URL | string)? @sindresorhus proposed here.
For converting to URL:
url.from(URL | string)
I'm not sure, since URL is a standard, I guess adding method URL object won't be acceptable, maybe to node:url module?
What alternatives have you considered?
No response
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne damit, die vorgeschlagenen APIs path.from(URL | string) und url.from(URL | string) sowie das im Issue erwähnte node:url-Modul zu überprüfen. Bestimme, welche Konvertierungssemantik und welche Modulzuständigkeit angemessen sind; die Arbeit ist abgeschlossen, wenn eine API-Form und ihr Verhalten eindeutig spezifiziert und mit entsprechender Testabdeckung implementiert sind.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- javascript, node.js
- Bereich
- api, backend-api-design
- Issue-Typ
- Feature
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Aktivitätsstatus
- Ruhig
- Klarheit
- Muss geklärt werden
- Anfängerfreundlichkeit
- 35/100