Skip to content

Return pseuds as an array instead of a joined string - #203

Open
Revan0809 wants to merge 1 commit into
FujoWebDev:mainfrom
Revan0809:fix/return-pseuds-as-array
Open

Revan0809 wants to merge 1 commit into
FujoWebDev:mainfrom
Revan0809:fix/return-pseuds-as-array

Conversation

@Revan0809

Copy link
Copy Markdown

Summary

getUserProfilePseuds already built pseudsArray by parsing each dd.pseuds a link, but joined it into a single ", "-separated string (PSEUD_SUFFIX) before returning — matching the // TODO: this should really be an array left in src/users/index.ts.

  • src/users/getters.ts: return pseudsArray directly; removed the now-unused PSEUD_SUFFIX constant.
  • src/users/index.ts: removed the resolved TODO comment.
  • types/entities.ts: User.pseuds is now string[].
  • types/zod/generated/schemas.ts: regenerated via npm run generate-schemas.
  • tests/user.test.ts: updated the astolat fixture expectation to the array form.

Fixes #202

Test plan

  • npm test — 120 passed, 5 skipped, 1 todo (full suite, including the regenerated-schema and updated-fixture checks)
  • npx tsc --noEmit — 0 errors
  • Verified the updated test actually catches the bug: reverting only getters.ts reproduces the exact pre-fix string output against the mocked astolat fixture
  • Confirmed no other call sites return/expect a joined pseuds string (the pseud/username pairs in src/series/getters.ts, src/works/work-getters.ts, and src/works/chapter-getters.ts are an unrelated per-author field, already array-shaped, left untouched)

🤖 Generated with Claude Code

getUserProfilePseuds already built pseudsArray internally but joined
it into a single ", "-separated string before returning, so callers
had to parse it back apart to get individual pseuds. Return the array
directly instead.

Updates the User.pseuds type and regenerates the zod schemas.

Fixes FujoWebDev#202
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Return pseuds as arrays instead of strings

1 participant