{"_id":"the-thing-is","_rev":"26-3bd3d154eaa9facc73e196feede4aaf1","name":"the-thing-is","description":"Simple tool for doing complex object validation.","dist-tags":{"latest":"1.0.1"},"versions":{"0.0.0":{"name":"the-thing-is","version":"0.0.0","description":"Configuration drivin validation","main":"the-thing-is.js","scripts":{"test":"mocha -R spec test/the-thing-is.js"},"repository":{"type":"git","url":"git://github.com/mrDarcyMurphy/the-thing-is.git"},"keywords":["is-it","validation"],"author":{"name":"Mr. Darcy Murphy"},"license":"WTFPL","gitHead":"adb81e723ae719a2cc21f9a91103d5acd783f0fd","dependencies":{"is-it":"~1.0.3"},"_id":"the-thing-is@0.0.0","dist":{"shasum":"037b42d36b1c91ebd0bcb86f64ee44830c9ff318","tarball":"https://registry.npmjs.org/the-thing-is/-/the-thing-is-0.0.0.tgz","integrity":"sha512-LDYNRLCdrp3WxnUEwzB7fs90W42RT0CUgs0ooXEXbf7C8qr1DUzQIhTF8jKy4HEBt2J+UK4Lw156gTGnG83MwQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBfa3RtFgENYPqDFRo/oBiz1WFfG+hEm3P40m5RxZM4rAiEA7E99YzvAa0P58Z5U9XUMSpkozALhfb8P+GWmu9SKqDo="}]},"_from":".","_npmVersion":"1.2.18","_npmUser":{"name":"mrDarcyMurphy","email":"darcy.murphy@me.com"},"maintainers":[{"name":"mrDarcyMurphy","email":"darcy.murphy@me.com"}]},"0.1.0":{"name":"the-thing-is","version":"0.1.0","description":"Configuration drivin validation","main":"the-thing-is.js","scripts":{"test":"mocha -R spec test/the-thing-is.js"},"repository":{"type":"git","url":"git://github.com/mrDarcyMurphy/the-thing-is.git"},"keywords":["is-it","validation"],"author":{"name":"Mr. Darcy Murphy"},"license":"WTFPL","gitHead":"adb81e723ae719a2cc21f9a91103d5acd783f0fd","dependencies":{"is-it":"~1.0.3"},"bugs":{"url":"https://github.com/mrDarcyMurphy/the-thing-is/issues"},"homepage":"https://github.com/mrDarcyMurphy/the-thing-is","_id":"the-thing-is@0.1.0","dist":{"shasum":"0a3e8dd6e04e8cfe135101e9c515f83c7cfe455c","tarball":"https://registry.npmjs.org/the-thing-is/-/the-thing-is-0.1.0.tgz","integrity":"sha512-BMmEttNmuf7xpX/3+6JFZFAlNRNqXapQzmG+TzA9TBBU0ue736ex4ns3R+RaMQs7gIUBV0lR+lSQfY4ZwA2BQQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHyvILsFvG7JXWVWaz/oJtiUCSsWk7mJxG8+b1rIEEf8AiAOw/mUA42RjR+reXK406XDOoef8tXXjhqowVP9xN5Smw=="}]},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"mrdarcymurphy","email":"darcy.murphy@me.com"},"maintainers":[{"name":"mrdarcymurphy","email":"darcy.murphy@me.com"}]},"0.2.0":{"name":"the-thing-is","version":"0.2.0","description":"Configuration drivin validation","main":"the-thing-is.js","scripts":{"test":"mocha -R spec test/the-thing-is.js"},"repository":{"type":"git","url":"git://github.com/mrDarcyMurphy/the-thing-is.git"},"keywords":["is-it","validation"],"author":{"name":"Mr. Darcy Murphy"},"license":"WTFPL","gitHead":"adb81e723ae719a2cc21f9a91103d5acd783f0fd","dependencies":{"is-it":"~1.1.0"},"bugs":{"url":"https://github.com/mrDarcyMurphy/the-thing-is/issues"},"homepage":"https://github.com/mrDarcyMurphy/the-thing-is","_id":"the-thing-is@0.2.0","dist":{"shasum":"8a1d49f35cf60c9d5fc936819e36c6d9588bba4c","tarball":"https://registry.npmjs.org/the-thing-is/-/the-thing-is-0.2.0.tgz","integrity":"sha512-gZjhFgOyohovbHNpYSU1nquWviWBld2T7rCIPAxU3teewnCjjVyZsUrr9Udd+1hWK4BwC5Q+6Ap+qVx2igv5Gg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG7Jgx9hBAREgjI2tstxVNbGna4kZ84AzOP3/MLnQkkZAiEA+muVCszBFkhyO1PMPkf8ssvAQNiXtcCVIMIY2Wkr0ns="}]},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"mrdarcymurphy","email":"darcy.murphy@me.com"},"maintainers":[{"name":"mrdarcymurphy","email":"darcy.murphy@me.com"}]},"0.3.0":{"name":"the-thing-is","version":"0.3.0","description":"Configuration drivin validation","main":"the-thing-is.js","scripts":{"test":"mocha -R spec test/the-thing-is.js"},"repository":{"type":"git","url":"git://github.com/LoudBit/the-thing-is.git"},"keywords":["is-it","validation"],"author":{"name":"Mr. Darcy Murphy"},"license":"WTFPL","gitHead":"adb81e723ae719a2cc21f9a91103d5acd783f0fd","dependencies":{"is-too":"^2.0.0"},"bugs":{"url":"https://github.com/LoudBit/the-thing-is/issues"},"homepage":"https://github.com/LoudBit/the-thing-is","_id":"the-thing-is@0.3.0","dist":{"shasum":"e308a410a0ca601269f8b2bc3c9a64c9abb78278","tarball":"https://registry.npmjs.org/the-thing-is/-/the-thing-is-0.3.0.tgz","integrity":"sha512-jfQJx+4CyxRxBeQEX8oo8QDGsLaopwzu44PKkN4Ljipb1jpp5CKwUoWXE7UOyBZpO1XqjzpVRXP+RlD9vbo6yQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDJHib+7gI5gJe8g18qbmBHPe+W1lDOx7TWFinvQbg0GwIhAPcJYxG6B3E+EHQq7xxfGKVHwLW46mzoT4MJeClGSNYS"}]},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"loudbit","email":"darcy.murphy@loudbit.com"},"maintainers":[{"name":"mrdarcymurphy","email":"darcy.murphy@me.com"},{"name":"loudbit","email":"darcy.murphy@loudbit.com"}]},"0.4.0":{"name":"the-thing-is","version":"0.4.0","description":"Configuration drivin validation","main":"the-thing-is.js","scripts":{"test":"mocha -R spec"},"repository":{"type":"git","url":"git://github.com/LoudBit/the-thing-is.git"},"keywords":["is-it","validation"],"author":{"name":"Mr. Darcy Murphy"},"license":"WTFPL","gitHead":"adb81e723ae719a2cc21f9a91103d5acd783f0fd","dependencies":{"is-too":"^2.2.0"},"devDependencies":{"mocha":"^2.1.0"},"bugs":{"url":"https://github.com/LoudBit/the-thing-is/issues"},"homepage":"https://github.com/LoudBit/the-thing-is","_id":"the-thing-is@0.4.0","_shasum":"0d94bc0d5efc8017b9b9b61b34fd76afd74add33","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"mrdarcymurphy","email":"mrDarcyMurphy@gmail.com"},"maintainers":[{"name":"mrdarcymurphy","email":"darcy.murphy@me.com"},{"name":"loudbit","email":"darcy.murphy@loudbit.com"}],"dist":{"shasum":"0d94bc0d5efc8017b9b9b61b34fd76afd74add33","tarball":"https://registry.npmjs.org/the-thing-is/-/the-thing-is-0.4.0.tgz","integrity":"sha512-t92RwRcUyDLeVM3Z9dQWUHWIVjBTbLkwKoE4jYUvHBXQHyWn0lIlT7N7Rr8g4Lro8XivJEnnhhx69hJv/F39Fw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCNar+0Vo1z/N7rDqbv2lXZUafjWjslZpZS841WjrsjFgIgcHeB3bdvvGJEZLVBTFkS8nWhOMECP8osHGakY4YsICI="}]}},"0.4.1":{"name":"the-thing-is","version":"0.4.1","description":"Thoroughly measure subjects against a series of standards.","main":"the-thing-is.js","scripts":{"test":"mocha -R spec"},"repository":{"type":"git","url":"git://github.com/LoudBit/the-thing-is.git"},"keywords":["is-too","validation"],"author":{"name":"Mr. Darcy Murphy"},"license":"WTFPL","gitHead":"adb81e723ae719a2cc21f9a91103d5acd783f0fd","dependencies":{"is-too":"^2.2.0"},"devDependencies":{"mocha":"^2.1.0"},"bugs":{"url":"https://github.com/LoudBit/the-thing-is/issues"},"homepage":"https://github.com/LoudBit/the-thing-is","_id":"the-thing-is@0.4.1","_shasum":"0c0d09eb747a02c4bd974e13437d85610104dc67","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"mrdarcymurphy","email":"mrDarcyMurphy@gmail.com"},"maintainers":[{"name":"mrdarcymurphy","email":"darcy.murphy@me.com"},{"name":"loudbit","email":"darcy.murphy@loudbit.com"}],"dist":{"shasum":"0c0d09eb747a02c4bd974e13437d85610104dc67","tarball":"https://registry.npmjs.org/the-thing-is/-/the-thing-is-0.4.1.tgz","integrity":"sha512-0lrfiUZFDnZHRzRofeSISmSybJA7BhE8tFJrZIk1HLd7lDNYkFJiRC01lk4u/LNnZKFjev2p5z3pijGlTdDjxw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDvJi6kfvnQKaZjeHMXfSAkJaJ/bHb24UVL/8BdD+U5hAiALs6CrCWSWpuqCrHSjXzPfsiJBDe5fH2rAK5m5ckIZaQ=="}]}},"0.4.2":{"name":"the-thing-is","version":"0.4.2","description":"Thoroughly measure subjects against a series of standards.","main":"the-thing-is.js","scripts":{"test":"mocha -R spec"},"repository":{"type":"git","url":"git://github.com/LoudBit/the-thing-is.git"},"keywords":["is-too","validation"],"author":{"name":"Mr. Darcy Murphy"},"license":"MIT","gitHead":"adb81e723ae719a2cc21f9a91103d5acd783f0fd","dependencies":{"is-too":"2.3.0"},"devDependencies":{"mocha":"^2.1.0"},"bugs":{"url":"https://github.com/LoudBit/the-thing-is/issues"},"homepage":"https://github.com/LoudBit/the-thing-is","_id":"the-thing-is@0.4.2","_shasum":"747e03ef4d7366e8f78e180a83f91de4f618b3fa","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"mrdarcymurphy","email":"mrDarcyMurphy@gmail.com"},"maintainers":[{"name":"mrdarcymurphy","email":"darcy.murphy@me.com"},{"name":"loudbit","email":"darcy.murphy@loudbit.com"}],"dist":{"shasum":"747e03ef4d7366e8f78e180a83f91de4f618b3fa","tarball":"https://registry.npmjs.org/the-thing-is/-/the-thing-is-0.4.2.tgz","integrity":"sha512-sOLtZxl74mBvjJF5AD3wb/6C2PnxxkwyA+K67PlPhi1c5ntqt7axViNLTmyeX23gv5qF6IATCyfpQFukoUuSJg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFAEpl10NKFkgnlRsEfIYTFM7UcKxGpF4XidRacN6iV2AiA0zMI1o4lABRxF6QvPtw5Bv1sgVdZrHWlAMKMZIoU8Kw=="}]}},"0.4.4":{"name":"the-thing-is","version":"0.4.4","description":"Thoroughly measure subjects against a series of standards.","main":"the-thing-is.js","scripts":{"test":"mocha -R spec"},"repository":{"type":"git","url":"git://github.com/LoudBit/the-thing-is.git"},"keywords":["is-too","validation"],"author":{"name":"Mr. Darcy Murphy"},"license":"MIT","gitHead":"adb81e723ae719a2cc21f9a91103d5acd783f0fd","dependencies":{"is-too":"~2.4.0"},"devDependencies":{"mocha":"^2.1.0"},"bugs":{"url":"https://github.com/LoudBit/the-thing-is/issues"},"homepage":"https://github.com/LoudBit/the-thing-is","_id":"the-thing-is@0.4.4","_shasum":"7e84c4125d89458d0864dfb8f1ad14361583c81a","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"mrdarcymurphy","email":"mrDarcyMurphy@gmail.com"},"maintainers":[{"name":"mrdarcymurphy","email":"darcy.murphy@me.com"},{"name":"loudbit","email":"darcy.murphy@loudbit.com"}],"dist":{"shasum":"7e84c4125d89458d0864dfb8f1ad14361583c81a","tarball":"https://registry.npmjs.org/the-thing-is/-/the-thing-is-0.4.4.tgz","integrity":"sha512-quWLXOkcaFSIy5nDNN+qLCQfZlnuHE2GfMfAH0CGbIZjltbsk59UIFU7cpdIBbko3QQ6CSk+7n4ZUdkV52ryQQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGbdJTwR0wSh3r2J0vlI9wRc1RZzoagVjuoP5cJSSHLwAiEAtStNrApEslxxcsVE6INm2M+0CMeC0UpOj6LhnJ2scY8="}]}},"0.5.0":{"name":"the-thing-is","version":"0.5.0","description":"Simple tool for doing complex object validation.","main":"the-thing-is.js","scripts":{"test":"mocha -R spec"},"repository":{"type":"git","url":"git://github.com/LoudBit/the-thing-is.git"},"keywords":["is-too","validation"],"author":{"name":"Mr. Darcy Murphy"},"license":"MIT","gitHead":"adb81e723ae719a2cc21f9a91103d5acd783f0fd","dependencies":{"is-too":"~2.4.0"},"devDependencies":{"mocha":"^2.1.0"},"bugs":{"url":"https://github.com/LoudBit/the-thing-is/issues"},"homepage":"https://github.com/LoudBit/the-thing-is","_id":"the-thing-is@0.5.0","_shasum":"a97a01210c0b1b491d1be191f82c64f920d9ecf0","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"mrdarcymurphy","email":"mrDarcyMurphy@gmail.com"},"maintainers":[{"name":"mrdarcymurphy","email":"darcy.murphy@me.com"},{"name":"loudbit","email":"darcy.murphy@loudbit.com"}],"dist":{"shasum":"a97a01210c0b1b491d1be191f82c64f920d9ecf0","tarball":"https://registry.npmjs.org/the-thing-is/-/the-thing-is-0.5.0.tgz","integrity":"sha512-1Jl5KDY4d9k5V5lNu+zlymUMROdlAYBUWWAC/H21CYFV0H7ea7yCgndFRA0wvbnnvhYaz0vURHG4ICoaG9/JMQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDZlg8cbAl4Mu7vPbJXU2nzcSkYF4LzQ8K2jzFqIWzKFgIhAK3J/hVoSKuma5buceBWi2ExhtFveizjZXuVQKwObejA"}]}},"0.6.0":{"name":"the-thing-is","version":"0.6.0","description":"Simple tool for doing complex object validation.","main":"the-thing-is.js","scripts":{"test":"mocha -R spec"},"repository":{"type":"git","url":"git://github.com/LoudBit/the-thing-is.git"},"keywords":["is-too","validation"],"author":{"name":"Mr. Darcy Murphy"},"license":"MIT","gitHead":"adb81e723ae719a2cc21f9a91103d5acd783f0fd","dependencies":{"is-too":"2.5.0"},"devDependencies":{"mocha":"^2.1.0"},"bugs":{"url":"https://github.com/LoudBit/the-thing-is/issues"},"homepage":"https://github.com/LoudBit/the-thing-is#readme","_id":"the-thing-is@0.6.0","_shasum":"b6d0f690410f1292414a0a2ca30cea546300a3f8","_from":".","_npmVersion":"3.5.3","_nodeVersion":"4.2.2","_npmUser":{"name":"mrdarcymurphy","email":"mrDarcyMurphy@gmail.com"},"maintainers":[{"name":"mrdarcymurphy","email":"darcy.murphy@me.com"},{"name":"loudbit","email":"darcy.murphy@loudbit.com"}],"dist":{"shasum":"b6d0f690410f1292414a0a2ca30cea546300a3f8","tarball":"https://registry.npmjs.org/the-thing-is/-/the-thing-is-0.6.0.tgz","integrity":"sha512-xPaayPD88q0N4w6iXwZ1rnikAGVwOyZqxN3nI5a/Oegui1ir7jlsuu1uKbvNLdlGalMOb9wSiL8t+SNiAPx9JQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDXMZdSa+w+Q7/WJKrau9wsQOSsNIR/DrCVKOw3PIcf3AiAZsPfOi2S/wUbzT8DPOElbo83c/LwGRqPZ+QFg08SihA=="}]}},"1.0.0":{"name":"the-thing-is","version":"1.0.0","description":"Simple tool for doing complex object validation.","main":"the-thing-is.js","scripts":{"test":"mocha -R spec"},"repository":{"type":"git","url":"git://github.com/LoudBit/the-thing-is.git"},"keywords":["is-too","validation"],"author":{"name":"Mr. Darcy Murphy"},"license":"MIT","gitHead":"adb81e723ae719a2cc21f9a91103d5acd783f0fd","dependencies":{"is-too":"2.5.0"},"devDependencies":{"mocha":"^2.1.0"},"bugs":{"url":"https://github.com/LoudBit/the-thing-is/issues"},"homepage":"https://github.com/LoudBit/the-thing-is#readme","_id":"the-thing-is@1.0.0","_shasum":"3c5002cc10a65ed112cbc079b9ed816720521eef","_from":".","_npmVersion":"3.5.3","_nodeVersion":"4.2.2","_npmUser":{"name":"mrdarcymurphy","email":"mrDarcyMurphy@gmail.com"},"maintainers":[{"name":"mrdarcymurphy","email":"darcy.murphy@me.com"},{"name":"loudbit","email":"darcy.murphy@loudbit.com"}],"dist":{"shasum":"3c5002cc10a65ed112cbc079b9ed816720521eef","tarball":"https://registry.npmjs.org/the-thing-is/-/the-thing-is-1.0.0.tgz","integrity":"sha512-baH2ny274PNKjVBDfj51sXe91scpjAZgYfXNrcPUtQ4zpXIMCEESgY+TByzs95R+HTyqURy6+CdtX6VtD8+/8Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQClpaygPU6IaMy+YZDZ7/ibaSb8FS4iTJa44XUpKGhLjwIgeMNYOyrrlBkYid3glJoQUsu+n7h16FOhrbVGSQjqB3I="}]}},"1.0.1":{"name":"the-thing-is","version":"1.0.1","description":"Simple tool for doing complex object validation.","main":"the-thing-is.js","scripts":{"test":"mocha -R spec"},"repository":{"type":"git","url":"git://github.com/LoudBit/the-thing-is.git"},"keywords":["is-too","validation"],"author":{"name":"Mr. Darcy Murphy"},"license":"MIT","gitHead":"adb81e723ae719a2cc21f9a91103d5acd783f0fd","dependencies":{"is-too":"2.5.1"},"devDependencies":{"mocha":"^2.1.0"},"bugs":{"url":"https://github.com/LoudBit/the-thing-is/issues"},"homepage":"https://github.com/LoudBit/the-thing-is#readme","_id":"the-thing-is@1.0.1","_shasum":"3b3b56da6b466aa86396f2b84df2c0878b335fd7","_from":".","_npmVersion":"3.5.3","_nodeVersion":"4.2.2","_npmUser":{"name":"mrdarcymurphy","email":"mrDarcyMurphy@gmail.com"},"maintainers":[{"name":"mrdarcymurphy","email":"darcy.murphy@me.com"},{"name":"loudbit","email":"darcy.murphy@loudbit.com"}],"dist":{"shasum":"3b3b56da6b466aa86396f2b84df2c0878b335fd7","tarball":"https://registry.npmjs.org/the-thing-is/-/the-thing-is-1.0.1.tgz","integrity":"sha512-drhMQ2QGIXhuA4lGwjCdhPVDhVPnz38FwrLyWURZvvCZQGMAmaFERy4hVDMGB2By/RJEAMNXRpy/l5rT0NXDkA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCJK8xy2Y9EVyuc4cRhAG6QVEkU/bRrrQvlRbIPQTVHjgIgGU74bynSHMNmRdIHnGg8tIX9XrZ0/lslKUNkd1oJAss="}]}}},"readme":"# `the-thing-is`\n\n> _\"…now you've got errors you can work with.\"_\n\n``` javascript\nvar the = require('the-thing-is')\n\nvar a_valid_user = {\n  name: ['string'],\n  address: {\n    street1: ['present', 'string', {matches: /.*/}],\n    street2: ['string'],\n    city: ['present', 'string'],\n    state: ['present', 'string', {matches: /^[A-Z]{2}$/}],\n    zip: ['present', 'string', {matches: /^[0-9]{5}$/}]\n  }\n}\n\nvar user = {\n  name: \"Joe Bob\",\n  address: {\n    street1: '123 Any St.',\n    street2: '',\n    city: 'Anytown',\n    state: undefined,\n    zip: 12345\n  }\n}\n\nfunction checkUser() {\n  if (the(user).is(a_valid_user)) {\n    return true;\n  } else {\n    return the.last.error;\n  }\n}\n\ncheckUser(user)\n```\n\n``` javascript\n// the.last.error\n[\n  { 'address.state': ['present'] },\n  { 'address.zip': ['string'] }\n]\n```\n\n`the-thing-is` uses [`is-too`](https://github.com/LoudBit/is-too) under the hood to perform the comparisons. See its README for a list of what's available.\n\n## How to Write Validation Rules\n\n### Array of Standards\n\nIf you've got a simple variable to check then use an array to describe what you're expecting. `the-thing-is` will run the subject through a series of standards that'll be evaluated in order.\n\nIf the variable fails to meet any of the standards, the error will be added to an array at `the.last.error`. No further tests will be run.\n\n``` javascript\nvar whatYouExpect = ['present', 'integer', {greaterThan:0, lessThan:256}]\n\nthe(16).is(whatYouExpect) // true\n\nthe(640).is(whatYouExpect) // false\n\nthe.last.thing // 640\nthe.last.error // [{lessThan:256}]\n```\n\n### Tree of Standards\n\n``` javascript\nvar a_valid_user = {\n  name: ['string'],\n  address: {\n    street1: ['present', 'string', {matches: /.*/}],\n    street2: ['string'],\n    city: ['present', 'string'],\n    state: ['present', 'string', {matches: /^[A-Z]{2}$/}],\n    zip: ['present', 'string', {matches: /^[0-9]{5}$/}]\n  }\n}\n```\n\nTrees can be made as deep as you want, and `the-thing-is` will walk through it all to tell you what it finds. Should the check fail, the path to the offending nodes on the tree are stored in `the.last.error` array.\n\nAs illustrated in the first example, `checkUser(user)` returns an array of objects where the keys refer to the invalid propertiest and their values are arrays of errors.\n\n``` javascript\n// the.last.error\n[\n  { 'address.state': ['present'] },\n  { 'address.zip': ['string'] }\n]\n```\n\nIn english this means `user.address.state` was `undefined`, and `user.address.zip` wasn't a string.\n\n\n## Errors\n\nWhen your subjects fail to live up to your standards then `the-thing-is` will list _all_ of its failures.\n\nNote:\n\n- `the-thing-is` doesn't stop at the first error it finds. It'll describe _all_ errors for _all_ properties.\n- If there are no errors, `the.last.error` will be an empty array.\n\n``` javascript\n// examples\nthe.last.error == []\nthe.last.error == ['number']\nthe.last.error == [{greaterThan:0}]\nthe.last.error == [{'foo.bar': ['number']}]\nthe.last.error == [{'foo.bar': ['number', {greaterThan:0}]}]\nthe.last.error == [{'foo.bar': ['number', {greaterThan:0}]}, {'foo.baz': ['number', {lessThan:256}]}]\n```\n\nAdditionally, if you describe your object using standards that don't exist in `is-too` then `the-thing-is` will throw a TypeError.\n\n``` javascript\nthe('thing').is('gonnaThrowUp')\n// => TypeError(\"`gonnaThrowUp` isn't a valid comparison method.\")\n```\n","maintainers":[{"name":"mrdarcymurphy","email":"darcy.murphy@me.com"},{"name":"loudbit","email":"darcy.murphy@loudbit.com"}],"time":{"modified":"2022-06-27T05:58:25.889Z","created":"2013-09-17T17:20:07.475Z","0.0.0":"2013-09-17T17:20:08.538Z","0.1.0":"2014-04-03T04:42:41.505Z","0.2.0":"2014-04-03T15:49:57.141Z","0.3.0":"2014-04-30T09:57:07.866Z","0.4.0":"2015-02-09T03:06:33.965Z","0.4.1":"2015-02-09T03:10:58.810Z","0.4.2":"2015-04-29T15:02:37.265Z","0.4.3":"2015-04-29T16:34:04.374Z","0.4.4":"2015-04-29T16:41:04.856Z","0.5.0":"2015-05-01T23:25:02.357Z","0.6.0":"2016-01-07T02:19:40.218Z","1.0.0":"2016-01-08T04:21:39.321Z","1.0.1":"2016-01-08T05:16:22.047Z"},"author":{"name":"Mr. Darcy Murphy"},"repository":{"type":"git","url":"git://github.com/LoudBit/the-thing-is.git"},"homepage":"https://github.com/LoudBit/the-thing-is#readme","keywords":["is-too","validation"],"bugs":{"url":"https://github.com/LoudBit/the-thing-is/issues"},"license":"MIT","readmeFilename":"README.md"}