FujoWebDev / FujoWebDev/fujocoded-plugins

Add option to preserve username case in zod-transform-socials (GitHub/Twitter/AO3)

Aperta
#49 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
zod-transform-socials
Lingua principale
TypeScript
Stelle
30
Fork
7
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

`zod-transform-socials` lower-cases the whole URL before matching, which means usernames are also lower-cased for services that preserve case. For example, `github.com/FujoWebDev/AO3.js` is reported as `fujowebdev/ao3.js`.

Lower-casing is needed for host detection (so `BSKY.APP` matches `bsky.app`), but it should not apply to the username (or at least, it should be an option not to apply it).

Among services affected:

- GitHub— org and repo names preserve case.
- Twitter/X — handle display preserves case.
- AO3 — usernames and pseuds preserve case.
- NPM is affected in that older package names could be uppercase/lowercase, but now they're all lowercase. With that said, the install is case sensitive.

This changes observable output, so it is a breaking change. We could mitigate it by adding a `preserveCase` setting and/or a `canonicalCase` option for known addresses that one may want to keep consistent. We could also consider exporting convenience methods like "`isSameProfile`".

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.