Skip to content

task/008: Replace hand-rolled validators with stdlib - #6

Merged
Igloczek merged 1 commit into
masterfrom
task/008-replace-handrolled-validators
Jun 30, 2026
Merged

Igloczek merged 1 commit into
masterfrom
task/008-replace-handrolled-validators

Conversation

@Igloczek

@Igloczek Igloczek commented Jun 30, 2026 •

Copy link
Copy Markdown
Collaborator

Implements tasks/008-replace-handrolled-validators.md from the ponytail audit backlog.

Goal

Delete small util modules that duplicate node:net, URL, and URLSearchParams.

Scope

  • Replace usages of src/util/is-ip.ts with node:net isIP() / isIPv4() / isIPv6() (server) or minimal inline checks (frontend).
  • Replace src/util/is-url.ts with URL.canParse() or try { new URL() }.
  • Replace src/util/is-fqdn.ts with URL hostname validation or a single regex at call sites.
  • Replace src/util/form-urlencode.ts with new URLSearchParams(params).toString().
  • Delete the four util files after migration.
  • Update test/backend-test or frontend tests that import these modules.

Acceptance criteria

  • src/util/is-ip.ts, is-url.ts, is-fqdn.ts, form-urlencode.ts are deleted.
  • All former import sites compile and behave the same for existing test cases.
  • bun run lint passes.
  • bun run test:backend passes.

Depends on

Nothing.

Verification

bun run lint
bun run test:backend
rg "util/is-ip|util/is-url|util/is-fqdn|form-urlencode" src test

Audit reference

Finding #16 — hand-rolled validators.

@Igloczek

Copy link
Copy Markdown
Collaborator Author

/ponytail-review

Four util files deleted with no new shared modules. Stdlib used at call sites per task spec.

Lean already. Ship.

9 files changed, 162 insertions(+), 212 deletions(-)

Delete is-ip, is-url, is-fqdn, and form-urlencode util modules.
Use node:net, URL/URLSearchParams, and inline hostname checks at call sites.
@Igloczek
Igloczek force-pushed the task/008-replace-handrolled-validators branch from af1680f to 0d2c531 Compare June 30, 2026 11:44
@Igloczek
Igloczek merged commit c520e3c into master Jun 30, 2026
1 check passed
@Igloczek
Igloczek deleted the task/008-replace-handrolled-validators branch June 30, 2026 12:58
Igloczek added a commit that referenced this pull request Aug 8, 2026
…ators

task/008: Replace hand-rolled validators with stdlib
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.

1 participant