MCPcopy Create free account
hub / github.com/pollinations/pollinations / validator

Function validator

shared/middleware/validator.ts:10–24  ·  view source on GitHub ↗
(
    target: Target,
    schema: T,
)

Source from the content-addressed store, hash-verified

8} from "../http/validation-error.ts";
9
10export const validator = <
11 T extends z.ZodType,
12 Target extends keyof ValidationTargets,
13>(
14 target: Target,
15 schema: T,
16) =>
17 zValidator(target, schema, (result, _c) => {
18 if (!result.success) {
19 throw new ValidationError(
20 new ZodError(result.error as $ZodIssue[]),
21 target as ValidationTarget,
22 );
23 }
24 });

Callers 8

createTextCacheAppFunction · 0.90
text-cache.test.tsFile · 0.90
proxy.tsFile · 0.90
oauth.tsFile · 0.90
api-keys.tsFile · 0.90
app-lookup.tsFile · 0.90
account.tsFile · 0.90

Calls

no outgoing calls

Tested by 1

createTextCacheAppFunction · 0.72