
@tahanabavi/type-permission
Framework-less, dependency-free capability permissions: one shared bigint bitfield, evaluated identically on the client and the server by the same pure functions. It answers "does this actor hold capability X?" — Discord's model, generalized — and deliberately leaves ownership to your app.
Overview
One bit map, evaluated identically on client and server.
type-permission is framework-less, dependency-free capability permissions. One shared bit map is evaluated identically on the client and the server by the same pure functions — no adapters, no runtime dependencies (not even Zod), no framework imports. It runs in a browser, Node, Bun, Deno, an edge worker, a Discord bot, or a CLI, unchanged.
It answers "does this actor hold capability X?" from a bigint bitfield — Discord's model, generalized. It deliberately does not answer "can I edit my own post?"; that needs the resource, which needs a database, which needs a framework. Keeping ownership out is what keeps this tiny.
A bit answers what an actor may do in general, never whether they own a specific row. has(MANAGE_MESSAGES) is this package's job; msg.authorId === me.id is your app's.