MCPcopy Create free account
hub / github.com/formkit/formkit / isConditional

Function isConditional

packages/core/src/schema.ts:287–295  ·  view source on GitHub ↗
(
  node:
    | FormKitSchemaNode
    | FormKitSchemaAttributesCondition
    | FormKitSchemaAttributes
)

Source from the content-addressed store, hash-verified

285 * @param node - An object to check.
286 */
287export function isConditional(
288 node:
289 | FormKitSchemaNode
290 | FormKitSchemaAttributesCondition
291 | FormKitSchemaAttributes
292): node is FormKitSchemaNode | FormKitSchemaAttributesCondition {
293 if (!node || typeof node === 'string') return false
294 return has(node, 'if') && has(node, 'then')
295}
296
297/**
298 * Determines if the node is syntactic sugar or not.

Callers 8

parseAttrsFunction · 0.90
parseNodeFunction · 0.90
isSlotConditionFunction · 0.90
eachSectionFunction · 0.90
isSectionFunction · 0.90
compose.spec.tsFile · 0.90
parseAttrsFunction · 0.90
parseNodeFunction · 0.90

Calls 1

hasFunction · 0.90

Tested by

no test coverage detected