Sealed contracts
inkan seal: contracts compiled to plain code.
inkan checks every route through functions it makes once per schema. inkan seal
goes one step further and stamps every contract's check into code of its own, ahead of
time, into a file you can read and commit:
npx inkan seal src/app.ts # writes src/inkan.seal.jsimport from "./inkan.seal.js";
const = ({ });Big bodies get the most out of it: a body of 50 objects is checked faster than by any server in the bench. A sealed contract checks exactly as the schema does, the same values and the same messages. Writing the answer stays the schema's own, so sealed or not, an answer goes out the same way and keeps back every key the contract does not list.
No eval, no new Function: the code is in the file, and the file is what runs.
At start inkan writes the code for every contract again and compares hashes, so a
contract that changed since the seal was made is never checked by the old code. It
runs unsealed, as it would without the file, and inkan says which one and to run
inkan seal again. refine, transform, unions, records, dates and lazy schemas
run unsealed for now; inkan seal lists them.