Skip to content

Conversation

@shau-kote
Copy link

@shau-kote shau-kote commented Oct 27, 2023

Description

The given PR provides a way to replace the failure implementation used by the built-in codecs, like, t.string etc.

Goal

We want to use the current full-featured validation in the dev environment, but in the production we want to just log errors and go ahead "as is".

So the idea is to have an option to change the validation behaviour with a code like this.

import {success, setFailureImplementation} from ''

if (process.env.NODE_ENV !== 'development') {
  setFailureImplementation(value, context, message) => { 
    Logger.logError(context, message)
    return success(value)
  }
}

Please feel free to add your feedback, I'll do my best to fine-tune my PR>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant