( node: BaseRoot, value: unknown, key: PropertyKey | null, owner?: BaseNode )
| 171 | } |
| 172 | |
| 173 | export const assertDefaultValueAssignability = ( |
| 174 | node: BaseRoot, |
| 175 | value: unknown, |
| 176 | key: PropertyKey | null, |
| 177 | owner?: BaseNode |
| 178 | ): unknown => { |
| 179 | // a function default is checked each time it's applied |
| 180 | if (isThunk(value)) return value |
| 181 | |
| 182 | if (hasDomain(value, "object")) |
| 183 | throwParseError(writeNonPrimitiveNonFunctionDefaultValueMessage(key)) |
| 184 | |
| 185 | return checkDefault(node, value, key, owner) |
| 186 | } |
| 187 | |
| 188 | // unlike its input, a thunk's result may be an object |
| 189 | export const checkDefault = ( |
no test coverage detected