{"_id":"is-validation","_rev":"28-ab1b22d8fe8e60248510bd5140a4c461","name":"is-validation","description":"Input validation and manipulation library","dist-tags":{"latest":"1.0.9"},"versions":{"0.0.1":{"name":"is-validation","description":"Input validation and manipulation library","author":{"name":"Jayce Pulsipher","email":"jaycemp@gmail.com"},"version":"0.0.1","license":"MIT","repository":{"type":"git","url":"https://github.com/JayceTDE/is-validation"},"keywords":["is","validation","manipulation"],"dependencies":{},"engines":{"node":"*"},"main":"is.js","_id":"is-validation@0.0.1","dist":{"shasum":"9c25cd271a1d4e34dc7b1d4d622be1bd117674dc","tarball":"https://registry.npmjs.org/is-validation/-/is-validation-0.0.1.tgz","integrity":"sha512-byp2PyVueYC3my2NNY+WjtSG17hRbctgnUt8EsCplF2j3xq8VhyyiGbdOVemQYGQ/F8jtxjmCqwkwuXCNy1gwg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC2Q17UeQ8CdjPev9GPHwI4Y5ogaMl5/qX4uWdy8ng5qAiEAigLMif/97jvJgIZ6K7lon8hGW0PzSCplCM2P+cgYK+o="}]},"_from":"is-validation","_npmVersion":"1.2.18","_npmUser":{"name":"jaycetde","email":"jaycemp@gmail.com"},"maintainers":[{"name":"jaycetde","email":"jaycemp@gmail.com"}]},"1.0.0":{"name":"is-validation","description":"Input validation and manipulation library","author":{"name":"Jayce Pulsipher","email":"jaycemp@gmail.com"},"version":"1.0.0","license":"MIT","repository":{"type":"git","url":"https://github.com/JayceTDE/is-validation"},"keywords":["is","validation","manipulation"],"dependencies":{"deep-is":"*"},"devDependencies":{"mocha":"*","should":"*"},"main":"lib/is.js","_id":"is-validation@1.0.0","dist":{"shasum":"dc9cb0c1a2f27ea4cbd0337dc25a421e0ee2bd94","tarball":"https://registry.npmjs.org/is-validation/-/is-validation-1.0.0.tgz","integrity":"sha512-sDLTz2nsLuVjuGcvf8uDxXm/2LHc5ohSJMUM6O455gIdwufM8ccpRED/xz5l0LdTxd4jZd+7FiNenyd+5GN1/Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDiCM61unkl8ZbDMhmNqBDDmmEhqadyfUqSxADbMyoCwQIgJfJ1gZ7SQcNm1E+IRnyT7uDONHvovPkBqLpDolS+owY="}]},"_from":".","_npmVersion":"1.2.18","_npmUser":{"name":"jaycetde","email":"jaycemp@gmail.com"},"maintainers":[{"name":"jaycetde","email":"jaycemp@gmail.com"}]},"1.0.1":{"name":"is-validation","description":"Input validation and manipulation library","author":{"name":"Jayce Pulsipher","email":"jaycemp@gmail.com"},"version":"1.0.1","license":"MIT","repository":{"type":"git","url":"https://github.com/JayceTDE/is-validation"},"keywords":["is","validation","manipulation"],"dependencies":{"deep-is":"*"},"devDependencies":{"mocha":"*","should":"*"},"main":"lib/is.js","_id":"is-validation@1.0.1","dist":{"shasum":"bf9da1dffe00f107b7a16383324f520213c41c62","tarball":"https://registry.npmjs.org/is-validation/-/is-validation-1.0.1.tgz","integrity":"sha512-n/8Vdf4NdlDFgGMWIqlVT7Ay3FDhriXYcbSovAcjghnUuT9cojuK0jXCwCci0DDtz2YdzPo7lq9VesXXCjvh4g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDlwbKjw6ZO2BcXA8Ahcxfb2Xr6tQ3d9ejfGBqmA1EFRAiEAz9GzwOgygQR2B4r6W1nZzh/amHUACPkghtzkplq9RGc="}]},"_from":".","_npmVersion":"1.2.18","_npmUser":{"name":"jaycetde","email":"jaycemp@gmail.com"},"maintainers":[{"name":"jaycetde","email":"jaycemp@gmail.com"}]},"1.0.2":{"name":"is-validation","description":"Input validation and manipulation library","author":{"name":"Jayce Pulsipher","email":"jaycemp@gmail.com"},"version":"1.0.2","license":"MIT","repository":{"type":"git","url":"https://github.com/JayceTDE/is-validation"},"keywords":["is","validation","manipulation"],"dependencies":{"deep-is":"*"},"devDependencies":{"mocha":"*","should":"*"},"main":"lib/is.js","_id":"is-validation@1.0.2","dist":{"shasum":"0886e7cd3fccc5541bd79279168bf2ef0d6b380e","tarball":"https://registry.npmjs.org/is-validation/-/is-validation-1.0.2.tgz","integrity":"sha512-5g2ZlBm64c34umqoB7XrYXzUlT5xgvzE8K2C5tNo4R9vsTMT1Iyuc+lLqBg9ifrfXdz/q45+/bTrhqj+HOz8zw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICpyquqaool+aX2VTOB3VgdPHPhvSR5uiLpplzcFpGWtAiEAokqTdfn2GQ+IR94V1FvQL04+BkpDHsBThuX6Uu1DZ5g="}]},"_from":".","_npmVersion":"1.2.18","_npmUser":{"name":"jaycetde","email":"jaycemp@gmail.com"},"maintainers":[{"name":"jaycetde","email":"jaycemp@gmail.com"}]},"1.0.3":{"name":"is-validation","description":"Input validation and manipulation library","author":{"name":"Jayce Pulsipher","email":"jaycemp@gmail.com"},"version":"1.0.3","license":"MIT","repository":{"type":"git","url":"https://github.com/JayceTDE/is-validation"},"keywords":["is","validation","manipulation"],"dependencies":{"congruent":"*","is-args":"*"},"devDependencies":{"mocha":"*","should":"*"},"main":"lib/is.js","scripts":{"test":"mocha"},"_id":"is-validation@1.0.3","dist":{"shasum":"441919f7283532cbf1cf80434ce0aedf4d34bfd1","tarball":"https://registry.npmjs.org/is-validation/-/is-validation-1.0.3.tgz","integrity":"sha512-ozadIyl2p1ODsWBy8uzD1L9+unHIExB2BkL7X/ImfmuWUPkdsk4dRXqncMh6o2AY4W/dgCMddKgCip4kfpRE8w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICwD1CGBTsMRxzHsvyfXZ+I1sY3tSAllSvMptNj6X9eEAiEA+48M7Il83scMFjHVHp79BxEst+V7o4j036B1uSqVz1g="}]},"_from":".","_npmVersion":"1.2.18","_npmUser":{"name":"jaycetde","email":"jaycemp@gmail.com"},"maintainers":[{"name":"jaycetde","email":"jaycemp@gmail.com"}]},"1.0.4":{"name":"is-validation","description":"Input validation and manipulation library","author":{"name":"Jayce Pulsipher","email":"jaycemp@gmail.com"},"version":"1.0.4","license":"MIT","repository":{"type":"git","url":"https://github.com/JayceTDE/is-validation"},"keywords":["is","validation","manipulation"],"dependencies":{"congruent":"*","is-args":"*"},"devDependencies":{"mocha":"*","should":"*"},"main":"lib/is.js","scripts":{"test":"mocha"},"_id":"is-validation@1.0.4","dist":{"shasum":"8be977d33274abbdc36caccf8ae6a8214ce90d92","tarball":"https://registry.npmjs.org/is-validation/-/is-validation-1.0.4.tgz","integrity":"sha512-JInVTH9iuTInPkOzuFmyjw6mJaniOhqvasoNHe3IWRu2yAv/qMeeRUjowUHxHesyuslkD2T8kRl+fwACBZ6qRA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD+ZYwwpMz0amYZG4Vb70OilTjDczaxJ1qibWVMsgGh7AIgM/4QrHTGrWiJ8N3PxaQSUAOUo6T6YBrUwtkAqXl5eds="}]},"_from":".","_npmVersion":"1.2.18","_npmUser":{"name":"jaycetde","email":"jaycemp@gmail.com"},"maintainers":[{"name":"jaycetde","email":"jaycemp@gmail.com"}]},"1.0.5":{"name":"is-validation","description":"Input validation and manipulation library","author":{"name":"Jayce Pulsipher","email":"jaycemp@gmail.com"},"version":"1.0.5","license":"MIT","repository":{"type":"git","url":"https://github.com/JayceTDE/is-validation"},"keywords":["is","validation","manipulation"],"dependencies":{"deepequal":"*","is-args":"*"},"devDependencies":{"mocha":"*","should":"*"},"main":"lib/is.js","scripts":{"test":"mocha"},"_id":"is-validation@1.0.5","dist":{"shasum":"aa3759a0ecd0286fd6c3868e414a27e4c47b0a75","tarball":"https://registry.npmjs.org/is-validation/-/is-validation-1.0.5.tgz","integrity":"sha512-D/1ZRiI3/3NWZquKq1bSWEfomwFLPQceeE0R7sHpY4HQklOvHVJVw2RhTeMTvHUoFTFq5VycaK4OBo0uQbCzYA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC7Y3iHtVs704s4TSRYqUL7864sS8ctiav2Xid4PohcLQIgFNxr2BDUVvCXH/VVPSolZeMLTvtubgCsQHgrHPS3tvI="}]},"_from":".","_npmVersion":"1.2.18","_npmUser":{"name":"jaycetde","email":"jaycemp@gmail.com"},"maintainers":[{"name":"jaycetde","email":"jaycemp@gmail.com"}]},"1.0.6":{"name":"is-validation","description":"Input validation and manipulation library","author":{"name":"Jayce Pulsipher","email":"jaycemp@gmail.com"},"version":"1.0.6","license":"MIT","repository":{"type":"git","url":"https://github.com/JayceTDE/is-validation"},"keywords":["is","validation","manipulation"],"dependencies":{"deepequal":"*","is-args":"*"},"devDependencies":{"mocha":"*","should":"*"},"main":"lib/is.js","scripts":{"test":"mocha"},"_id":"is-validation@1.0.6","dist":{"shasum":"d85280114b5387fba8b47afb4107c89efa774317","tarball":"https://registry.npmjs.org/is-validation/-/is-validation-1.0.6.tgz","integrity":"sha512-i8Lfy2GHFg7Ev/Sm0/5kGQIj1L6PUAwwdkwmAO9jTaHX66OLeGNE/6O+TA7VTyQiC0UpNo8s81Zt8Y9DBLyHzg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDTDkzhQ2VyD27lksRaFZk48qPjxkPLEQf2Uz5/2qBQhwIhAJog2aRmnLhzpiPyc6bJyPbI9jwNpBf/2PKJBOxrsfKJ"}]},"_from":".","_npmVersion":"1.2.18","_npmUser":{"name":"jaycetde","email":"jaycemp@gmail.com"},"maintainers":[{"name":"jaycetde","email":"jaycemp@gmail.com"}]},"1.0.7":{"name":"is-validation","description":"Input validation and manipulation library","author":{"name":"Jayce Pulsipher","email":"jaycemp@gmail.com"},"version":"1.0.7","license":"MIT","repository":{"type":"git","url":"https://github.com/JayceTDE/is-validation"},"keywords":["is","validation","manipulation"],"dependencies":{"deepequal":"*","is-args":"*"},"devDependencies":{"mocha":"*","should":"*"},"main":"lib/is.js","scripts":{"test":"mocha"},"_id":"is-validation@1.0.7","dist":{"shasum":"24b9ad2458e10cc2d1d26a060b8bf18e94672b11","tarball":"https://registry.npmjs.org/is-validation/-/is-validation-1.0.7.tgz","integrity":"sha512-Or9ZWyC7B91a84CnpzwWKFg2yxN5d4SK7tbBQ1o/MD01XbZvKg2UZCNZzfVXcg0nFD0HT4xbQ8YH3M0LVERBlA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBN1gUA0MyAB11pvH5NXNUvELje7/ZajFaeksbRN4NPKAiAI2wcAmrcMGtwP5ewJKwV0o2UD8qUSraCrAhc2G/DjgA=="}]},"_from":".","_npmVersion":"1.2.18","_npmUser":{"name":"jaycetde","email":"jaycemp@gmail.com"},"maintainers":[{"name":"jaycetde","email":"jaycemp@gmail.com"}]},"1.0.8":{"name":"is-validation","description":"Input validation and manipulation library","author":{"name":"Jayce Pulsipher","email":"jaycemp@gmail.com"},"version":"1.0.8","license":"MIT","repository":{"type":"git","url":"git+https://github.com/JayceTDE/is-validation.git"},"keywords":["is","validation","manipulation"],"dependencies":{"deepequal":"*","is-args":"*"},"devDependencies":{"mocha":"*","should":"*"},"main":"lib/is.js","scripts":{"test":"mocha"},"gitHead":"3bc2072320f029ad93f5cd6c38b63383cb9e4b6f","bugs":{"url":"https://github.com/JayceTDE/is-validation/issues"},"homepage":"https://github.com/JayceTDE/is-validation#readme","_id":"is-validation@1.0.8","_shasum":"986f1b07ed5aeddab0d1423636e50e823111bd44","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.11.1","_npmUser":{"name":"jaycetde","email":"jaycemp@gmail.com"},"dist":{"shasum":"986f1b07ed5aeddab0d1423636e50e823111bd44","tarball":"https://registry.npmjs.org/is-validation/-/is-validation-1.0.8.tgz","integrity":"sha512-ud8/lQyd2Gkhd5UNOGwt9vUo2lpWTv0CCgVvznBHevVn4sWd0w/JGmHV17cwwRhPHjbrwtVp7tSs0opQRKPRzQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDrHAvQhFBxZSvVC9y2B9BQ5QuMN2IiILAeyZsgHmcIwAiANhUlClA2i14TeRrc5+8CXHA4+eykDhfELxkRcarS43A=="}]},"maintainers":[{"name":"jaycetde","email":"jaycemp@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/is-validation-1.0.8.tgz_1504939483142_0.9673809576779604"}},"1.0.9":{"name":"is-validation","description":"Input validation and manipulation library","author":{"name":"Jayce Pulsipher","email":"jaycemp@gmail.com"},"version":"1.0.9","license":"MIT","repository":{"type":"git","url":"git+https://github.com/JayceTDE/is-validation.git"},"keywords":["is","validation","manipulation"],"dependencies":{"deepequal":"*","is-args":"*"},"devDependencies":{"mocha":"*","should":"*"},"main":"lib/is.js","scripts":{"test":"mocha"},"gitHead":"6dc9ddb830480f4bd680f904163126a9c247fa98","bugs":{"url":"https://github.com/JayceTDE/is-validation/issues"},"homepage":"https://github.com/JayceTDE/is-validation#readme","_id":"is-validation@1.0.9","_shasum":"f334acaf848d0c1a6e3e71caca85b37be33c9728","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.11.1","_npmUser":{"name":"jaycetde","email":"jaycemp@gmail.com"},"dist":{"shasum":"f334acaf848d0c1a6e3e71caca85b37be33c9728","tarball":"https://registry.npmjs.org/is-validation/-/is-validation-1.0.9.tgz","integrity":"sha512-MPEjC2ngYOYYoI7YT09h7m5boh1gw6mSNOxCNIy/LlysCqqrWTOWIOQ4X+67CVNdc814KRDas798Z0hYDdk+hA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD3aRg/+Kdrv7vVPeBe4vZ0I0oNujoVVhzB8cBeFqNITAIgQGtt5Xo6+3PshFg3CzcY73TiRQdc8IpgZNeDns2eyEw="}]},"maintainers":[{"name":"jaycetde","email":"jaycemp@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/is-validation-1.0.9.tgz_1505076354758_0.8116119725164026"}}},"readme":"# is-validation [![Build Status](https://travis-ci.org/JayceTDE/is-validation.png)](https://travis-ci.org/JayceTDE/is-validation)\n\nLibrary for chaining validation and manipulation together\n\nIt provides a convienient way of validating and converting input\nwhile providing easy to read and informative error messages.\n\n```javascript\n\nvar is = require('is');\n\n// static validation usage\nis.number(123);\n// true\nis.lessThan(123, 100);\n// false\n\n// simple chaining\nis(123)\n  .number()\n  .lessThan(100)\n;\n\nis.valid;\n// false\nis.errorCount;\n// 1\nis.testCount;\n// 2\n\n// complex chaining\nvar chain = is(\"hello world\");\nchain\n  .string()\n  .property('length')\n    .greaterThan(10)\n    .lessThan(20)\n    .up() // go back to parent chain\n  .match(/^[a-z ]+$/i)\n;\n\nchain.valid;\n// true\nis.valid;\n// false (still false from simple chaining example)\n\nchain.errorCount;\n// 0\nis.errorCount;\n// 1\n\nchain.testCount;\n// 4\nis.testCount;\n// 6\n\nis.clear();\n\nis.valid;\n// true\nis.testCount;\n// 0\nis.errorCount;\n// 0\n\n```\n\n## Installation\n\n    $ npm install is-validation\n\n## Dependencies\n\n  - [deepequal](https://npmjs.org/package/deepequal)\n  - [is-args](https://npmjs.org/package/is-args)\n    \n## API\n\n### is(val, [ name ])\n\nRegisters a new Chain to `is`\n\n* val - The subject of the chain\n* name - The name to be used in error messages\n\nreturns a new Chain instance\n\n### is.a is.an\n\nreturns `is`\n\n```javascript\n\nis.a.string('abc');\n// true\n\nis === is.a.an;\n// true\n\n```\n\n### is.valid\n\nReturns false if any registered Chain has any errors\n\n### is.testCount\n\nReturns the total number of tests of all registered Chains\n\n### is.errorCount\n\nReturns the total number of errors of all registered Chains\n\n### is.errorMessages\n\nReturns an array of error messages from all registered Chains\n\n### is.clear()\n\nClears out all registered Chains\n\nreturns `is`\n\n### is.throwErrors()\n\nIf `is.valid` is false, throw `is.errorMessages` as an Exception\n\n### is.configure.addValidator(name, fn, [ options ])\n\nAdd a validator to `is` and the Chain prototype\n\n* name - The name the validator may be accessed through\n* fn - The validation function. Returns true on valid, false on not valid\n* options\n  * failMessage - The error message for if the validation fails (default: 'pass ' + name + ' test')\n\n```javascript\n\nis.configure.addValidator('odd', function (val) {\n    return val % 2 === 1;\n}, { failMessage: 'be odd' });\n\nis.odd(3);\n// true\n\nis(2).odd().errorMessage;\n// 'value must be odd'\n\n```\n\n### is.configure.addManipulator(name, fn, [ options ])\n\nAdd a manipulator to `is` and the Chain prototype\n\n* name - The name the manipulator may be access through\n* fn - The manipulation function. Returns the manipulated value\n* options\n  * failVal - A value or function to compare to the manipulated value to indicate failure. If not set, the manipulation cannot fail\n  * failMessage - The error message for if the manipulation fails (default: 'be able to be manipulated by ' + name)\n\n```javascript\n\nis.configure.addManipulator('toExponent', function (val, exp) {\n    return Math.pow(val, exp);\n}, { failVal: isNaN, failMessage: 'be a number' });\n\nis.toExponent(5, 2);\n// 25\n\nis('abc').toExponent(2).errorMessage;\n// 'value must be a number'\n\n```\n\n### is.METHOD(val, args*)\n\nAll validation and manipulation methods are available as properties of is.\n\n```javascript\n\nis.string('abc');\n// true\n\nis.lessThan(123, 100);\n// false\n\n```\n\n### Chain(val, [ name ])\n\n### Chain.a Chain.an Chain.and\n\nreturns `this`\n\n### Chain.not\n\nNegates the next test\n\nreturns `this`\n\n```javascript\n\nis('abc').not.a.number().valid;\n// true\n\n```\n\n### Chain.or\n\nSimple `or` condition\n\nIf the validation before `.or` or the validation after passes, then the chain is considered valid\n\n```javascript\n\nis(123)\n  .a.string().or\n    .a.number()\n  .valid;\n// true\n\nis(123)\n  .a.string().or\n    .an.array().or\n    .a.regExp()\n  .errorMessage;\n// 'value must be a string, be an array, or be a regular expression'\n\n```\n\nThe behavior of `or` may be a little strange, and I am open to suggestions:\n\n* All `or` tests after a valid test will be skipped\n* All errors in a set of `or`s count as 1 error in `.errorCount`\n* Only the tests that are performed until a valid test count towards `.testCount` (I might set all `or` tests to count as 1)\n* There is no grouping of tests (yet - let me know if this is desired). `or` will only work with single tests\n\n### Chain.value\n\nReturns the manipulated subject of the Chain\n\n### Chain.valid\n\nReturns true if no errors have occured on the chain\n\n### Chain.testCount\n\nReturns the number of tests that have occured on the chain\n\n### Chain.errorCount\n\nReturns the number of errors that have occured on the chain\n\n### Chain.errorMessage\n\nReturns a composed error message describing all the tests that have failed on the chain\n\n### Chain.clear();\n\nClears out all tests on the chain\n\nreturns `this`\n\n### Chain.property(propName, [ name ])\n\nCreates a new Chain with the current chains property `propName` as the subject\n\n* propName - the property to use as the new subject\n* name - the name to be used in the error message. (default: `propName`)\n\n```javascript\n\nis('abc')\n  .a.string()\n  .property('length', 'total number of characters')\n    .greaterThan(5)\n    .lessThan(10)\n    .up()\n  .errorMessage;\n// 'value must have a total number of characters which must be greater than 5'\n\n```\n\n### Chain.ifValid()\n\nStarts bypassing validations and manipulations if the chain is not valid\n\n### Chain.stop()\n\nStarts bypassing validations and manipulations on the chain\n\n### Chain.resume()\n\nStops bypassing validations and manipulations on the chain\n\n### Chain.up()\n\nReturns the parent chain if it exists\n\n```javascript\n\nvar chain = is('abc')\n  , length = chain.property('length')\n;\n\nchain === length;\n// false\n\nchain === length.up();\n// true\n\n```\n\n### Chain.throwError()\n\nThrows an exception if the chain is not valid\n\n### Chain.validate(fn, failMessage)\n\nRun a one time validation in the chain\n\n* fn - The validation function. Returns `true` on success, `false` on failure\n* failMessage - The error message if the validation fails\n\n```javascript\n\nis(123)\n  .validate(function (val) {\n      return val % 2 === 0;\n  }, 'be even')\n  .errorMessage;\n// 'value must be even'\n\n```\n\n### Chain.manipulate(fn, [ name ])\n\nRun a one time manipulation in the chain\n\n* fn - The manipulation function. Returns the manipulated value\n* name - The name of the manipulated value\n\nreturns `this`\n\n```javascript\n\nis(123)\n  .manipulate(function (val) {\n      return val * val;\n  }, 'value squared')\n    .value;\n// 15129\n\n```\n\n### Chain.errorFormat(format)\n\nReplace the chains error format with `format`\n\n* format - a string to represent how error messages are displayed\n\nThe default format is '{0} must {1}' where {0} is the name of the chain subject and {1} is the list of error messages\n\n### Chain.propFormat(format)\n\nReplace the chain property format with `format`\n\n* format - a string to represent how properties are formatted in error messages\n\nThe default format is 'have a {0} which must {1}' where {0} is the name of the property and {1} is the list of error messages for the property\n\n## Error Messages\n\nError messages are customizable and more informative than simply stating 'invalid input'\n\n```javascript\n\nis('$ab', 'Your username')\n  .string()\n  .match(/^[a-z]*$/i, 'only be alphabetic characters')  // fails\n  .property('length')\n    .greaterThan(5)  // fails\n    .lessThan(15)\n;\n\nis.errorMessages;\n// ['Your username must only be alphabetic characters and have a length which must be greater than 5']\n\n```\n\n\n## Built-in Validation\n\n### string(val)\n\nIs `val` a string object\n\n### number(val)\n\nIs `val` numeric. NaN, Infinity, true, false, and '' are not numeric\n\n### strictNumber(val)\n\nIs `val` a number object\n\n### lessThan(val, limit)\n\nSimple less than comparison: `return val < limit`\n\n### lessThanEqual(val, limit)\n\nSimple less than or equal comparison: `return val <= limit`\n\n### greaterThan(val, limit)\n\nSimple greater than comparison: `return val > limit`\n\n### greaterThanEqual(val, limit)\n\nSimple greater than or equal comparison: `return val > limit`\n\n### between(val, lower, upper)\n\nExclusive comparison: `return val > lower && val < upper`\n\n### within(val, lower, upper)\n\nInclusive comparison: `return val >= lower && val <= upper`\n\n### equal(val, expected)\n\nUses [deep-is](https://github.com/thlorenz/deep-is) to compare objects\n\n### strictEqual(val, expected)\n\nSimple strict equality comparison: `return val === expected`\n\n### strictBoolean(val)\n\n`val` must equal true or false\n\n### date(val)\n\nCan `val` be parsed into a date\n\n### strictDate(val)\n\nIs `val` a Date object\n\n### object(val)\n\nIs `val` an object\n\n### literalObject(val)\n\nCheck if `val` is an object literal\n\n`{}`           - true\n`new Object()` - true\n`[]`           - false\n`new Date()`   - false\n\n### inside(val, arr)\n\nCheck for the existance of `val` in an array or string\n\n### haveProperty(val, propName)\n\nDoes `val` have a property `propName`\n\n### haveOwnProperty(val, propName)\n\nDoes `val` have its own property `propNam`\n\n### match(val, regExp)\n\nCompares `val` to a regular expression\n\n### function(val)\n\nIs `val` a function\n\n### args(val)\n\nIs `val` an arguments object\n\n### regExp(val)\n\nIs `val` a regular expression\n\n### instanceOf(val, constructor)\n\nIs `val` an instance of constructor\n\n### array(val)\n\nIs `val` an array\n\n### buffer(val)\n\nIs `val` a Buffer object\n\n### empty(val)\n\nIs `val` empty\n\n* array, arguments, and string - true if val.length === 0\n* null, undefined - true\n* object - true if it has no properties of its own\n\n\n\n## Built-in Manipulation\n\n### toString(val)\n\nReturns a string representation of `val`\n\n* undefined and null - returns an empty string ('')\n* object literal - returns JSON.stringify(val)\n* everything else - returns String(val)\n\nCannot fail\n\n### trim(val, [ chars ])\n\nTrims characters from both side of `val`. It will convert `val` to a string using `is.toString`\n\n* chars - the characters to trim from the sides (default: '\\\\r\\\\n\\\\t\\\\s' - whitespace characters)\n\nCannot fail\n\n### leftTrim(val, [ chars ])\n\nTrims characters from the left side of `val`. It will convert `val` to a string using `is.toString`\n\n* chars - the characters to trim from the left side (default: '\\\\r\\\\n\\\\t\\\\s' - whitespace characters)\n\nCannot fail\n\n### rightTrim(val, [ chars ])\n\nTrims characters from the right side of `val`. It will convert `val` to a string using `is.toString`\n\n* chars - the characters to trim from the right side (default: '\\\\r\\\\n\\\\t\\\\s' - whitespace characters)\n\nCannot fail\n\n### toNumber(val)\n\nParse `val` into a number\n\nAn empty string ('') returns NaN. Everything else is parsed by `Number(val)`\n\n* failVal - isNaN\n* failMessage - 'be a number'\n\n### toInteger(val, [ radix ])\n\nUse parseInt to parse `val`\n\n* radix - the radix to use in parseInt (default: 10)\n\n* failVal - isNaN\n* failMessage - 'be an integer'\n\n### toFloat(val)\n\nUse parseFloat to parse `val`\n\n* failVal - isNaN\n* failMessage - 'be a floating point number'\n\n### toBoolean(val)\n\nConverts `val` into true or false\n\n'', '0', 'false', and falsy objects will be converted to false.  Everything else will be true.\n\nCannot fail\n\n### toDate(val)\n\nConverts `val` into a Date object\n\nnull, undefined, and boolean values return NaN\n\n* failVal - isNaN\n* failMessage - 'be a valid date'\n\n### toRegExp(val)\n\nConverts `val` into a regular expression\n\nIt will convert RegExp.toString() back into a RegExp. All other strings will not have flags\n\n```javascript\n\nvar reg = /^hello$/gi\n  , str = reg.toString() // '/^hello$/gi'\n;\n\nis.toRegExp(str);\n// /^hello$/gi\n\nis.toRegExp('^helloE');\n// /^hello$/\n\n```\n\n* failVal - null\n* failMessage - 'be a regular expression'\n\n### default(val, newVal, compare)\n\nReplaces `val` with `newVal` if it equals `compare`\n\n`compare` may also be a function which returns true to replace the values\n\n```javascript\n\nis.default('abc', 'def', 'abc');\n// 'def'\n\nis.default(123, 0, isNaN);\n// 123\n\nis.default(undefined, '') // `compare` is undefined. Its value is `undefined`\n// ''\n\nis('abc')\n  .toNumber()        // converts 'abc' to NaN\n  .default(0, isNaN) // replaces NaN with 0\n  .clear()           // clear out errors from `toNumber()`\n  .value;              // return the value\n// 0\n\n```\n\nCannot fail\n\n## Limitations\n\n  - This library is brand new and still under development. The API is still\n  changing.\n  - Type-checking will not work across multiple frames or through REPL. I\n  chose not to use the slower `Object.prototype.toString` method of type\n  checking.\n  - All validation and manipulation methods must be synchronous","maintainers":[{"name":"jaycetde","email":"jaycemp@gmail.com"}],"time":{"modified":"2022-06-19T02:53:11.429Z","created":"2013-05-06T06:25:04.344Z","0.0.1":"2013-05-06T06:25:06.432Z","1.0.0":"2014-01-16T19:25:35.215Z","1.0.1":"2014-01-17T21:10:11.470Z","1.0.2":"2014-01-20T02:31:53.969Z","1.0.3":"2014-01-22T08:41:00.390Z","1.0.4":"2014-01-22T19:37:25.528Z","1.0.5":"2014-01-23T06:37:52.943Z","1.0.6":"2014-01-27T05:36:49.004Z","1.0.7":"2014-07-25T17:32:42.658Z","1.0.8":"2017-09-09T06:44:44.227Z","1.0.9":"2017-09-10T20:45:54.858Z"},"author":{"name":"Jayce Pulsipher","email":"jaycemp@gmail.com"},"repository":{"type":"git","url":"git+https://github.com/JayceTDE/is-validation.git"},"readmeFilename":"README.md","keywords":["is","validation","manipulation"],"license":"MIT","homepage":"https://github.com/JayceTDE/is-validation#readme","bugs":{"url":"https://github.com/JayceTDE/is-validation/issues"}}