Basic type validators exposed exported as is object. So you can extend it:
import { validate, is } from"bycontract";is.email=function( val ){ var re = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
returnre.test( val );}validate( "me@dsheiko.com","email" ); // okvalidate( "bla-bla","email" ); // ByContractError: expected email but got string