Something went wrong. Try again.
Monorepo for Tangled tangled.org
Something went wrong. Try again.
123456789101112131415import { isDid, isRecordKey, type Did, type RecordKey } from "@atcute/lexicons/syntax";
// asserting wrappers over atcute's syntax guards for xrpc input boundaries.// untrusted strings (user input, route params, storage) get rejected here// instead of traveling to the server and failing as a 400.export const didOf = (value: string): Did => { if (!isDid(value)) throw new Error(`invalid did: ${value}`); return value;};
export const recordKeyOf = (value: string): RecordKey => { if (!isRecordKey(value)) throw new Error(`invalid rkey: ${value}`); return value;};