* Creates a transforming schema that converts input to uppercase.
()
| 15 | * Creates a transforming schema that converts input to uppercase. |
| 16 | */ |
| 17 | function 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. |
no outgoing calls
no test coverage detected