Validators which can be shared between browsers and Node.js