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

Function findDefinition

packages/core/src/node.ts:3247–3256  ·  view source on GitHub ↗

* A cheap function that iterates over all plugins and stops once node.define * is called. * * @param node - A FormKitNode | FormKitNode * @param plugins - An array of FormKitPlugin | FormKitPlugin * * @internal

(node: FormKitNode, plugins: Set<FormKitPlugin>)

Source from the content-addressed store, hash-verified

3245 * @internal
3246 */
3247function findDefinition(node: FormKitNode, plugins: Set<FormKitPlugin>): void {
3248 // If the definition is already there, force call to define.
3249 if (node.props.definition) return node.define(node.props.definition)
3250 for (const plugin of plugins) {
3251 if (node.props.definition) return
3252 if (typeof plugin.library === 'function') {
3253 plugin.library(node)
3254 }
3255 }
3256}
3257
3258/**
3259 * Create a new context object for our a FormKit node, given default information

Callers 1

nodeInitFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected