{"_id":"occamsrazor-match","_rev":"12-46192aee59b55f589823d82dff634df0","name":"occamsrazor-match","description":"helper library for writing validators","dist-tags":{"latest":"4.1.1"},"versions":{"1.0.0":{"name":"occamsrazor-match","version":"1.0.0","description":"helper library for writing validators","main":"index.js","scripts":{"test":"mocha tests/**/*.js","watch":"npm run test -- -w","lint":"eslint --ext .js ./src ./tests","release:major":"npm-release major","release:minor":"npm-release minor","release:patch":"npm-release patch","precommit":"npm run lint","prepush":"npm run test"},"keywords":["duck typing","plugins","components","registry","adapters"],"repository":{"type":"git","url":"git+ssh://git@github.com/sithmel/occamsrazor-match.git"},"author":{"name":"Maurizio Lupo","email":"maurizio.lupo@gmail.com"},"license":"MIT","devDependencies":{"chai":"^1.10.0","eslint":"^1.10.3","husky":"^0.10.2","mocha":"^2.1.0","npm-release":"^1.0.0"},"dependencies":{},"gitHead":"c09db1146a00b87c10ada5998a6f75e680a84b6d","bugs":{"url":"https://github.com/sithmel/occamsrazor-match/issues"},"homepage":"https://github.com/sithmel/occamsrazor-match#readme","_id":"occamsrazor-match@1.0.0","_shasum":"9a5b7271604d9d027099e23ef31dba4bc0e57969","_from":".","_npmVersion":"3.8.3","_nodeVersion":"5.10.1","_npmUser":{"name":"sithmel","email":"maurizio.lupo@gmail.com"},"dist":{"shasum":"9a5b7271604d9d027099e23ef31dba4bc0e57969","tarball":"https://registry.npmjs.org/occamsrazor-match/-/occamsrazor-match-1.0.0.tgz","integrity":"sha512-IJEUbTeoExG6IfUM7E/yKrcxlD5ypzIC+43PW6sA3QihKlKcGjkbBwWNHxl0rQpGw8S/Oe40TJm03zqZhaXDPg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICT72Q/EnZgkNbZB/aa8ZKz+HDJKy16NAIxDolOp0XaqAiBq7qWU+K/BkVo3JVFcCdMqROuMqY+EyiwtHf8heHWWIw=="}]},"maintainers":[{"name":"sithmel","email":"maurizio.lupo@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/occamsrazor-match-1.0.0.tgz_1495662016607_0.3802220979705453"},"directories":{}},"2.0.0":{"name":"occamsrazor-match","version":"2.0.0","description":"helper library for writing validators","main":"index.js","scripts":{"test":"mocha tests/**/*.js","watch":"npm run test -- -w","lint":"eslint --ext .js ./src ./tests","release:major":"npm-release major","release:minor":"npm-release minor","release:patch":"npm-release patch","precommit":"npm run lint","prepush":"npm run test"},"keywords":["duck typing","plugins","components","registry","adapters"],"repository":{"type":"git","url":"git+ssh://git@github.com/sithmel/occamsrazor-match.git"},"author":{"name":"Maurizio Lupo","email":"maurizio.lupo@gmail.com"},"license":"MIT","devDependencies":{"chai":"^1.10.0","eslint":"^1.10.3","husky":"^0.10.2","mocha":"^2.1.0","npm-release":"^1.0.0"},"dependencies":{},"gitHead":"dd641d472d889c0ce63e115573c8898f594d5b8e","bugs":{"url":"https://github.com/sithmel/occamsrazor-match/issues"},"homepage":"https://github.com/sithmel/occamsrazor-match#readme","_id":"occamsrazor-match@2.0.0","_shasum":"c2f9c4efb08f4faac2f515dd9658cff1002dfa08","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.8.1","_npmUser":{"name":"sithmel","email":"maurizio.lupo@gmail.com"},"dist":{"shasum":"c2f9c4efb08f4faac2f515dd9658cff1002dfa08","tarball":"https://registry.npmjs.org/occamsrazor-match/-/occamsrazor-match-2.0.0.tgz","integrity":"sha512-UuQZP2WsRWEZoz7vnvPPgPt9du2P0u5OjsRqlyGaNkriOzk8vIc9EjVgoRF1tfSRmDRzsU3OlVG1LuN7ZLFIVg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBKaD7E+heskr/3yLYnkjZcZnBH9l+S9I7yhGddSPBErAiBEFIirj10TRByU+PKdLMIwHwdRtKZrnuyRNo5HMrcZ4g=="}]},"maintainers":[{"name":"sithmel","email":"maurizio.lupo@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/occamsrazor-match-2.0.0.tgz_1495832102543_0.3058082931675017"},"directories":{}},"2.1.0":{"name":"occamsrazor-match","version":"2.1.0","description":"helper library for writing validators","main":"index.js","scripts":{"test":"mocha tests/**/*.js","watch":"npm run test -- -w","lint":"eslint --ext .js ./src ./tests","release:major":"npm-release major","release:minor":"npm-release minor","release:patch":"npm-release patch","precommit":"npm run lint","prepush":"npm run test"},"keywords":["duck typing","plugins","components","registry","adapters"],"repository":{"type":"git","url":"git+ssh://git@github.com/sithmel/occamsrazor-match.git"},"author":{"name":"Maurizio Lupo","email":"maurizio.lupo@gmail.com"},"license":"MIT","devDependencies":{"chai":"^1.10.0","eslint":"^1.10.3","husky":"^0.10.2","mocha":"^2.1.0","npm-release":"^1.0.0"},"dependencies":{},"gitHead":"3a375730301158142c8e78674f407b51264a88dc","bugs":{"url":"https://github.com/sithmel/occamsrazor-match/issues"},"homepage":"https://github.com/sithmel/occamsrazor-match#readme","_id":"occamsrazor-match@2.1.0","_shasum":"a3dbfb71f68d58a6a1012b72beaba30a823e52e3","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.8.1","_npmUser":{"name":"sithmel","email":"maurizio.lupo@gmail.com"},"dist":{"shasum":"a3dbfb71f68d58a6a1012b72beaba30a823e52e3","tarball":"https://registry.npmjs.org/occamsrazor-match/-/occamsrazor-match-2.1.0.tgz","integrity":"sha512-L+qSEMwppnIClPa7HYZRm9ti824mKoJMuxCThGu1TxncEKVk+XxjplZ6MwAxV3ElztHBtNkXQ+tm6WeRtGF7vQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGOaNALWggkptWXDN4YpcBvGzO2X6WLd2pBimLCI/XQvAiAcQduY0J/CVZk4L3JcP7KCp5WzH7/Cc2v6k+nDWSWWfA=="}]},"maintainers":[{"name":"sithmel","email":"maurizio.lupo@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/occamsrazor-match-2.1.0.tgz_1496695448372_0.38445083191618323"},"directories":{}},"2.1.1":{"name":"occamsrazor-match","version":"2.1.1","description":"helper library for writing validators","main":"index.js","scripts":{"test":"mocha tests/**/*.js","watch":"npm run test -- -w","lint":"eslint --ext .js ./src ./tests","release:major":"npm-release major","release:minor":"npm-release minor","release:patch":"npm-release patch","precommit":"npm run lint","prepush":"npm run test"},"keywords":["duck typing","plugins","components","registry","adapters"],"repository":{"type":"git","url":"git+ssh://git@github.com/sithmel/occamsrazor-match.git"},"author":{"name":"Maurizio Lupo","email":"maurizio.lupo@gmail.com"},"license":"MIT","devDependencies":{"chai":"^1.10.0","eslint":"^1.10.3","husky":"^0.10.2","mocha":"^2.1.0","npm-release":"^1.0.0"},"dependencies":{},"gitHead":"84b9aea77fe471eac8678520d6e44e73321826b2","bugs":{"url":"https://github.com/sithmel/occamsrazor-match/issues"},"homepage":"https://github.com/sithmel/occamsrazor-match#readme","_id":"occamsrazor-match@2.1.1","_shasum":"c22c41572453eeaf64c15a4677be9e1198d752aa","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.8.1","_npmUser":{"name":"sithmel","email":"maurizio.lupo@gmail.com"},"dist":{"shasum":"c22c41572453eeaf64c15a4677be9e1198d752aa","tarball":"https://registry.npmjs.org/occamsrazor-match/-/occamsrazor-match-2.1.1.tgz","integrity":"sha512-UaGKgEwRvhNayJKiMcwZANpcf9cEgwE/9N/jm890LdiAR5vW8AsD7ce7gMUUa9Buz9iyRAHNCxmyYij/btlL4Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICFWOrtNbZ9+M3sCmQGw2fTvBWm2ahT0CvKSdw970/DIAiEA7gsrZ6XHW9Xn7ad6TYivJjm+69iuC47Mo58LNpwZ0nM="}]},"maintainers":[{"name":"sithmel","email":"maurizio.lupo@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/occamsrazor-match-2.1.1.tgz_1496698321362_0.11605901038274169"},"directories":{}},"2.2.0":{"name":"occamsrazor-match","version":"2.2.0","description":"helper library for writing validators","main":"index.js","scripts":{"test":"mocha tests/**/*.js","watch":"npm run test -- -w","lint":"eslint --ext .js ./src ./tests","release:major":"npm-release major","release:minor":"npm-release minor","release:patch":"npm-release patch","precommit":"npm run lint","prepush":"npm run test"},"keywords":["duck typing","plugins","components","registry","adapters"],"repository":{"type":"git","url":"git+ssh://git@github.com/sithmel/occamsrazor-match.git"},"author":{"name":"Maurizio Lupo","email":"maurizio.lupo@gmail.com"},"license":"MIT","devDependencies":{"chai":"^1.10.0","eslint":"^1.10.3","husky":"^0.10.2","mocha":"^2.1.0","npm-release":"^1.0.0"},"dependencies":{},"gitHead":"bf937c522ba9e37b26ac418440d44320ca36e506","bugs":{"url":"https://github.com/sithmel/occamsrazor-match/issues"},"homepage":"https://github.com/sithmel/occamsrazor-match#readme","_id":"occamsrazor-match@2.2.0","_shasum":"b6c53384d0226e97b4560e3a5faa7900a92903bd","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.8.1","_npmUser":{"name":"sithmel","email":"maurizio.lupo@gmail.com"},"dist":{"shasum":"b6c53384d0226e97b4560e3a5faa7900a92903bd","tarball":"https://registry.npmjs.org/occamsrazor-match/-/occamsrazor-match-2.2.0.tgz","integrity":"sha512-79mUwzw/ffFFcWeGVN+ddLzqxjptnVB21laDcdaWKlmRDh69FJJE4zPsVTwshJDX3CaDnWa2RkYeGo0p6iDKsg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDTsMj+GauDVBWPx60EcfAR+OibnjbVWGN+cKZE4A9pegIgXYDkqT+nijlJkejahSwPZWm73L2URAQ1HNG49/HYJRY="}]},"maintainers":[{"name":"sithmel","email":"maurizio.lupo@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/occamsrazor-match-2.2.0.tgz_1497905324922_0.8141542251687497"},"directories":{}},"2.2.1":{"name":"occamsrazor-match","version":"2.2.1","description":"helper library for writing validators","main":"index.js","scripts":{"test":"mocha tests/**/*.js","watch":"npm run test -- -w","lint":"eslint --ext .js ./src ./tests","release:major":"npm-release major","release:minor":"npm-release minor","release:patch":"npm-release patch","precommit":"npm run lint","prepush":"npm run test"},"keywords":["duck typing","plugins","components","registry","adapters"],"repository":{"type":"git","url":"git+ssh://git@github.com/sithmel/occamsrazor-match.git"},"author":{"name":"Maurizio Lupo","email":"maurizio.lupo@gmail.com"},"license":"MIT","devDependencies":{"chai":"^1.10.0","eslint":"^1.10.3","husky":"^0.10.2","mocha":"^2.1.0","npm-release":"^1.0.0"},"dependencies":{},"gitHead":"e961db862ffe9fc08ea8cdd8b68909f754e1984e","bugs":{"url":"https://github.com/sithmel/occamsrazor-match/issues"},"homepage":"https://github.com/sithmel/occamsrazor-match#readme","_id":"occamsrazor-match@2.2.1","_shasum":"28b1481ae8c48dabe9df10dc9581f23ed3e1971d","_from":".","_npmVersion":"3.8.3","_nodeVersion":"5.10.1","_npmUser":{"name":"sithmel","email":"maurizio.lupo@gmail.com"},"dist":{"shasum":"28b1481ae8c48dabe9df10dc9581f23ed3e1971d","tarball":"https://registry.npmjs.org/occamsrazor-match/-/occamsrazor-match-2.2.1.tgz","integrity":"sha512-9AXHvkMypqLTW5be5KnohIE62yphtGqfpqhFsHz2LWoAK2P0oPnrMu7yMXxYLGL+ZVFa3EpwANoAkKLhAzaGKw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBHqONFFsU4fba3DsskkjAETI+18xQGo44Vx34EbYA8oAiEAnXv3IFyZxBSXtOQIj6PLxUsmpz3rZH4uSWSTWXaXbLw="}]},"maintainers":[{"name":"sithmel","email":"maurizio.lupo@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/occamsrazor-match-2.2.1.tgz_1498210776092_0.8240478737279773"},"directories":{}},"3.0.0":{"name":"occamsrazor-match","version":"3.0.0","description":"helper library for writing validators","main":"index.js","scripts":{"test":"mocha tests/**/*.js","watch":"npm run test -- -w","lint":"eslint --ext .js ./src ./tests","release:major":"npm-release major","release:minor":"npm-release minor","release:patch":"npm-release patch","precommit":"npm run lint","prepush":"npm run test"},"keywords":["duck typing","plugins","components","registry","adapters"],"repository":{"type":"git","url":"git+ssh://git@github.com/sithmel/occamsrazor-match.git"},"author":{"name":"Maurizio Lupo","email":"maurizio.lupo@gmail.com"},"license":"MIT","devDependencies":{"chai":"^1.10.0","eslint":"^1.10.3","husky":"^0.10.2","mocha":"^2.1.0","npm-release":"^1.0.0"},"dependencies":{},"gitHead":"c7965824ae850d41c18aa25a302a29527433f0ca","bugs":{"url":"https://github.com/sithmel/occamsrazor-match/issues"},"homepage":"https://github.com/sithmel/occamsrazor-match#readme","_id":"occamsrazor-match@3.0.0","_shasum":"611b48a05c9b8ef3c1f60726003c0044d868ebb3","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.8.1","_npmUser":{"name":"sithmel","email":"maurizio.lupo@gmail.com"},"dist":{"shasum":"611b48a05c9b8ef3c1f60726003c0044d868ebb3","tarball":"https://registry.npmjs.org/occamsrazor-match/-/occamsrazor-match-3.0.0.tgz","integrity":"sha512-q2j4WQ/8eSjcWV5tWh/zCuWfdgk3nrPkZp5FT+6ZAOKVxawyAatK02TFMv9qiQiJDoD9iUzxbdjpZPz39r5r6w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFBdQ3RQZIwwbqfe58yibBIMU7pdYwVZf/ZbsdxnEGQOAiEAnff62DQBuqbxWWhKFdI2no9kjn7wji2zvuFm5qemfc8="}]},"maintainers":[{"name":"sithmel","email":"maurizio.lupo@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/occamsrazor-match-3.0.0.tgz_1498344961321_0.8387593172956258"},"directories":{}},"4.0.0":{"name":"occamsrazor-match","version":"4.0.0","description":"helper library for writing validators","main":"index.js","scripts":{"test":"mocha tests/**/*.js","watch":"npm run test -- -w","lint":"eslint --ext .js ./src ./tests","release:major":"npm-release major","release:minor":"npm-release minor","release:patch":"npm-release patch","precommit":"npm run lint","prepush":"npm run test"},"keywords":["duck typing","plugins","components","registry","adapters"],"repository":{"type":"git","url":"git+ssh://git@github.com/sithmel/occamsrazor-match.git"},"author":{"name":"Maurizio Lupo","email":"maurizio.lupo@gmail.com"},"license":"MIT","devDependencies":{"chai":"^1.10.0","eslint":"^1.10.3","husky":"^0.10.2","mocha":"^2.1.0","npm-release":"^1.0.0"},"dependencies":{},"gitHead":"bc3b2955954cbe211f7ab96ea3769a3c1c96ce3a","bugs":{"url":"https://github.com/sithmel/occamsrazor-match/issues"},"homepage":"https://github.com/sithmel/occamsrazor-match#readme","_id":"occamsrazor-match@4.0.0","_shasum":"ec0f33a6f9d982c31be9c502f48900e69004212c","_from":".","_npmVersion":"3.8.3","_nodeVersion":"5.10.1","_npmUser":{"name":"sithmel","email":"maurizio.lupo@gmail.com"},"dist":{"shasum":"ec0f33a6f9d982c31be9c502f48900e69004212c","tarball":"https://registry.npmjs.org/occamsrazor-match/-/occamsrazor-match-4.0.0.tgz","integrity":"sha512-Ymz/soWepzZxtyDUSXSkhvCk9r8ApNcsruUVV30cTaPBpi2E0RZGksueh+Prv7QGNoi6TQwpyaeC0s9x9wiCdg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBsCPmjDcct/SxSa/Qms3gFU9HV40sAA5X+Dvp/pjdCrAiAJsH70kRzN+QXG29Ep6+PFVoWPr0gUwQJmx3SWFvVBkw=="}]},"maintainers":[{"name":"sithmel","email":"maurizio.lupo@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/occamsrazor-match-4.0.0.tgz_1498590723168_0.1951000199187547"},"directories":{}},"4.1.0":{"name":"occamsrazor-match","version":"4.1.0","description":"helper library for writing validators","main":"index.js","scripts":{"test":"mocha tests/**/*.js","watch":"npm run test -- -w","lint":"eslint --ext .js ./src ./tests","release:major":"npm-release major","release:minor":"npm-release minor","release:patch":"npm-release patch","precommit":"npm run lint","prepush":"npm run test"},"keywords":["duck typing","plugins","components","registry","adapters"],"repository":{"type":"git","url":"git+ssh://git@github.com/sithmel/occamsrazor-match.git"},"author":{"name":"Maurizio Lupo","email":"maurizio.lupo@gmail.com"},"license":"MIT","devDependencies":{"chai":"^1.10.0","eslint":"^1.10.3","husky":"^0.10.2","mocha":"^2.1.0","npm-release":"^1.0.0"},"dependencies":{},"gitHead":"7992fc0ee29f2c2cf2c15b92d940690d14eaadc9","bugs":{"url":"https://github.com/sithmel/occamsrazor-match/issues"},"homepage":"https://github.com/sithmel/occamsrazor-match#readme","_id":"occamsrazor-match@4.1.0","_shasum":"616bea331f10012aa97875871953d7ef934e4ede","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.8.1","_npmUser":{"name":"sithmel","email":"maurizio.lupo@gmail.com"},"dist":{"shasum":"616bea331f10012aa97875871953d7ef934e4ede","tarball":"https://registry.npmjs.org/occamsrazor-match/-/occamsrazor-match-4.1.0.tgz","integrity":"sha512-jNT2ngHgcDJWNqrWQRmAPRoehiq4OrEHLKPc7XVw7wb2QT4QlMO0seHWvYOxoVgVLyBF2mS30cYDxfMPkClaNQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFxbXbUv907+OgYDUTDwaybRejODdrPpSZeur7nn8yLiAiEAiR4bW2Z/XpZ29bQvzbgCVxKk7Qi4H+L7rohdxQs4ZHQ="}]},"maintainers":[{"name":"sithmel","email":"maurizio.lupo@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/occamsrazor-match-4.1.0.tgz_1499985805661_0.3562765757087618"},"directories":{}},"4.1.1":{"name":"occamsrazor-match","version":"4.1.1","description":"helper library for writing validators","main":"index.js","scripts":{"test":"mocha","watch":"npm run test -- -w","lint":"eslint --fix ./lib ./extra ./test","precommit":"npm run lint","prepush":"npm run test"},"keywords":["duck typing","plugins","components","registry","adapters"],"repository":{"type":"git","url":"git+ssh://git@github.com/sithmel/occamsrazor-match.git"},"author":{"name":"Maurizio Lupo","email":"maurizio.lupo@gmail.com"},"license":"MIT","devDependencies":{"chai":"^4.2.0","eslint":"^6.7.2","eslint-config-standard":"^14.1.0","eslint-plugin-import":"^2.18.2","eslint-plugin-node":"^10.0.0","eslint-plugin-promise":"^4.2.1","eslint-plugin-standard":"^4.0.1","husky":"^3.1.0","mocha":"^6.2.2"},"dependencies":{},"gitHead":"9469dc5c752b0b15107b57654bfe6614dca82d7a","bugs":{"url":"https://github.com/sithmel/occamsrazor-match/issues"},"homepage":"https://github.com/sithmel/occamsrazor-match#readme","_id":"occamsrazor-match@4.1.1","_nodeVersion":"10.15.3","_npmVersion":"6.13.1","dist":{"integrity":"sha512-GxLxMAoK/5ooekfU2bMgW/2oBpuI0lkmJqbSdFvWCgs54b5acECfeRixUPgouEMWFwgOsBo5FSztEBzGgyxF8g==","shasum":"f63a5c4f3547c789092b14d39c954eec8573d894","tarball":"https://registry.npmjs.org/occamsrazor-match/-/occamsrazor-match-4.1.1.tgz","fileCount":36,"unpackedSize":42587,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd5lJTCRA9TVsSAnZWagAAf5AQAIxyufQJ0u9hBef9E2no\n8j1afJdo3VHtarcYh5EOUGEGbCv+XAjrnBF0oEtGu+MStSq0f7Zh2S+etaUU\nTkivfk3CyL72j8OnPsvsbEcpO1TVNu/cW/8G/bYcWtueUyH89neR8nHZG7YH\nwMlvkPSQB7gVNvkUZO/SGm0aFZYKMpRCkQbrVao+dE3sEqx2j09Lq24mQldR\nd+1NW7n2faTW0anzfwJrCPBUT2/J5yOz2/1Rhygrfgg4f7Vb+OmptWaRbS0E\nO84I8Xi3p9elC0GONALf7liycz15ovb+dOf+YVR5ploRF4IUNNDRr6XcaU5P\nmKiWeWXmvs8jgMRiAcUWciDphj91MqKl6/W2oUouVhpnJQcHDMEclw6EfZUz\nG0q3rK8PmK1SQNjjsMCz8owGvKNOqQK2uyILZ4JQ4LG7Jah9iwPJGobX3e02\n2+W0vkgrIzjtHkyMIlx4Imij6XWtcpskXeCHoJMePESxYgztxNQO800iB5Uu\nKZ015eYtnKtIOo+1MnLm7c2oefj3al+0NEViTaFUmn+1ZnMNs2bFX8kiGYWW\nigqVTu4EFaqh2pjvIlIb6GRm8j98keLk6xCVWt06LJPz0+uDgRB2yJ4ZEz9x\ngPX1EC5kildIJf6RKt6tZwQOobEIXe0UZ8N9R2junjY++ufHagm/HBkkez7m\nAgzm\r\n=YtGt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDxZhB52DJxzhgQP1DY/ad/HNIFqoXjL48LUudX5hyyvQIhAKXLjkY85C4lxbt/XcZERViypDA+U649yBXvWVxl4GzI"}]},"maintainers":[{"name":"sithmel","email":"maurizio.lupo@gmail.com"}],"_npmUser":{"name":"sithmel","email":"maurizio.lupo@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/occamsrazor-match_4.1.1_1575375443130_0.531101566815205"},"_hasShrinkwrap":false}},"readme":"occamsrazor-match\n=================\n[![Build Status](https://travis-ci.org/sithmel/occamsrazor-match.svg?branch=master)](https://travis-ci.org/sithmel/occamsrazor-match)\n\nThis is an helper library for writing validators.\n\nWhat is a  validators\n=====================\nA validator is a function. When it runs against an object, it returns true or false.\n```js\nvar isFive = function(o) {\n  return o === 5;\n}\n\nisFive(5); // true\nisFive(4); // false\n```\nWriting complex validators may be a bit verbose. This library helps you to write short yet expressive validators. It also takes care of assigning the function a sensible name, this can be very helpful for debugging. For example:\n```js\nmatch([1,'test']).name === 'array:[isNumber:1,isString:test]'\n```\n\nImporting the library\n=====================\nThis library contains a main helper called \"match\" and some extra ones.\n```js\nvar match = require('occamsrazor-match');\nvar has = require('occamsrazor-match/extra/has');\nvar isInstanceOf = require('occamsrazor-match/extra/isInstanceOf');\nvar isPrototypeOf = require('occamsrazor-match/extra/isPrototypeOf');\n\nvar not = require('occamsrazor-match/extra/not');\nvar or = require('occamsrazor-match/extra/or');\nvar and = require('occamsrazor-match/extra/and');\nvar some = require('occamsrazor-match/extra/some');\nvar every = require('occamsrazor-match/extra/every');\nvar someValues = require('occamsrazor-match/extra/someValues');\nvar everyValues = require('occamsrazor-match/extra/everyValues');\nvar greaterThan = require('occamsrazor-match/extra/greaterThan');\nvar lessThan = require('occamsrazor-match/extra/lessThan');\n\nvar isUndefined = require('occamsrazor-match/extra/isDefined');\nvar isDefined = require('occamsrazor-match/extra/isUndefined');\nvar isNumber = require('occamsrazor-match/extra/isNumber');\nvar isString = require('occamsrazor-match/extra/isString');\n```\n\nmatch\n=====\nThis is the main helper, and can be used to create a lot of different validators.\n\nThese ones matches the value in it.\n```js\nvar isFive = match(5);\nvar isNull = match(null);\nvar isTrue = match(true);\nvar isFalse = match(true);\nvar isHello = match('hello');\n```\n\nFor example:\n```js\nisHello('hello'); // true\nisFive(5); // true\n```\n\nUsing undefined you create a validator that matches any value.\n```js\nvar isAnything = match(undefined);\nisAnything(5);\nisAnything('hello');\nisAnything({ greeting: 'hello' });\n```\nTo match **undefined** there is an helper (isUndefined), explained below. Also if you wish to use a more explicit style, you can use the isAnything helper.\n\nUsing a regular expression, the validator will run that, on the value.\n```js\nvar doesMatch = match(/[0-9]+/);\ndoesMatch('123'); // true\n```\n\nPassing a function, the function itself will be returned:\n```js\nvar isLessThan5 = match(function (n) {\n  return n < 5;\n});\n\nisLessThan5(2); // true\nisLessThan5(8); // false\n```\nIt looks like there is no real reason to do it, this will make more sense in a bit.\n\nmatch - recursion\n-----------------\n\"match\" can take an array or an object and perform a nested validation:\n```js\nvar isPoint = match({ x : isNumber, y: isNumber });\nisPoint({ x: 1, y: 2 }); // true\nisPoint({ x: 1, y: 2, z: 3 }); // true\nisPoint({ x: 1, z: 3 }); // false\n```\nPassing values as undefined indicates that I don't really care about their value. Or if they are defined\n```js\nvar isPointOnXaxis = match({ x : 0, y: undefined });\nisPointOnXaxis({ x: 1, y: 2 }); // false\nisPointOnXaxis({ x: 0, y: 2 }); // true\nisPointOnXaxis({ x: 0 }); // true\n```\nValues will be interpreted as specified before so I can implement recursive validation:\n```js\nfunction isSalary(n) { return typeof n === 'number' && n > 0; }\n\nvar isEmployee = match({\n  name : /[A-Za-z]+/,\n  job: {\n    position: undefined,\n    salary: isSalary\n  }\n});\n```\n\nArrays are supported as well:\n```js\nvar startsWith123 = match([1, 2, 3]);\nstartsWith123([1, 2, 3, 4]); // true\nstartsWith123([2, 3, 4]); // false\n```\nIn Arrays the behaviour of undefined comes useful:\n```js\nvar thirdArgIsNumber = match([undefined, undefined, isNumber]);\nthirdArgIsNumber(['a', 'b', 3, 4]); // true\nthirdArgIsNumber(['a', 'b', 'c']); // false\n```\n\nhas\n===\nThis checks for the existence of a list of attributes:\n```js\nvar isPoint = has(['x', 'y']);\n```\n\nisInstanceOf\n=============\nIt checks if an object has been built with a specific factory function:\n```js\nvar isPoint = isInstanceOf(Point);\n```\n\nisPrototypeOf\n=============\nIt checks if an object is the prototype of another:\n```js\nvar isPoint = isPrototypeOf(Point.prototype);\n```\n\nnot\n===\nNegate the result of a validator. I can take either a function or the argument used for the match function.\n```js\nvar isNotAPoint = not(isPrototypeOf(Point.prototype));\nvar isNotFive = not(5);\n```\n\nand\n===\nA validator that returns true only if all validators passed as argument return true. Every validator passed is transformed into a function using \"match\".\n```js\nfunction isOdd(n) { return n % 2 !== 0; }\nfunction isInteger(n) { return n % 1 === 0; }\nfunction isSquares(n) { return isInteger(Math.sqrt(n)); }\nvar oddAndSquared = and([isOdd, isSquared]);\noddAndSquared(4); // false\noddAndSquared(9); // true\n```\n\nor\n==\nA validator that returns true if at least one validator passed as argument returns true. Every validator passed is transformed into a function using \"match\".\n```js\nvar is5or9 = or(5, 9);\nis5or9(5); // true\nis5or9(9); // true\nis5or9(3); // false\n```\n\nsome/every and someValues/everyValues\n=====================================\nsome/every validates arrays. It takes a validator as argument (it uses \"match\" behind the scene) and checks the array items against that validator. In the case of \"some\", at least a check should pass to return true. In the case of \"every\", all of them should pass.\n```js\nvar atLeastOne5 = some(5);\natLeastOne5([1, 2, 5]); // true\natLeastOne5([5, 5, 2]); // true\natLeastOne5([1, 2, 3]); // false\n```\n\n```js\nvar allNegatives = every(function isNegative(n) { return n < 0; });\nallNegatives([-1, -2, -5]); // true\nallNegatives([-5, 5, -2]); // false\n```\nsomeValues and everyValues do the same on all values of an object.\n\ngreaterThan, lessThan\n=====================\nThey are be useful to validate if a number is in a specific range.\n\nExample:\n```js\nvar isGreaterThan0 = greaterThan(0);\nisGreaterThan0(1); // true\nisGreaterThan0(-1); // false\n\nvar isValidDiscount = and(greaterThan(0), lessThan(100));\n```\n\nCommon validators\n=================\nThe library includes a series of very common validators:\n* isUndefined\n* isDefined\n* isString\n* isNumber\n* isAnything (always returns true)\n\nExample:\n```js\nvar isEmployee = match({\n  id: isDefined,\n  name: isString,\n  salary: isNumber,\n  title: or(isUndefined, 'mr', 'ms')\n});\n```\n\nCustom validator\n================\nA validator is a simple function that given a value returns true or false. You can build your own and use it together with the other functions:\n```js\nfunction isEven(n) {return o % 2 === 0;};\n\nmatch(isEven);\n\nor([isEven, match(null)]);\n\nmatch({\n  numberOfShoes: isEven\n});\n```\nNote: I have used a named function (not an anonymous function expression or an arrow function). It is important as logging and debugging rely entirely on the function name.\n\nMixing them up!\n===============\nBeing able to use functions, you can mix-up and reuse validators:\n```js\nvar isPoint = match({ x : undefined, y: undefined });\nvar isSquare = match([isPoint, isPoint, isPoint, isPoint]);\nvar isTriangle = match([isPoint, isPoint, isPoint]);\nvar containsSquareAndTriangle = {\n  triangle: isTriangle,\n  square: isSquare,\n  extra: or([isSquare, isTriangle])\n};\n```\n\nvalidator names\n===============\nHelpers provide always a descriptive name to the generated functions:\n```js\nmatch(true).name === 'isTrue'\nmatch(2).name === 'isNumber:2'\nmatch([1,'test']).name === 'array:[isNumber:1,isString:test]'\nhas('test1', 'test2').name === 'object:{test1:isAnything,test2:isAnything}'\n```\nThis can be very helpful for debugging.\n\nValidation errors\n=================\nThis feature can be useful to have some insight about what went wrong in the validation.\nWhen validating a value you can pass a function, as a second argument. This function is called whenever a validation step fail (only if it is relevant to the validation):\n```js\nvar validator = match({\n  user: {\n    name: /[a-zA-Z]+/,\n    jobtitle: or(['engineer', 'analyst'])\n  },\n  deleted: not(true)\n});\n\nvalidator({\n  user: {\n    name: 'Maurizio',\n    jobtitle: 'engineer'\n  },\n  deleted: true\n}, function (val) {\n  // val is an object containing:\n  {\n    path: path, // if this validation step is nested in an object or array\n    name: name, // name of the function\n    value: o // the value on which the validator ran\n  }  \n});\n```\nReturning:\n```js\n{ path: 'deleted', name: 'not(isTrue)', result: true, value: true }]);\n```\nIf you want to collect all this informations in an array you can use the validationErrors helper:\n```js\nvar validationErrors = require('occamsrazor-match/extra/validationErrors');\n...\nvar errors = validationErrors();\nvar validator = arrayOf(5);\nvalidator([5, 5], errors);\n\nconsole.log(errors()); // returns a list of all errors\n```\n\nValidate decorator\n==================\nA very common use case for validation is checking if the arguments of a function match a certain criteria. Because of this I have included a function decorator that checks the arguments of the decorated function and throws an error if they don't match:\n```js\nvar validate = require('occamsrazor-match/validate-decorators');\n\nvar sum = validate(isNumber, isNumber, isNumber)(function sum(a, b, c) {\n  return a + b + c;\n});\n```\nif supported you can use the succint es7 syntax:\n```js\n@validate(isNumber, isNumber, isNumber)\nfunction sum(a, b, c) {\n  return a + b + c;\n}\n```\nThe error object contains a description of all the things went wrong:\n```js\ntry {\n  var result = sum('1', 2, 3);\n} catch (e) {\n  console.log(e.message); // Function called with wrong arguments: array:[isNumber,isNumber,isNumber]\n  console.log(e.errors); // [{ path: [0], name: 'isNumber', value: '1' }]\n}\n```\n","maintainers":[{"name":"sithmel","email":"maurizio.lupo@gmail.com"}],"time":{"modified":"2022-06-22T18:14:07.839Z","created":"2017-05-24T21:40:18.153Z","1.0.0":"2017-05-24T21:40:18.153Z","2.0.0":"2017-05-26T20:55:03.416Z","2.1.0":"2017-06-05T20:44:09.410Z","2.1.1":"2017-06-05T21:32:02.297Z","2.2.0":"2017-06-19T20:48:46.032Z","2.2.1":"2017-06-23T09:39:37.096Z","3.0.0":"2017-06-24T22:56:02.413Z","4.0.0":"2017-06-27T19:12:04.228Z","4.1.0":"2017-07-13T22:43:26.747Z","4.1.1":"2019-12-03T12:17:23.284Z"},"homepage":"https://github.com/sithmel/occamsrazor-match#readme","keywords":["duck typing","plugins","components","registry","adapters"],"repository":{"type":"git","url":"git+ssh://git@github.com/sithmel/occamsrazor-match.git"},"author":{"name":"Maurizio Lupo","email":"maurizio.lupo@gmail.com"},"bugs":{"url":"https://github.com/sithmel/occamsrazor-match/issues"},"license":"MIT","readmeFilename":"README.md"}