Suite of AT Protocol TypeScript libraries built on web standards
21
fork

Configure Feed

Select the types of activity you want to include in your feed.

at main 20 lines 520 B view raw
1import { isPlainObject } from "../data/object.ts"; 2import { 3 Schema, 4 type ValidationResult, 5 type ValidatorContext, 6} from "../validation.ts"; 7 8export type UnknownObjectOutput = Record<string, unknown>; 9 10export class UnknownObjectSchema extends Schema<UnknownObjectOutput> { 11 validateInContext( 12 input: unknown, 13 ctx: ValidatorContext, 14 ): ValidationResult<UnknownObjectOutput> { 15 if (!isPlainObject(input)) { 16 return ctx.issueInvalidType(input, "object"); 17 } 18 return ctx.success(input); 19 } 20}