MCPcopy Create free account
hub / github.com/middleapi/orpc / isNeverSchema

Function isNeverSchema

packages/openapi/src/schema-utils.ts:39–58  ·  view source on GitHub ↗
(schema: JSONSchema)

Source from the content-addressed store, hash-verified

37}
38
39export function isNeverSchema(schema: JSONSchema): boolean {
40 // Boolean `false` is the shorthand never-schema
41 if (schema === false) {
42 return true
43 }
44
45 if (typeof schema === 'object' && schema.not !== undefined) {
46 // `{ not: true }` — negation of the boolean catch-all
47 if (schema.not === true) {
48 return true
49 }
50
51 // `{ not: {} }` — negation of the empty object, which accepts everything
52 if (typeof schema.not === 'object' && Object.keys(schema.not).length === 0) {
53 return true
54 }
55 }
56
57 return false
58}
59
60/**
61 * @internal

Callers 2

toOpenAPIContentFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected