(
path: SchemaPath<TValue, SchemaPathRules.Supported, TPathKind>,
configOrLogic?:
| {when?: NoInfer<LogicFn<TValue, boolean, TPathKind>>}
| NoInfer<LogicFn<TValue, boolean, TPathKind>>,
)
| 42 | ): void; |
| 43 | |
| 44 | export function readonly<TValue, TPathKind extends PathKind = PathKind.Root>( |
| 45 | path: SchemaPath<TValue, SchemaPathRules.Supported, TPathKind>, |
| 46 | configOrLogic?: |
| 47 | | {when?: NoInfer<LogicFn<TValue, boolean, TPathKind>>} |
| 48 | | NoInfer<LogicFn<TValue, boolean, TPathKind>>, |
| 49 | ): void { |
| 50 | assertPathIsCurrent(path); |
| 51 | |
| 52 | const pathNode = FieldPathNode.unwrapFieldPath(path); |
| 53 | |
| 54 | const logic = |
| 55 | typeof configOrLogic === 'function' ? configOrLogic : (configOrLogic?.when ?? (() => true)); |
| 56 | |
| 57 | pathNode.builder.addReadonlyRule(logic); |
| 58 | } |
no test coverage detected