Skip to content

feat: add .implCreate.noseal for bypassing the seal in create - #65

Merged
jo16oh merged 6 commits into
mainfrom
feat/create-noseal
Oct 14, 2026
Merged

jo16oh merged 6 commits into
mainfrom
feat/create-noseal

Conversation

@jo16oh

@jo16oh jo16oh commented Oct 14, 2026 •

Copy link
Copy Markdown
Owner

A create whose payload always passes the seal still returns the seal's return type:

const SectionId = Val.companion<SectionId>()
  .implCreate(() => randomBytes(4).toString("hex"))
  .implSeal((text, seal): SectionId | undefined =>
    /^[0-9a-f]{8}$/.test(text) ? seal(text) : undefined,
  );

SectionId.create(); // SectionId | undefined, though never undefined
  • Add .implCreate.noseal(f), whose create and create.nocopy return the Val
  • Reject a function with arguments in .implCreate.noseal at the type level, so no input bypasses the seal
  • Skip the custom seal in production; in development, run it and throw if it rejects the created payload or normalization changes it
  • Read .implCreate.noseal(f) as the implCreate step in valof-lint; bypassed-companion and unimplemented-trait stopped reading the chain there
  • Replace "mint" with "create" or "generate" in JSDoc, error messages and the README
  • Add the API row
  • Production gzip grows by 44 B, for the wiring of noseal; the development check is removed from production builds

@jo16oh jo16oh added the enhancement New feature or request label Oct 14, 2026
@jo16oh
jo16oh merged commit 860d120 into main Oct 14, 2026
3 checks passed
@jo16oh
jo16oh deleted the feat/create-noseal branch October 14, 2026 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant