FujoWebDev / FujoWebDev/fujocoded-plugins

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

Open
#49 0 comments 0 reactions 0 assignees View on GitHub
zod-transform-socials
Dominant language
TypeScript
Stars
30
Forks
7
PR merge metrics
No merged PRs in 30d

Description

`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`".

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.