UNPKG

desi-mongoose

Version:

A fun and intuitive MongoDB ODM for Node.js with a Hinglish twist

22 lines (21 loc) 607 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.DesiValidator = void 0; class DesiValidator { } exports.DesiValidator = DesiValidator; DesiValidator.jaruri = (value) => { return value !== undefined && value !== null; }; DesiValidator.email = (value) => { return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(value); }; DesiValidator.mobile = (value) => { return /^[0-9]{10}$/.test(value); }; DesiValidator.minLength = (length) => (value) => { return value.length >= length; }; DesiValidator.maxLength = (length) => (value) => { return value.length <= length; };