Skip to content

feat(type): add string.base58 built-in validator#1604

Open
WolfieLeader wants to merge 4 commits intoarktypeio:mainfrom
WolfieLeader:feat/string-base58-validator
Open

feat(type): add string.base58 built-in validator#1604
WolfieLeader wants to merge 4 commits intoarktypeio:mainfrom
WolfieLeader:feat/string-base58-validator

Conversation

@WolfieLeader
Copy link

Summary

Closes #1520

Adds string.base58 as a built-in string validator following the existing hex pattern.

Base58 alphabet (per IETF draft and Bitcoin spec):
123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz
Excludes: 0 (zero), O (capital o), I (capital i), l (lowercase L)

  • Regex: /^[1-9A-HJ-NP-Za-km-z]+$/ (uses + like hex, rejects empty strings)
  • Registered via regexStringNode(), added to Scope.module and namespace $ type
  • Tests individually verify each excluded character (0, O, I, l)

Note: the issue's suggested regex used \d which includes 0 — corrected to 1-9.

Test plan

  • Valid Base58 strings (Bitcoin address format, simple alphanumeric) accepted
  • Each excluded character rejected individually
  • Empty string rejected
  • pnpm prChecks passes (format, lint, typecheck, full test suite)

Copy link
Contributor

@pullfrog pullfrog bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean, minimal addition. Regex correctly implements the Base58 alphabet (1-9A-HJ-NP-Za-km-z), properly excluding 0/O/I/l. Tests cover all excluded characters and the empty-string edge case. Follows the existing hex pattern exactly.

Pullfrog  | View workflow runpullfrog.com𝕏

@WolfieLeader
Copy link
Author

Thanks pullfrog🐸

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

Labels

None yet

Projects

Status: To do

Development

Successfully merging this pull request may close these issues.

Add base58 as a built-in string validator

1 participant