(schema: JSONSchema)
| 236 | ]) |
| 237 | |
| 238 | export function isPrimitiveSchema(schema: JSONSchema): boolean { |
| 239 | return expandUnionSchema(schema).every((s) => { |
| 240 | if (typeof s === 'boolean') { |
| 241 | return false |
| 242 | } |
| 243 | |
| 244 | if (typeof s.type === 'string' && PRIMITIVE_SCHEMA_TYPES.has(s.type)) { |
| 245 | return true |
| 246 | } |
| 247 | |
| 248 | if (s.const !== undefined) { |
| 249 | return true |
| 250 | } |
| 251 | |
| 252 | return false |
| 253 | }) |
| 254 | } |
no test coverage detected