MCPcopy
hub / github.com/Effect-TS/effect / assertDraft7

Function assertDraft7

packages/effect/test/Schema/JSONSchema.new.test.ts:34–46  ·  view source on GitHub ↗
(schema: Schema.Schema<A, I, R>, expected: object)

Source from the content-addressed store, hash-verified

32}
33
34async function assertDraft7<A, I, R>(schema: Schema.Schema<A, I, R>, expected: object) {
35 const jsonSchema = JSONSchema.make(schema)
36 deepStrictEqual(jsonSchema, {
37 "$schema": "http://json-schema.org/draft-07/schema#",
38 ...expected
39 } as any)
40 const valid = ajvDraft7.validateSchema(jsonSchema)
41 if (valid instanceof Promise) {
42 await valid
43 }
44 strictEqual(ajvDraft7.errors, null)
45 return jsonSchema
46}
47
48async function assertDraft201909<S extends Schema.Schema.All>(
49 schema: S,

Callers 1

Calls 3

deepStrictEqualFunction · 0.90
strictEqualFunction · 0.90
makeMethod · 0.65

Tested by

no test coverage detected