Function
createAsyncMockSchema
(validate: StandardSchemaV1['~standard']['validate'])
Source from the content-addressed store, hash-verified
| 494 | } |
| 495 | |
| 496 | function createAsyncMockSchema(validate: StandardSchemaV1['~standard']['validate']): StandardSchemaV1 { |
| 497 | return { |
| 498 | '~standard': { |
| 499 | version: 1, |
| 500 | vendor: 'mock-async', |
| 501 | validate: value => Promise.resolve(validate(value)), |
| 502 | }, |
| 503 | } |
| 504 | } |
| 505 | |
| 506 | const stringSchema = createMockSchema(value => |
| 507 | typeof value === 'string' ? { issues: undefined, value } : { issues: [{ message: 'Expected string' }] }, |
Tested by
no test coverage detected