* Checks if a given option is present in the node value. * * @param node - The The @formkit/node#FormKitNode | FormKitNode being checked. * @param value - The value of any option. * * @returns `boolean` * * @public
(node: FormKitNode, value: any)
| 55 | * @public |
| 56 | */ |
| 57 | function isChecked(node: FormKitNode, value: any) { |
| 58 | // We need to force vue’s reactivity to respond when the value is run: |
| 59 | node.context?.value |
| 60 | node.context?._value |
| 61 | if (Array.isArray(node._value)) { |
| 62 | return node._value.some((existingValue) => |
| 63 | shouldSelect(optionValue(node.props.options, value), existingValue) |
| 64 | ) |
| 65 | } |
| 66 | return false |
| 67 | } |
| 68 | |
| 69 | /** |
| 70 | * A feature that adds checkbox selection support. |
nothing calls this directly
no test coverage detected