1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-19 02:44:01 +00:00
Files
browser/apps/web/src/app/tools/send/send-access/util.ts
✨ Audrey ✨ 6ab67e9a8f [PM-23532] introduce send access guard (#15529)
* document expected auth flows
* implement send access trampoline
2025-08-08 14:28:03 -04:00

14 lines
480 B
TypeScript

import { ErrorResponse } from "@bitwarden/common/models/response/error.response";
import { SendContext } from "./types";
/** narrows a type to an `ErrorResponse` */
export function isErrorResponse(value: unknown): value is ErrorResponse {
return value instanceof ErrorResponse;
}
/** narrows a type to a `SendContext` */
export function isSendContext(value: unknown): value is SendContext {
return !!value && typeof value === "object" && "id" in value && "key" in value;
}