All files / realm/blong-access/adapter/db handlerGroup.ts

100% Statements 31/31
100% Branches 0/0
100% Functions 0/0
100% Lines 31/31

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 321x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x  
import {handlerGroup} from '@feasibleone/blong';
 
import type {AccountLib} from './account.ts';
import type {AccessModelLib} from './accessModel.ts';
import type {GoogleLib} from './google.ts';
import type {OidcLib} from './oidc.ts';
import type {PasswordLib} from './password.ts';
 
/**
 * The libraries the `adapter/db` group injects, as one type.
 *
 * Every bundle the group holds is listed here once — adding a library means one
 * line, not an annotation in fifty handlers.
 */
export type AccessDbLib = AccessModelLib & AccountLib & OidcLib & PasswordLib & GoogleLib;
 
/**
 * `handler` for the `adapter/db` group — the framework factory with
 * {@link AccessDbLib} typed on `lib`, so each handler destructures the members it
 * uses and gets them typed:
 *
 * ```typescript
 * export default handler(({lib: {binHex}, errors}) => async function …)
 * ```
 *
 * This file sits in the handler-group folder on purpose, and the loader skips it
 * by name: `handlerGroup.ts` is a plain module (it exports the factory its
 * siblings import), so it is neither loaded as a handler nor reported as a plain
 * module in a group.
 */
export const handler = handlerGroup<AccessDbLib>();