Skip to content

Change validate() to return value via callback #250

@hueniverse

Description

@hueniverse

The current API is problematic because it can only return an error. Most of the bugs around partial modification of the value passed (alternatives, objects) are due to the fact that the same value passed is directly manipulated. Instead, we need to keep the inputs constant and generate a new object value which is the modified copy. To do this, we need to change the return values to include the error and modified value.

The main breaking change here isn't the interface but the fact that the value input is now constant and the converted/modified value is returned from the function via the callback.

This issue only changes the API. Another will add the value to the callback.

This also removed the undocumented validateCallback() methods.

Metadata

Metadata

Assignees

Labels

breaking changesChange that can breaking existing code

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions