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

Function decodeErrors

packages/dev/src/index.ts:104–113  ·  view source on GitHub ↗
(
  error: FormKitHandlerPayload,
  next
)

Source from the content-addressed store, hash-verified

102 * @returns
103 */
104const decodeErrors: FormKitMiddleware<FormKitHandlerPayload> = (
105 error: FormKitHandlerPayload,
106 next
107) => {
108 if (error.code in errors) {
109 const err = errors[error.code]
110 error.message = typeof err === 'function' ? err(error) : err
111 }
112 return next(error)
113}
114
115let registered = false
116

Callers 2

defaultConfigFunction · 0.85
defaultConfigFunction · 0.85

Calls 1

nextFunction · 0.85

Tested by

no test coverage detected