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

Function decodeWarnings

packages/dev/src/index.ts:136–145  ·  view source on GitHub ↗
(
  warning: FormKitHandlerPayload,
  next
)

Source from the content-addressed store, hash-verified

134 * @returns
135 */
136const decodeWarnings: FormKitMiddleware<FormKitHandlerPayload> = (
137 warning: FormKitHandlerPayload,
138 next
139) => {
140 if (warning.code in warnings) {
141 const warn = warnings[warning.code]
142 warning.message = typeof warn === 'function' ? warn(warning) : warn
143 }
144 return next(warning)
145}
146
147// Some bundlers need to see an export:
148export { errors, warnings, register }

Callers

nothing calls this directly

Calls 2

warnFunction · 0.85
nextFunction · 0.85

Tested by

no test coverage detected