UNPKG

permix

Version:

Permix is a lightweight, framework-agnostic, type-safe permissions management library for JavaScript applications on the client and server sides.

26 lines (24 loc) 460 B
/** * @example * const permissions = { * post: { * create: true, * read: false, * }, * } * * isRulesValid(permissions) // true * * const permissions2 = { * post: { * create: true, * read: 'string', * }, * } * * isRulesValid(permissions2) // false */ declare function isRulesValid<T>(value: unknown): value is T; type MaybePromise<T> = T | Promise<T>; export { isRulesValid as i }; export type { MaybePromise as M };