| 13 | * - `object` |
| 14 | */ |
| 15 | export class ConditionalAttributeType implements CustomAttributeTypeInterface { |
| 16 | validate(value: any, _config: Config, key: string): ValidationError[] { |
| 17 | if ( |
| 18 | typeof value === 'boolean' || |
| 19 | value === null || |
| 20 | value === undefined || |
| 21 | typeof value === 'object' |
| 22 | ) { |
| 23 | return []; |
| 24 | } |
| 25 | |
| 26 | return [ |
| 27 | { |
| 28 | id: 'attribute-type-invalid', |
| 29 | level: 'error', |
| 30 | message: `Attribute '${key}' must be type 'boolean | object' (null or undefined are also allowed)`, |
| 31 | }, |
| 32 | ]; |
| 33 | } |
| 34 | } |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…