MCPcopy Create free account
hub / github.com/codemix/graph / makeUpperCaseType

Function makeUpperCaseType

packages/graph/src/test/standardSchema.test.ts:17–32  ·  view source on GitHub ↗

* Creates a transforming schema that converts input to uppercase.

()

Source from the content-addressed store, hash-verified

15 * Creates a transforming schema that converts input to uppercase.
16 */
17function makeUpperCaseType(): StandardSchemaV1<string, string> {
18 return {
19 "~standard": {
20 version: 1,
21 vendor: "test",
22 validate: (value) => {
23 if (typeof value !== "string") {
24 return {
25 issues: [{ message: "Expected string" }],
26 };
27 }
28 return { value: value.toUpperCase() };
29 },
30 },
31 };
32}
33
34/**
35 * Creates a schema that trims whitespace from strings.

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected