phantom-types icon indicating copy to clipboard operation
phantom-types copied to clipboard

Document ability to override `parse` method

Open akefirad opened this issue 1 year ago • 1 comments

I ried to find if it's currently possible in docs and on the web, but to no avail. Apologies if I'm missing something. If it's not implemented already, can we have the possibility to customize the parsing logic. My use case is to implement NonBlankString (similar to NonEmptyStr but before validation, strips the string value first). Thanks.

akefirad avatar May 26 '24 05:05 akefirad

@akefirad This is just a matter of overriding the parse method in a subclass, but I see your point this could be explicitly documented. Let's keep this issue open to track that.

antonagestam avatar May 26 '24 09:05 antonagestam