(jsonOrBool: boolean | JsonSchema)
| 157 | * @returns A JSON Schema document representing the input value. |
| 158 | */ |
| 159 | export function jsonOrBooleanToJSON(jsonOrBool: boolean | JsonSchema) { |
| 160 | if (typeof jsonOrBool === 'object') { |
| 161 | return jsonOrBool; |
| 162 | } else { |
| 163 | return jsonOrBool ? {} : {not: {}}; |
| 164 | } |
| 165 | } |
no outgoing calls
no test coverage detected