( path: SchemaPath<TValue>, logic: LogicFn<TValue, boolean>, schema: NoInfer<SchemaOrSchemaFn<TValue>>, )
| 322 | * @publicApi 22.0 |
| 323 | */ |
| 324 | export function applyWhen<TValue>( |
| 325 | path: SchemaPath<TValue>, |
| 326 | logic: LogicFn<TValue, boolean>, |
| 327 | schema: NoInfer<SchemaOrSchemaFn<TValue>>, |
| 328 | ): void { |
| 329 | assertPathIsCurrent(path); |
| 330 | |
| 331 | const pathNode = FieldPathNode.unwrapFieldPath(path); |
| 332 | pathNode.mergeIn(SchemaImpl.create(schema), {fn: logic, path}); |
| 333 | } |
| 334 | |
| 335 | /** |
| 336 | * Conditionally applies a predefined schema to a given `FieldPath`. |
no test coverage detected
searching dependent graphs…