{"_id":"@aeres-games/validator","_rev":"6-a7e8cf30d8dc0d74c7112dfa7ef6b2fb","name":"@aeres-games/validator","dist-tags":{"latest":"1.3.1"},"versions":{"1.0.0":{"name":"@aeres-games/validator","version":"1.0.0","description":"A JS data validator","main":"dist/Validator.js","scripts":{"build":"tsc --declaration","watch":"tsc --watch","clean-build":"rimraf ./dist && tsc --declaration","test":"mocha --require ts-node/register tests/**/*.test.ts"},"repository":{"type":"git","url":"git+https://github.com/Aeres-Games/validator.git"},"keywords":["js","typescript","data","validation"],"author":{"name":"Matthieu 'Aeres-Blade' Arques","email":"aeresblade@aeres.games"},"license":"MIT","bugs":{"url":"https://github.com/Aeres-Games/validator/issues"},"homepage":"https://github.com/Aeres-Games/validator#readme","devDependencies":{"@types/chai":"^4.1.7","@types/mocha":"^5.2.6","@types/node":"^12.0.0","chai":"^4.2.0","mocha":"^6.1.4","rimraf":"^2.6.3","ts-node":"^8.1.0","typescript":"^3.4.5"},"gitHead":"70f4317acb8914118482dfaa0f41554a71c25ff4","_id":"@aeres-games/validator@1.0.0","_nodeVersion":"10.12.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-KxUroy3KRFssmCxTsjRWGZwU/7ITSQg5Sy2GLdDzwQtGwo86rx9zVtWs59P5HcDyzwo8V4U8NF/W2PQsjS8rkg==","shasum":"707e80cbb9073722e5c1fcdd2a8ad694499f7fd8","tarball":"https://registry.npmjs.org/@aeres-games/validator/-/validator-1.0.0.tgz","fileCount":19,"unpackedSize":14520,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc1E20CRA9TVsSAnZWagAAG8IP+wS1RGacb1Umu4ayuhAb\n2/vHxtiKMgcBKOMilW4sga8rEZTwt5hupMAkRQjHABCQ03DoNTEio4kXKI2b\nfp5t2fpMJNf8NZqPLLnVOgTZd4O1IaAn45COig1zbmvaemCSZTDEktvNNAf8\nKAZXPcACEZCR41BZ4Kq/EH26xyCgqPexrJk1/3VpvjRDpgtgpv6ByK4eQrjt\nlEyRhe2jbt7D3y5xRGD5bJLthQlYpFgCZT5ddRcEze1SzVTxuwMudvIyaX5b\nZ1tQySa1DThBEVmYTOemM9Qh6g8o+uL/XGRjMQdspRA1v6WEuzXMrQ2/XjAU\nXaS3W4olZL5RTc/7WuMvqu6XVI0sFsdfZv3X503omMP0wFGA8+BmkQl8zypf\nCNnwLSdGtBfQoBAkDYShyIebhzIrOzsRXSWm6molbbpQepk3KTtj3kpdeC1S\ndQK19jND6qzKVmjWOokrgcgpedVTHT0buV/JFyiY+PZr178Zh5YAM/hvlxgq\nx8Gnq4z5tM+PvEKJWwbN8Ke6CLjjktBwnuitPkDdW6bIrpUlMLK+UhmfqImZ\nmiHdoR9zQ655hWOfYVqqbDOEHjEz24JBinr+k+/TCmgwFuRZv4zOiWjrMejb\npryEQtmf/bEoU5Tuqwv1IGxH+VEoqSh0cV7e9OkhhO/UyFzne7eA8tTlD7ss\n1TWj\r\n=3dzg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF75I7u3Cw93SloUHw53zmD6/6rwBHQk3tSfEa4KyeoTAiEAggr7uCVy5iqCmnWjczKojR3a8p8jG7hZKD3+jWMTwoE="}]},"maintainers":[{"name":"aeres-blade","email":"contact@aeres.games"}],"_npmUser":{"name":"aeres-blade","email":"contact@aeres.games"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/validator_1.0.0_1557417395986_0.9338962820901533"},"_hasShrinkwrap":false},"1.1.0":{"name":"@aeres-games/validator","version":"1.1.0","description":"A JS data validator","main":"dist/Validator.js","scripts":{"build":"tsc --declaration","watch":"tsc --watch","clean-build":"rimraf ./dist && tsc --declaration","test":"mocha --require ts-node/register tests/**/*.test.ts"},"repository":{"type":"git","url":"git+https://github.com/Aeres-Games/validator.git"},"keywords":["js","typescript","data","validation"],"author":{"name":"Matthieu 'Aeres-Blade' Arques","email":"aeresblade@aeres.games"},"license":"MIT","bugs":{"url":"https://github.com/Aeres-Games/validator/issues"},"homepage":"https://github.com/Aeres-Games/validator#readme","devDependencies":{"@types/chai":"^4.1.7","@types/mocha":"^5.2.6","@types/node":"^12.0.0","chai":"^4.2.0","mocha":"^6.1.4","rimraf":"^2.6.3","ts-node":"^8.1.0","typescript":"^3.4.5"},"gitHead":"47807ed228ecb50d0e7483a2f5e5b1fff0a7a023","_id":"@aeres-games/validator@1.1.0","_nodeVersion":"10.12.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-EBvCamC/F0xp+3YzA7s9iGAn7cZ0w4/w0oygYbB89HaI8LMET3ZapN+PnbMApzUQ/GH3nZ4CMjCvtuXKaknATw==","shasum":"a246681895ef64b8ebf826b5c74030609f610ae6","tarball":"https://registry.npmjs.org/@aeres-games/validator/-/validator-1.1.0.tgz","fileCount":19,"unpackedSize":15597,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc1JFdCRA9TVsSAnZWagAAqXgP/A6uAfQKS70TFfWRlH1p\nybxAp4Dr4g7JF68LJIPBDNH+H3i9WIBiw1MbteFEbk6xTHg2osDdGa0LbrIQ\nZCpTlzF6AHRU4Ki0EKLR6DTw/phtTfLC7S+yplPKh15CFvwNN2DaJ1UXzEFa\nacTtPUAQILzOaxK2x1pmRrJFaBRuNwlZxKUtJMDNvLtEcKSOxSDb6aIY8JDf\nwlAy0O9etbWCG9ccfbgGkfbtcI3n83eXvT6fikC5ohhUY8q2Q4pve2x1Sp5Y\nSe5Ij/UN6zUHXVdq+evy4sIHVCjZfqeWnq+Tx47w6YA6CpTRkxyc+i9c9c8Z\nDWLXoIyojQ1iJEFHM936I2q0eZrTlsLh6P1jLpZk6MEcS21YB9G0RAfdPDnj\nsvNgOzh9mS8hIBQbCiu0/BrBRwUmh6gZI6i/CP8BY83o4uh6kjWuNSBvGYre\nndLOmZ1N3xqdJJgFdnQOZVNbNGrh+fMus3d2deCTE/L+RLadcS8B9EsyBoc7\n6N1jsoC3oSzKgvUbkXAUVQP6/hLCQZkJR2liPxed28FTyC5tiKbnF6Qd0i26\ng/zUc9PYT6Tsg8yqXGoofpM1Duwciu7rDZXfFZcc0jrso0mDaQiB7z9JYtNd\njjLECvG4m0EyItohCE/G7QtIDxbT75XPWza/xU2LYrc83xZnB2Zd9QrO+Gd0\nvpkh\r\n=R897\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD/w2WEH7e3zt6NgYQgzGJTGxZmq2h0XAoDrEeDTooKhwIgdN/PnKuSLXBQhwmX6mvystRAv6zUWmV/8+1XOBVRf30="}]},"maintainers":[{"name":"aeres-blade","email":"contact@aeres.games"}],"_npmUser":{"name":"aeres-blade","email":"contact@aeres.games"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/validator_1.1.0_1557434716752_0.660027583028626"},"_hasShrinkwrap":false},"1.2.0":{"name":"@aeres-games/validator","version":"1.2.0","description":"A JS data validator","main":"dist/Validator.js","scripts":{"build":"tsc --declaration","watch":"tsc --watch","clean-build":"rimraf ./dist && tsc --declaration","test":"mocha --require ts-node/register tests/**/*.test.ts"},"repository":{"type":"git","url":"git+https://github.com/Aeres-Games/validator.git"},"keywords":["js","typescript","data","validation"],"author":{"name":"Matthieu 'Aeres-Blade' Arques","email":"aeresblade@aeres.games"},"license":"MIT","bugs":{"url":"https://github.com/Aeres-Games/validator/issues"},"homepage":"https://github.com/Aeres-Games/validator#readme","devDependencies":{"@types/chai":"^4.1.7","@types/mocha":"^5.2.6","@types/node":"^12.0.0","chai":"^4.2.0","mocha":"^6.1.4","rimraf":"^2.6.3","ts-node":"^8.1.0","typescript":"^3.4.5"},"gitHead":"dbbbb3f8d9769cc254a1045d4ca8558402d2a610","_id":"@aeres-games/validator@1.2.0","_nodeVersion":"10.12.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-cFnT8jtwj/cYr3Bq6KkOE/c3IFSPTq60G3o8oAOIwO3iNrSsJrOztJLsBuJtpEkC9wCPBHse86WB9p32QkKDSQ==","shasum":"763afa918974d1edb20b9e2cd63aa6bf9c7c59c8","tarball":"https://registry.npmjs.org/@aeres-games/validator/-/validator-1.2.0.tgz","fileCount":23,"unpackedSize":18433,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc1eW8CRA9TVsSAnZWagAAgW8P/3yRKpuOO5juMtTTc7fP\nf5JuRF5ycvpMtTjKwhbPhd8Mp8neuEXNstuYzWymhjyGMtXkFanlKOm+pWl5\nZo66mJn4ixmcQScGaXr7yfYmECYT+VhKzaETQIFUfZU9LIfbApQGyCDLRaXw\n87ZcXWL95ximWo2bCr8Pbv8pXHLQf2aNlmV41N1k66eCYx6UwQbAZEvfqhVg\nEgS7yfPjjsp+je+Rle3Hcb94grSv1SpqXkcDptUm28ncIgTDqCiANPZQs65V\ngZk+T3w+Afi8R3DOD00UyvYQK5zE2r8ZR9ii2lnyLb+9IMXg1cRxKDk9PIvs\nZEjw3MRtXIHFywKxRHws+lhecBmYA6X5x9I+vRYOeeLqCQNxTm3UWwXSvvrT\nbVaMWgTWn1awd4iF7qNZ01FNb/0/JMXg4XjSwtVd/sMFydJ8rmLlcelZM2qR\nZSyJFZydWWjWVXxiKXcxoUkerPZlZElQgRN2jxNvz/atfH6ZtbCOLJ2JMSr9\nR717EA5hUMpBvECVmORQuTySKA8qmUGCs1zpNDdl/+wnDHoVb6+8I1U5yOHW\nJsoXXltbe6LnJemq1zCMxDW58VFBGbbzKDZkp7uzm03LAjx8RkrnjCwN6kGb\nzxnjeJoEO9cKYch9tf+VAysBvHrqb7+gqzoU0obyvU2ey569fv13wcL8MstD\nxFqo\r\n=uMOX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGAHs1KLl+7sQkLC58KpAKs3E7oHbsXzDIwzh5lTzNW7AiBGdY0nXAojD9B3fuI8ghoe4hZu3Zzy/jmYjdQxT/phlQ=="}]},"maintainers":[{"name":"aeres-blade","email":"contact@aeres.games"}],"_npmUser":{"name":"aeres-blade","email":"contact@aeres.games"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/validator_1.2.0_1557521851304_0.019776448512592415"},"_hasShrinkwrap":false},"1.3.0":{"name":"@aeres-games/validator","version":"1.3.0","description":"A JS data validator","main":"dist/Validator.js","scripts":{"build":"tsc --declaration","watch":"tsc --watch","clean-build":"rimraf ./dist && tsc --declaration","test":"mocha --require ts-node/register tests/**/*.test.ts"},"repository":{"type":"git","url":"git+https://github.com/Aeres-Games/validator.git"},"keywords":["js","typescript","data","validation"],"author":{"name":"Matthieu 'Aeres-Blade' Arques","email":"aeresblade@aeres.games"},"license":"MIT","bugs":{"url":"https://github.com/Aeres-Games/validator/issues"},"homepage":"https://github.com/Aeres-Games/validator#readme","devDependencies":{"@types/chai":"^4.1.7","@types/mocha":"^5.2.6","@types/node":"^12.0.0","chai":"^4.2.0","mocha":"^6.1.4","rimraf":"^2.6.3","ts-node":"^8.1.0","typescript":"^3.4.5"},"gitHead":"fc1ee0f2b496296a5090e9ca4cf29d71cc6a2599","_id":"@aeres-games/validator@1.3.0","_nodeVersion":"10.12.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-SiE/pEW3D17ZWbAn8C/ybQnTd/wB0msSVeuw57etrcj86iCBo/CNVa/BqZqCIgdxYGGkWXN7yCKt7jiByssuwA==","shasum":"4c459a04d8a35c4192e75c7aca1e053ba4217aa5","tarball":"https://registry.npmjs.org/@aeres-games/validator/-/validator-1.3.0.tgz","fileCount":23,"unpackedSize":19339,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc1rchCRA9TVsSAnZWagAARBAQAIUA5QSRYnE/vMLrm1f1\nI+SW1r8wpUWUPA02cvbM4+xeW1tyLBX2Mp4CZbFyjAgx7jH4EZa3/qTNCCzH\nNRK3BpAufY1YJqD2cIsfEjy4/0hujJcvS4AnWrlzX2Fez7sSmuLENXAUtn+u\nP2mqL1QvLmPQnygR6HJwoJ1bNtxD+/9sQ/fWAgCaiy2REEZ8++PnqmvPAmnE\n0gmNuRUW+dvgJGJ4HiKWbho4cHM6eakH3rSgfUdc5/Fj0lMko+1OE72NUKBS\nqejhiECO8BSClv21eyRbrYUH7e0fgTNMHLJHk6CFTX/S2iQzjGbICPAwLvVM\nBYCsyGlfBM4FmpIHBzGXUzbzrBTNLWkmycBaOWBxJFfBCBBr3Exgw76sFzPh\nPj2apUeCAsAdgS4usaYJZ7NJlYQXKImEB2xE6MJRMxx5J5ySc1RpO3tEhyXk\nCjaep1VezNtrIbvXCJpq6jYz6rv0xfZOwYX1b1nxw/S0KhqzdB4BsJi+eDOe\n/Yhpi5fp+hmbAGoLmx0nAgdtRvIznvAlhVumkopDo4njiD/e04PrVWl/E4bs\n6kT0aZZUmQhT7thF2ksp1IZTr4Vht29i6Lg2jARCB4mrk2jGpkWuEMl4c9FG\nHi5nUIh9AfU11qmFOSUmTBG873MhPL5VB9k/GwujWZLPr+tyQbyjxSM9oeHt\nSkdh\r\n=bb70\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAnYG0lBpx/A4SbTDLut0Dek3dQWXuMXrsIFAR2Gf5VRAiA/RP3naiqmxbZ3N9Ohz7ssK04EG5grgm2MAJ5lghqKgg=="}]},"maintainers":[{"name":"aeres-blade","email":"contact@aeres.games"}],"_npmUser":{"name":"aeres-blade","email":"contact@aeres.games"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/validator_1.3.0_1557575456325_0.537126674122387"},"_hasShrinkwrap":false},"1.3.1":{"name":"@aeres-games/validator","version":"1.3.1","description":"A JS data validator","main":"dist/Validator.js","scripts":{"build":"tsc --declaration","watch":"tsc --watch","clean-build":"rimraf ./dist && tsc --declaration","test":"mocha --require ts-node/register tests/**/*.test.ts"},"repository":{"type":"git","url":"git+https://github.com/Aeres-Games/validator.git"},"keywords":["js","typescript","data","validation"],"author":{"name":"Matthieu 'Aeres-Blade' Arques","email":"aeresblade@aeres.games"},"license":"MIT","bugs":{"url":"https://github.com/Aeres-Games/validator/issues"},"homepage":"https://github.com/Aeres-Games/validator#readme","devDependencies":{"@types/chai":"^4.1.7","@types/mocha":"^5.2.6","@types/node":"^12.0.0","chai":"^4.2.0","mocha":"^6.1.4","rimraf":"^2.6.3","ts-node":"^8.1.0","typescript":"^3.4.5"},"gitHead":"886e1e98a8a83032d111047c829ec518795d4971","_id":"@aeres-games/validator@1.3.1","_nodeVersion":"10.12.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-v1HUqTb8m3Bn7U3Du/DmEmtImi2dwA9TOY3Dw4kLN7hmTL1q6Ci6062ciobTZAcTf6/UYgH0UzQmsT68nPg9kg==","shasum":"09c7ba029e48683892760bcb02761595d8c60547","tarball":"https://registry.npmjs.org/@aeres-games/validator/-/validator-1.3.1.tgz","fileCount":23,"unpackedSize":19573,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc1rjSCRA9TVsSAnZWagAAyncP/R7x35UvOt8TFR+x7DGm\nvZ2YhLCDqSkMu6m24FqHEBrKxp+MV1eeU/x4SsnuRnxYReKxHyYJkM6vy9Zb\nY9NMVYA+rmsia2bpKDvtUnwf2VpTmAnLP7rum8RPrnz6kS8+YyYBQvQdrtUv\nX5luHV9pmscN+/HqfCWwE4Vvm99OsIyu/TyRI6D5QZKNQDlnNNwi3EgCGz52\nZU46exT5m3OLuSyZlj6wRKw/5y02mV/hXUwhaEKmZd7CvR/nvQ7ctyWljGIP\nbD8jUW/7JZ1KOvcG+dbSc/25ewmCPEV8+eOq2sbHgveMZA+fGXyO6arD47yc\nu9CUmniLe6hh/4M/vBeXHfV3ogDaLYeeYmgkv7xG4cjOxwfubUPufAx3tU4f\nU1D2hTlnkHXOf8FyQdrCv+KCfxb2mv3zidQY9dBxAu6xd5OjOGwB64Yds2Qm\nsVEXD0N1ngquHB+h1gvLwtvgPBfzgtvFLjzgDTwpxEQErXAFSKML5DK407ZM\nsU2nt3gmJWqQwkS5tctHuM3WAGQg1cTTPSDJqzJFv7kgvpcKn3CEwGPPgzXo\nSblHsVJk7ZYt1gejheoa1F2Z3phFaT1gR68NWNnjZvlExluog8cavfkVMGiR\nvy/iTRx7cx/Vd9T8IKAbphvNUESM8cM7DfKSJ8WcYBAh1FMGpGACgc+fhG5V\nPa2b\r\n=FxlC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDAEkFDUjL4mJNGEZYNT91RtCYCGU1qdY7YbT+9+vVNkgIhALNOUKeUD5MwthQY2ZxBoCK4d2TS/kAaOv5SxoTADxpP"}]},"maintainers":[{"name":"aeres-blade","email":"contact@aeres.games"}],"_npmUser":{"name":"aeres-blade","email":"contact@aeres.games"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/validator_1.3.1_1557575890473_0.6343907693406068"},"_hasShrinkwrap":false}},"time":{"created":"2019-05-09T15:56:35.811Z","1.0.0":"2019-05-09T15:56:36.098Z","modified":"2022-04-04T11:48:20.907Z","1.1.0":"2019-05-09T20:45:17.100Z","1.2.0":"2019-05-10T20:57:31.481Z","1.3.0":"2019-05-11T11:50:56.451Z","1.3.1":"2019-05-11T11:58:10.584Z"},"maintainers":[{"email":"raisenku@sourcegem.com","name":"raisenku"},{"email":"aeresblade@sourcegem.com","name":"aeres-blade"}],"description":"A JS data validator","homepage":"https://github.com/Aeres-Games/validator#readme","keywords":["js","typescript","data","validation"],"repository":{"type":"git","url":"git+https://github.com/Aeres-Games/validator.git"},"author":{"name":"Matthieu 'Aeres-Blade' Arques","email":"aeresblade@aeres.games"},"bugs":{"url":"https://github.com/Aeres-Games/validator/issues"},"license":"MIT","readme":"# Aeres Games Validator\r\nA JS data validator\r\n\r\n## Installing\r\n```\r\nnpm install @aeres-games/validator\r\n```\r\n\r\n## Usage\r\nHere is a JS usage guide of this library.  \r\nPlease note that this library is developed using Typescript and that the ts declaration files are available in the npm package.\r\n\r\nCreate a Validator instance with a Rule tree\r\n```javascript\r\nconst Validator = require('@aeres-games/validator');\r\n\r\nlet validator = new Validator.Validator(new Validator.ObjectRule({\r\n\tfoo: new Validator.BooleanRule(),\r\n\tbar: new Validator.NumberRule({min: 0, max: 20})\r\n}));\r\n```\r\n\r\nThen use the validate method :\r\n```javascript\r\nlet errors = validator.validate({bar: -20});\r\n// errors is an array of validation errors (objects with a message string and a position string array)\r\n\r\nconsole.log(errors);\r\n// Should output something like :\r\n// [ {message: 'Object must have a property named foo', position: []}, {message: 'Number must not be less than 0', position: ['bar']} ]\r\n```\r\n\r\nYou can also configure the Validator to throw a Validator.ValidationError when a validation error occurs instead of returning an array of errors\r\n```javascript\r\nconst Validator = require('@aeres-games/validator');\r\n\r\nlet validator = new Validator.Validator(new Validator.BooleanRule(), {throw: true});\r\nvalidator.validate('this is not a boolean');\r\n// Throws a ValidationError with the list of errors as the message\r\n```\r\n\r\n## Rule classes\r\nEach Rule class has a validate() method which takes the data to validate as a parameter and returns an array of validation errors ({message: '...', position: ['prop', 'subprop']}).  \r\nYou can create your own validations rules as long as you define this method (implement the Validator.IRule interface if you are using Typescript). Check out the source code of existing Rules for more information.  \r\nBelow is the list of built-in validation rules.\r\n\r\n### ObjectRule\r\nUsed to validate an object. Takes a structure as a constructor parameter which must be an object with either a Rule or a set of rule + options :\r\n```javascript\r\nlet rule = new Validator.ObjectRule({\r\n\tfoo: new Validator.BooleanRule(),\r\n\tbar: {rule: new Validator.BooleanRule(), options: {optional: true}}\r\n});\r\n```\r\nValid options : \r\n* optional (boolean) : Wether the element can be omitted or not (default false)\r\n\r\n### ArrayRule\r\nUsed to validate an array. Takes a subrule as a constructor parameter that will be used to validate array elements :\r\n```javascript\r\nlet rule = new Validator.ArrayRule(new Validator.BooleanRule());\r\nlet errors = rule.validate([true, false]); // All good\r\n```\r\nIt can also take an options object as a second constructor parameter.  \r\nValid options: \r\n* minSize (number) : The minimum size of the array (default none)\r\n* maxSize (number) : The maximum size of the array (default none)\r\n\r\n### BooleanRule\r\nUsed to validate a boolean. Can take an options object as a constructor parameter.  \r\nValid options : \r\n* nullable (boolean) : Wether the value can be null or not (default false)\r\n\r\n### StringRule\r\nUsed to validate a string. Can take an options object as a constructor parameter.  \r\nValid options : \r\n* nullable (boolean) : Wether the value can be null or not (default false)\r\n* minLength (number) : The minimum length of the string (default none)\r\n* maxLength (number) : The maximum length of the string (default none)\r\n* regex (RegExp) : A RegExp used to validate the string (default none)\r\n\r\n### NumberRule\r\nUsed to validate a number. Can take an options object as a constructor parameter.  \r\nValid options :\r\n* nullable (boolean) : Wether the value can be null or not (default false)\r\n* floating (boolean) : Wether the number can be floating or not (default false)\r\n* min (number) : The minimum value of the number (default none)\r\n* max (number) : The maximum value of the number (default none)\r\n\r\n### OrRule\r\nUsed to allow multiple values. Take a list of Rules or arrays of Rules as constructor parameters.\r\n\r\n### ArrayableRule\r\nData being validated can either match the subrule (passed as a constructor parameter) or be an array of elements that match the subrule.\r\n\r\n## License\r\nThis package is licensed under the [MIT license](https://opensource.org/licenses/MIT).  \r\nPlease see the LICENSE file for more informations.\r\n","readmeFilename":"README.md"}