summaryrefslogtreecommitdiff
path: root/deps/npm/test/npm_cache/_cacache/content-v2/sha512/d4/45/ed72e65ed0b9fec5a6a41794caadda951ba79a0541648e259c8021b3fc96487d2caedf869ac142b4b0f31998c436f171d98a9a1740e3ac8eebb5c1103c53
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/test/npm_cache/_cacache/content-v2/sha512/d4/45/ed72e65ed0b9fec5a6a41794caadda951ba79a0541648e259c8021b3fc96487d2caedf869ac142b4b0f31998c436f171d98a9a1740e3ac8eebb5c1103c53')
-rw-r--r--deps/npm/test/npm_cache/_cacache/content-v2/sha512/d4/45/ed72e65ed0b9fec5a6a41794caadda951ba79a0541648e259c8021b3fc96487d2caedf869ac142b4b0f31998c436f171d98a9a1740e3ac8eebb5c1103c531
1 files changed, 1 insertions, 0 deletions
diff --git a/deps/npm/test/npm_cache/_cacache/content-v2/sha512/d4/45/ed72e65ed0b9fec5a6a41794caadda951ba79a0541648e259c8021b3fc96487d2caedf869ac142b4b0f31998c436f171d98a9a1740e3ac8eebb5c1103c53 b/deps/npm/test/npm_cache/_cacache/content-v2/sha512/d4/45/ed72e65ed0b9fec5a6a41794caadda951ba79a0541648e259c8021b3fc96487d2caedf869ac142b4b0f31998c436f171d98a9a1740e3ac8eebb5c1103c53
new file mode 100644
index 0000000000..11b928e5cd
--- /dev/null
+++ b/deps/npm/test/npm_cache/_cacache/content-v2/sha512/d4/45/ed72e65ed0b9fec5a6a41794caadda951ba79a0541648e259c8021b3fc96487d2caedf869ac142b4b0f31998c436f171d98a9a1740e3ac8eebb5c1103c53
@@ -0,0 +1 @@
+{"_id":"checker","_rev":"23-39ff9491581c529b8b828651a196c7a3","name":"checker","description":"Checker is the collection of common abstract methods for validatiors and setters.","dist-tags":{"latest":"0.5.2"},"versions":{"0.0.0":{"name":"checker","version":"0.0.0","description":"","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"MIT","readme":"ERROR: No README data found!","_id":"checker@0.0.0","dist":{"shasum":"6a7a3977bbe770560d4fcc86eb3a32a52c9b368d","tarball":"http://localhost:1337/checker/-/checker-0.0.0.tgz"},"_from":".","_npmVersion":"1.3.11","_npmUser":{"name":"kael","email":"i@kael.me"},"maintainers":[{"name":"kael","email":"i@kael.me"}],"directories":{}},"0.2.1":{"name":"checker","version":"0.2.1","description":"Checker is the collection of common abstract methods for validatiors and setters.","main":"index.js","scripts":{"test":"make test"},"repository":{"type":"git","url":"git://github.com/kaelzhang/node-checker.git"},"keywords":["checker","validator","validate","setter"],"author":{"name":"kael"},"license":"MIT","bugs":{"url":"https://github.com/kaelzhang/node-checker/issues"},"devDependencies":{"mocha":"~1.13.0","chai":"~1.8.0"},"dependencies":{"async":"~0.2.9"},"readme":"[![Build Status](https://travis-ci.org/kaelzhang/node-checker.png?branch=master)](https://travis-ci.org/kaelzhang/node-checker)\n\n(THIS DOCUMENTAION IS NOT FINISHED YET.)\n\n# checker\n\nChecker is the collection of common abstract node.js methods for validatiors and setters.\n\t\n# Usage\n```sh\nnpm install checker --save\n```\n\n```js\nvar checker = require('checker');\n```\n\n# Synopsis\n\n```js\nchecker(schema, options).check(data, callback);\n```\n\n# Validation, Error Messages\n\n## Simple synchronous validators\n\n```js\nvar schema = {\n\tusername: {\n\t\tvalidator: function(value){\n\t\t\treturn /^[a-zA-Z0-9]{6,}$/.test(value);\n\t\t},\n\t\tmessage: 'Username must only contain letters, numbers; Username must contain at least 6 charactors'\n\t}\n};\n\nvar c = checker(schema);\n\nc.check({\n\tusername: 'a'\n}, function(err){\n\tif(err){\n\t\tconsole.log(err); // Then, `schema.username.message` will be displayed.\n\t}\n});\n```\n\n## Regular expressions as validators\n\nThe error hint of the example above is bad, because we want to know the very certain reason why we are wrong.\n\nThe `schema` below is equivalent to the one of the previous section:\n\n```js\n{\n\tvalidator: [\n\t\tfunction(value){\n\t\t\treturn value && value.length > 5;\n\t\t}, \n\t\t/^[a-zA-Z0-9]+$/\n\t],\n\tmessage: [\n\t\t'Username must contain at least 6 charactors', \n\t\t'Username must only contain letters and numbers'\n\t];\n}\n```\n\n## Asynchronous validators\n\n```js\n{\n\tvalidator: function(value){\n\t\tvar done = this.async();\n\t\t// this is an async method, and takes sooooo long...\n\t\tremote_check(value, function(err){\n\t\t\tdone(err); // `err` will pass to the `callback`\n\t\t});\n\t}\n}\n```\n\n\n# Programmatical Details\n\n## Options\n\n#### options.default_message `String`\n\nDefault error message\n\n#### options.parallel `Boolean=false`\n\n#### options.limit `Boolean=false`\n\n#### options.check_all `Boolean=false`\n\n\n\n## Schema Structures \n\n```js\n{\n\t<name>: <rule>\n}\n```\n\n\nWhere `rule` might contains (all properties are optional):\n\n#### validator \n\n- `RegExp` The regular exp that input must matches against\n- `Function` Validation function. If `arguments.length === 3`, it will be considered as an async methods\n- `Array.<RegExp|Function>` Group of validations. Asks will check each validator one by one. If validation fails, the rest validators will be skipped.\n- See sections above for details\n\t\n#### setter `Function|Array.<Function>`\n\nSee sections above for details.\n\n#### message `String`\n\nDefault error message\n\n#### default: `String`\n","_id":"checker@0.2.1","dist":{"shasum":"f25a07a1429cd9cee4a668f19fa99fa7e380deda","tarball":"http://localhost:1337/checker/-/checker-0.2.1.tgz"},"maintainers":[{"name":"kael","email":"i@kael.me"}],"directories":{}},"0.3.1":{"name":"checker","version":"0.3.1","description":"Checker is the collection of common abstract methods for validatiors and setters.","main":"index.js","scripts":{"test":"make test"},"repository":{"type":"git","url":"git://github.com/kaelzhang/node-checker.git"},"keywords":["checker","validator","validate","setter"],"author":{"name":"kael"},"license":"MIT","bugs":{"url":"https://github.com/kaelzhang/node-checker/issues"},"devDependencies":{"mocha":"~1.13.0","chai":"~1.8.0"},"dependencies":{"async":"~0.2.9"},"readme":"[![Build Status](https://travis-ci.org/kaelzhang/node-checker.png?branch=master)](https://travis-ci.org/kaelzhang/node-checker)\n\n(THIS DOCUMENTAION IS NOT FINISHED YET.)\n\n# checker\n\nChecker is the collection of common abstract node.js methods for validatiors and setters.\n\t\n# Usage\n```sh\nnpm install checker --save\n```\n\n```js\nvar checker = require('checker');\n```\n\n# Synopsis\n\n```js\nchecker(schema, options).check(data, callback);\n```\n\n# Validation, Error Messages\n\n## Simple synchronous validators\n\n```js\nvar schema = {\n\tusername: {\n\t\tvalidator: function(value){\n\t\t\treturn /^[a-zA-Z0-9]{6,}$/.test(value);\n\t\t},\n\t\tmessage: 'Username must only contain letters, numbers; Username must contain at least 6 charactors'\n\t}\n};\n\nvar c = checker(schema);\n\nc.check({\n\tusername: 'a'\n}, function(err){\n\tif(err){\n\t\tconsole.log(err); // Then, `schema.username.message` will be displayed.\n\t}\n});\n```\n\n## Regular expressions as validators\n\nThe error hint of the example above is bad, because we want to know the very certain reason why we are wrong.\n\nThe `schema` below is equivalent to the one of the previous section:\n\n```js\n{\n\tvalidator: [\n\t\tfunction(value){\n\t\t\treturn value && value.length > 5;\n\t\t}, \n\t\t/^[a-zA-Z0-9]+$/\n\t],\n\tmessage: [\n\t\t'Username must contain at least 6 charactors', \n\t\t'Username must only contain letters and numbers'\n\t];\n}\n```\n\n## Asynchronous validators\n\n```js\n{\n\tvalidator: function(value){\n\t\tvar done = this.async();\n\t\t// this is an async method, and takes sooooo long...\n\t\tremote_check(value, function(err){\n\t\t\tdone(err); // `err` will pass to the `callback`\n\t\t});\n\t}\n}\n```\n\n\n# Programmatical Details\n\n## Options\n\n#### options.default_message `String`\n\nDefault error message\n\n#### options.parallel `Boolean=false`\n\n#### options.limit `Boolean=false`\n\n#### options.check_all `Boolean=false`\n\n\n\n## Schema Structures \n\n```js\n{\n\t<name>: <rule>\n}\n```\n\n\nWhere `rule` might contains (all properties are optional):\n\n#### validator \n\n- `RegExp` The regular exp that input must matches against\n- `Function` Validation function. If `arguments.length === 3`, it will be considered as an async methods\n- `Array.<RegExp|Function>` Group of validations. Asks will check each validator one by one. If validation fails, the rest validators will be skipped.\n- See sections above for details\n\t\n#### setter `Function|Array.<Function>`\n\nSee sections above for details.\n\n#### message `String`\n\nDefault error message\n\n#### default: `String`\n","_id":"checker@0.3.1","dist":{"shasum":"c285c3f3c29c4186156d9e94945ad3892e64c739","tarball":"http://localhost:1337/checker/-/checker-0.3.1.tgz"},"maintainers":[{"name":"kael","email":"i@kael.me"}],"directories":{}},"0.3.2":{"name":"checker","version":"0.3.2","description":"Checker is the collection of common abstract methods for validatiors and setters.","main":"index.js","scripts":{"test":"make test"},"repository":{"type":"git","url":"git://github.com/kaelzhang/node-checker.git"},"keywords":["checker","validator","validate","setter"],"author":{"name":"kael"},"license":"MIT","bugs":{"url":"https://github.com/kaelzhang/node-checker/issues"},"devDependencies":{"mocha":"~1.13.0","chai":"~1.8.0"},"dependencies":{"async":"~0.2.9"},"readme":"[![Build Status](https://travis-ci.org/kaelzhang/node-checker.png?branch=master)](https://travis-ci.org/kaelzhang/node-checker)\n\n# checker\n\nChecker is the collection of common abstract node.js methods for validatiors and setters.\n\t\n# Usage\n```sh\nnpm install checker --save\n```\n\n```js\nvar checker = require('checker');\n```\n\n# Synopsis\n\n```js\nchecker(schema, options).check(data, function(err, value, details){\n});\n```\n\n### err `mixed`\n\n### parsed `Object`\n\nThe cleaned and parsed `data`.\n\n### details `Object`\n\n```\n{\n\t<name>: <detail>\n}\n```\n\n- `detail.value` `mixed` the parsed value\n- `detail.is_default` `Boolean` if the current property is defined in `schema`, but the input data doesn't have it, then the value will be `true`\n- `detail.is_cooked` `Boolean` if there're any setters, it will be `true`\n- `detail.origin` the origin value of the property\n\n\n# Validation, Error Messages\n\n## Simple synchronous validators\n\n```js\nvar schema = {\n\tusername: {\n\t\tvalidator: function(value){\n\t\t\treturn /^[a-zA-Z0-9]{6,}$/.test(value);\n\t\t},\n\t\tmessage: 'Username must only contain letters, numbers; ' \n\t\t\t+ 'Username must contain at least 6 charactors'\n\t}\n};\n\nvar c = checker(schema);\n\nc.check({\n\tusername: 'a'\n}, function(err){\n\tif(err){\n\t\tconsole.log(err); // Then, `schema.username.message` will be displayed.\n\t}\n});\n```\n\n## Regular expressions as validators\n\nThe error hint of the example above is bad, because we want to know the very certain reason why we are wrong.\n\nThe `schema` below is equivalent to the one of the previous section:\n\n```js\n{\n\tvalidator: [\n\t\tfunction(value){\n\t\t\treturn value && value.length > 5;\n\t\t}, \n\t\t/^[a-zA-Z0-9]+$/\n\t],\n\tmessage: [\n\t\t'Username must contain at least 6 charactors', \n\t\t'Username must only contain letters and numbers'\n\t];\n}\n```\n\n## Asynchronous validators\n\n```js\n{\n\tvalidator: function(value){\n\t\tvar done = this.async();\n\t\t// this is an async method, and takes sooooo long...\n\t\tremote_check(value, function(err){\n\t\t\tdone(err); // `err` will pass to the `callback`\n\t\t});\n\t}\n}\n```\n\n\n# Programmatical Details\n\n## Options\n\n#### options.default_message `String`\n\nDefault error message\n\n#### options.parallel `Boolean=false`\n\nBy default, `checker` will check each properties in series, \n\n#### options.limit `Boolean=false`\n\nIf `options.limit` is `true` and a certain property of the input data is not defined in the `schema`, the property will be removed.\n\nDefault to `false`.\n\n#### options.check_all `Boolean=false`\n\nNot implemented yet.\n\n#### options.context `Object`\n\nSee sections below.\n\n## Schema Structures \n\n```js\n{\n\t<name>: <rule>\n}\n```\n\n\nWhere `rule` might contains (all properties are optional):\n\n#### validator \n\n- `RegExp` The regular exp that input must matches against\n- `Function` Validation function. If `arguments.length === 3`, it will be considered as an async methods\n- `Array.<RegExp|Function>` Group of validations. Asks will check each validator one by one. If validation fails, the rest validators will be skipped.\n- See sections above for details\n\t\n#### setter `Function|Array.<Function>`\n\nSee sections above for details.\n\n#### message `String`\n\nDefault error message\n\n#### default: `String`\n\n\n## `this` object inside validators and setters\n\nInside validators(`rule.validator`) and setters(`rule.setter`), there're several opaque methods\n\n### this.async()\n\nGenerate the `done` function to make the validator or setter become an async method.\n\n\tvar done = this.async();\n\t\nFor details, see the demos above.\n\n### this.get(name)\n\nThe value of the input object by name\n\n### this.set(name, value)\n\nChange the value of the specified property of the input object.\n\n```\n{\n\tusername: {\n\t},\n\t\n\tpassword: {\n\t\tvalidator: function(value){\n\t\t\tvar username = this.get('username');\n\t\t\t\n\t\t\t// Guests are welcome even without passwords\n\t\t\treturn value || username === 'guest';\n\t\t}\n\t}\n}\n```\n\nNotice that you'd better use `this.get` and `this.set` with the `options.parallel` setting as `false`(the default value). Otherwise, it might encounter unexpected situations, because the value of the object is ever changing due to the setter.\n\nSo, use them wisely.\n\n### this.context `Object`\n\nThe `options.context` itself.\n\n\n\n","_id":"checker@0.3.2","dist":{"shasum":"bc4b84036a5699c609e3c627923cb87d8058a79d","tarball":"http://localhost:1337/checker/-/checker-0.3.2.tgz"},"maintainers":[{"name":"kael","email":"i@kael.me"}],"directories":{}},"0.4.2":{"name":"checker","version":"0.4.2","description":"Checker is the collection of common abstract methods for validatiors and setters.","main":"index.js","scripts":{"test":"make test"},"repository":{"type":"git","url":"git://github.com/kaelzhang/node-checker.git"},"keywords":["checker","validator","validate","setter"],"author":{"name":"kael"},"license":"MIT","bugs":{"url":"https://github.com/kaelzhang/node-checker/issues"},"devDependencies":{"mocha":"~1.13.0","chai":"~1.8.0"},"dependencies":{"async":"~0.2.9"},"readme":"[![Build Status](https://travis-ci.org/kaelzhang/node-checker.png?branch=master)](https://travis-ci.org/kaelzhang/node-checker)\n\n# checker\n\nChecker is the collection of common abstract node.js methods for validatiors and setters.\n\t\n# Usage\n```sh\nnpm install checker --save\n```\n\n```js\nvar checker = require('checker');\n```\n\n# Synopsis\n\n```js\nchecker(schema, options).check(data, function(err, value, details){\n});\n```\n\n### err `mixed`\n\n### results `Object`\n\nThe parsed object.\n\n### details `Object`\n\n```\n{\n\t<name>: <detail>\n}\n```\n\n- `detail.value` `mixed` the parsed value\n- `detail.is_default` `Boolean` if the current property is defined in `schema`, but the input data doesn't have it, then the value will be `true`\n- `detail.is_cooked` `Boolean` if there're any setters, it will be `true`\n- `detail.origin` the origin value of the property\n- `detail.error` the error belongs to the current property. If not exists, it will be `null`\n\n\n# Validation, Error Messages\n\n## Simple synchronous validators\n\n```js\nvar schema = {\n\tusername: {\n\t\tvalidator: function(value){\n\t\t\treturn /^[a-zA-Z0-9]{6,}$/.test(value);\n\t\t},\n\t\tmessage: 'Username must only contain letters, numbers; ' \n\t\t\t+ 'Username must contain at least 6 charactors'\n\t}\n};\n\nvar c = checker(schema);\n\nc.check({\n\tusername: 'a'\n}, function(err){\n\tif(err){\n\t\tconsole.log(err); // Then, `schema.username.message` will be displayed.\n\t}\n});\n```\n\n## Regular expressions as validators\n\nThe error hint of the example above is bad, because we want to know the very certain reason why we are wrong.\n\nThe `schema` below is equivalent to the one of the previous section:\n\n```js\n{\n\tvalidator: [\n\t\tfunction(value){\n\t\t\treturn value && value.length > 5;\n\t\t}, \n\t\t/^[a-zA-Z0-9]+$/\n\t],\n\tmessage: [\n\t\t'Username must contain at least 6 charactors', \n\t\t'Username must only contain letters and numbers'\n\t];\n}\n```\n\n## Asynchronous validators\n\n```js\n{\n\tvalidator: function(value){\n\t\tvar done = this.async();\n\t\t// this is an async method, and takes sooooo long...\n\t\tremote_check(value, function(err){\n\t\t\tdone(err); // `err` will pass to the `callback`\n\t\t});\n\t}\n}\n```\n\n\n# Programmatical Details\n\n## Options\n\n#### options.default_message `String`\n\nDefault error message\n\n#### options.parallel `Boolean=false`\n\nBy default, `checker` will check each properties in series, \n\n#### options.limit `Boolean=false`\n\nIf `options.limit` is `true` and a certain property of the input data is not defined in the `schema`, the property will be removed.\n\nDefault to `false`.\n\n#### options.check_all `Boolean=false`\n\nBy default, `checker` will exit immediately at the first error. But if `options.check_all` is `true`, it will parse all the properties, and collect every possible error.\n\n#### options.context `Object`\n\nSee sections below.\n\n## Schema Structures \n\n```js\n{\n\t<name>: <rule>\n}\n```\n\n\nWhere `rule` might contains (all properties are optional):\n\n#### validator \n\n- `RegExp` The regular exp that input must matches against\n- `Function` Validation function. If `arguments.length === 3`, it will be considered as an async methods\n- `Array.<RegExp|Function>` Group of validations. Asks will check each validator one by one. If validation fails, the rest validators will be skipped.\n- See sections above for details\n\t\n#### setter `Function|Array.<Function>`\n\nSee sections above for details.\n\n#### message `String`\n\nDefault error message\n\n#### default: `String`\n\n\n## `this` object inside validators and setters\n\nInside validators(`rule.validator`) and setters(`rule.setter`), there're several opaque methods\n\n### this.async()\n\nGenerate the `done` function to make the validator or setter become an async method.\n\n\tvar done = this.async();\n\t\nFor details, see the demos above.\n\n### this.get(name)\n\nThe value of the input object by name\n\n### this.set(name, value)\n\nChange the value of the specified property of the input object.\n\n```\n{\n\tusername: {\n\t},\n\t\n\tpassword: {\n\t\tvalidator: function(value){\n\t\t\tvar username = this.get('username');\n\t\t\t\n\t\t\t// Guests are welcome even without passwords\n\t\t\treturn value || username === 'guest';\n\t\t}\n\t}\n}\n```\n\nNotice that you'd better use `this.get` and `this.set` with the `options.parallel` setting as `false`(the default value). Otherwise, it might encounter unexpected situations, because the value of the object is ever changing due to the setter.\n\nSo, use them wisely.\n\n### this.context `Object`\n\nThe `options.context` itself.\n\n\n\n","_id":"checker@0.4.2","dist":{"shasum":"7b033fdad0f000f88302ff1f5a8e59d8f466580e","tarball":"http://localhost:1337/checker/-/checker-0.4.2.tgz"},"maintainers":[{"name":"kael","email":"i@kael.me"}],"directories":{}},"0.5.1":{"name":"checker","version":"0.5.1","description":"Checker is the collection of common abstract methods for validatiors and setters.","main":"index.js","scripts":{"test":"make test"},"repository":{"type":"git","url":"git://github.com/kaelzhang/node-checker.git"},"keywords":["checker","validator","validate","setter"],"author":{"name":"kael"},"license":"MIT","bugs":{"url":"https://github.com/kaelzhang/node-checker/issues"},"devDependencies":{"mocha":"~1.13.0","chai":"~1.8.0"},"dependencies":{"async":"~0.2.9"},"readme":"[![Build Status](https://travis-ci.org/kaelzhang/node-checker.png?branch=master)](https://travis-ci.org/kaelzhang/node-checker)\n\n# checker\n\nChecker is the collection of common abstract node.js methods for validatiors and setters.\n\t\n# Usage\n```sh\nnpm install checker --save\n```\n\n```js\nvar checker = require('checker');\n```\n\n# Synopsis\n\n```js\nchecker(schema, options).check(data, function(err, value, details){\n});\n```\n\n### err `mixed`\n\n### results `Object`\n\nThe parsed object.\n\n### details `Object`\n\n```\n{\n\t<name>: <detail>\n}\n```\n\n- `detail.value` `mixed` the parsed value\n- `detail.is_default` `Boolean` if the current property is defined in `schema`, but the input data doesn't have it, then the value will be `true`\n- `detail.is_cooked` `Boolean` if there're any setters, it will be `true`\n- `detail.origin` the origin value of the property\n- `detail.error` the error belongs to the current property. If not exists, it will be `null`\n\n\n# Validation, Error Messages\n\n## Simple synchronous validators\n\n```js\nvar schema = {\n\tusername: {\n\t\tvalidator: function(value){\n\t\t\treturn /^[a-zA-Z0-9]{6,}$/.test(value);\n\t\t},\n\t\tmessage: 'Username must only contain letters, numbers; ' \n\t\t\t+ 'Username must contain at least 6 charactors'\n\t}\n};\n\nvar c = checker(schema);\n\nc.check({\n\tusername: 'a'\n}, function(err){\n\tif(err){\n\t\tconsole.log(err); // Then, `schema.username.message` will be displayed.\n\t}\n});\n```\n\n## Regular expressions as validators\n\nThe error hint of the example above is bad, because we want to know the very certain reason why we are wrong.\n\nThe `schema` below is equivalent to the one of the previous section:\n\n```js\n{\n\tvalidator: [\n\t\tfunction(value){\n\t\t\treturn value && value.length > 5;\n\t\t}, \n\t\t/^[a-zA-Z0-9]+$/\n\t],\n\tmessage: [\n\t\t'Username must contain at least 6 charactors', \n\t\t'Username must only contain letters and numbers'\n\t];\n}\n```\n\n## Asynchronous validators\n\n```js\n{\n\tvalidator: function(value){\n\t\tvar done = this.async();\n\t\t// this is an async method, and takes sooooo long...\n\t\tremote_check(value, function(err){\n\t\t\tdone(err); // `err` will pass to the `callback`\n\t\t});\n\t}\n}\n```\n\n\n# Programmatical Details\n\n## Options\n\n#### options.default_message `String`\n\nDefault error message\n\n#### options.parallel `Boolean=false`\n\nBy default, `checker` will check each properties in series, \n\n#### options.limit `Boolean=false`\n\nIf `options.limit` is `true` and a certain property of the input data is not defined in the `schema`, the property will be removed.\n\nDefault to `false`.\n\n#### options.check_all `Boolean=false`\n\nBy default, `checker` will exit immediately at the first error. But if `options.check_all` is `true`, it will parse all the properties, and collect every possible error.\n\n#### options.context `Object`\n\nSee sections below.\n\n## Schema Structures \n\n```js\n{\n\t<name>: <rule>\n}\n```\n\n\nWhere `rule` might contains (all properties are optional):\n\n#### validator \n\n- `RegExp` The regular exp that input must matches against\n- `Function` Validation function. If `arguments.length === 3`, it will be considered as an async methods\n- `Array.<RegExp|Function>` Group of validations. Asks will check each validator one by one. If validation fails, the rest validators will be skipped.\n- See sections above for details\n\t\n#### setter `Function|Array.<Function>`\n\nSee sections above for details.\n\n#### message `String`\n\nDefault error message\n\n#### default: `String`\n\n\n## `this` object inside validators and setters\n\nInside validators(`rule.validator`) and setters(`rule.setter`), there're several opaque methods\n\n### this.async()\n\nGenerate the `done` function to make the validator or setter become an async method.\n\n\tvar done = this.async();\n\t\nFor details, see the demos above.\n\n### this.get(name)\n\nThe value of the input object by name\n\n### this.set(name, value)\n\nChange the value of the specified property of the input object.\n\n```\n{\n\tusername: {\n\t},\n\t\n\tpassword: {\n\t\tvalidator: function(value){\n\t\t\tvar username = this.get('username');\n\t\t\t\n\t\t\t// Guests are welcome even without passwords\n\t\t\treturn value || username === 'guest';\n\t\t}\n\t}\n}\n```\n\nNotice that you'd better use `this.get` and `this.set` with the `options.parallel` setting as `false`(the default value). Otherwise, it might encounter unexpected situations, because the value of the object is ever changing due to the setter.\n\nSo, use them wisely.\n\n### this.context `Object`\n\nThe `options.context` itself.\n\n\n\n","readmeFilename":"README.md","_id":"checker@0.5.1","dist":{"shasum":"fef66f63d231ae2910f7dd7df291912a1e95e5d7","tarball":"http://localhost:1337/checker/-/checker-0.5.1.tgz"},"_from":".","_npmVersion":"1.3.11","_npmUser":{"name":"kael","email":"i@kael.me"},"maintainers":[{"name":"kael","email":"i@kael.me"}],"directories":{}},"0.5.2":{"name":"checker","version":"0.5.2","description":"Checker is the collection of common abstract methods for validatiors and setters.","main":"index.js","scripts":{"test":"make test"},"repository":{"type":"git","url":"git://github.com/kaelzhang/node-checker.git"},"keywords":["checker","validator","validate","setter"],"author":{"name":"kael"},"license":"MIT","bugs":{"url":"https://github.com/kaelzhang/node-checker/issues"},"devDependencies":{"mocha":"~1.13.0","chai":"~1.8.0"},"dependencies":{"async":"~0.2.9"},"readme":"[![NPM version](https://badge.fury.io/js/checker.png)](http://badge.fury.io/js/checker)\n[![Build Status](https://travis-ci.org/kaelzhang/node-checker.png?branch=master)](https://travis-ci.org/kaelzhang/node-checker)\n[![Dependency Status](https://gemnasium.com/kaelzhang/node-checker.png)](https://gemnasium.com/kaelzhang/node-checker)\n\n# checker\n\nChecker is the collection of common abstract node.js methods for validatiors and setters.\n\t\n# Usage\n```sh\nnpm install checker --save\n```\n\n```js\nvar checker = require('checker');\n```\n\n# Synopsis\n\n```js\nchecker(schema, options).check(data, function(err, value, details){\n});\n```\n\n### err `mixed`\n\n### results `Object`\n\nThe parsed object.\n\n### details `Object`\n\n```\n{\n\t<name>: <detail>\n}\n```\n\n- `detail.value` `mixed` the parsed value\n- `detail.is_default` `Boolean` if the current property is defined in `schema`, but the input data doesn't have it, then the value will be `true`\n- `detail.is_cooked` `Boolean` if there're any setters, it will be `true`\n- `detail.origin` the origin value of the property\n- `detail.error` the error belongs to the current property. If not exists, it will be `null`\n\n\n# Validation, Error Messages\n\n## Simple synchronous validators\n\n```js\nvar schema = {\n\tusername: {\n\t\tvalidator: function(value){\n\t\t\treturn /^[a-zA-Z0-9]{6,}$/.test(value);\n\t\t},\n\t\tmessage: 'Username must only contain letters, numbers; ' \n\t\t\t+ 'Username must contain at least 6 charactors'\n\t}\n};\n\nvar c = checker(schema);\n\nc.check({\n\tusername: 'a'\n}, function(err){\n\tif(err){\n\t\tconsole.log(err); // Then, `schema.username.message` will be displayed.\n\t}\n});\n```\n\n## Regular expressions as validators\n\nThe error hint of the example above is bad, because we want to know the very certain reason why we are wrong.\n\nThe `schema` below is equivalent to the one of the previous section:\n\n```js\n{\n\tvalidator: [\n\t\tfunction(value){\n\t\t\treturn value && value.length > 5;\n\t\t}, \n\t\t/^[a-zA-Z0-9]+$/\n\t],\n\tmessage: [\n\t\t'Username must contain at least 6 charactors', \n\t\t'Username must only contain letters and numbers'\n\t];\n}\n```\n\n## Asynchronous validators\n\n```js\n{\n\tvalidator: function(value){\n\t\tvar done = this.async();\n\t\t// this is an async method, and takes sooooo long...\n\t\tremote_check(value, function(err){\n\t\t\tdone(err); // `err` will pass to the `callback`\n\t\t});\n\t}\n}\n```\n\n\n# Programmatical Details\n\n## Options\n\n#### options.default_message `String`\n\nDefault error message\n\n#### options.parallel `Boolean=false`\n\nBy default, `checker` will check each properties in series, \n\n#### options.limit `Boolean=false`\n\nIf `options.limit` is `true` and a certain property of the input data is not defined in the `schema`, the property will be removed.\n\nDefault to `false`.\n\n#### options.check_all `Boolean=false`\n\nBy default, `checker` will exit immediately at the first error. But if `options.check_all` is `true`, it will parse all the properties, and collect every possible error.\n\n#### options.context `Object`\n\nSee sections below.\n\n## Schema Structures \n\n```js\n{\n\t<name>: <rule>\n}\n```\n\n\nWhere `rule` might contains (all properties are optional):\n\n#### validator \n\n- `RegExp` The regular exp that input must matches against\n- `Function` Validation function. If `arguments.length === 3`, it will be considered as an async methods\n- `Array.<RegExp|Function>` Group of validations. Asks will check each validator one by one. If validation fails, the rest validators will be skipped.\n- See sections above for details\n\t\n#### setter `Function|Array.<Function>`\n\nSee sections above for details.\n\n#### message `String`\n\nDefault error message\n\n#### default: `String`\n\n\n## `this` object inside validators and setters\n\nInside validators(`rule.validator`) and setters(`rule.setter`), there're several opaque methods\n\n### this.async()\n\nGenerate the `done` function to make the validator or setter become an async method.\n\n\tvar done = this.async();\n\t\nFor details, see the demos above.\n\n### this.get(name)\n\nThe value of the input object by name\n\n### this.set(name, value)\n\nChange the value of the specified property of the input object.\n\n```\n{\n\tusername: {\n\t},\n\t\n\tpassword: {\n\t\tvalidator: function(value){\n\t\t\tvar username = this.get('username');\n\t\t\t\n\t\t\t// Guests are welcome even without passwords\n\t\t\treturn value || username === 'guest';\n\t\t}\n\t}\n}\n```\n\nNotice that you'd better use `this.get` and `this.set` with the `options.parallel` setting as `false`(the default value). Otherwise, it might encounter unexpected situations, because the value of the object is ever changing due to the setter.\n\nSo, use them wisely.\n\n### this.context `Object`\n\nThe `options.context` itself.\n\n\n\n","readmeFilename":"README.md","_id":"checker@0.5.2","dist":{"shasum":"c27a36bf00f3a7a3d24a8fbc7853f06fce4e9c86","tarball":"http://localhost:1337/checker/-/checker-0.5.2.tgz"},"_from":".","_npmVersion":"1.3.11","_npmUser":{"name":"kael","email":"i@kael.me"},"maintainers":[{"name":"kael","email":"i@kael.me"}],"directories":{}}},"readme":"ERROR: No README data found!","maintainers":[{"name":"kael","email":"i@kael.me"}],"time":{"modified":"2013-10-17T03:05:51.738Z","created":"2013-10-07T13:53:26.836Z","0.0.0":"2013-10-07T14:00:18.706Z","0.2.1":"2013-10-08T13:10:06.237Z","0.3.1":"2013-10-08T14:00:33.456Z","0.3.2":"2013-10-08T14:36:07.451Z","0.4.2":"2013-10-09T10:02:48.711Z","0.5.1":"2013-10-09T16:43:25.048Z","0.5.2":"2013-10-17T03:05:51.738Z"},"author":{"name":"kael"},"repository":{"type":"git","url":"git://github.com/kaelzhang/node-checker.git"},"_attachments":{}} \ No newline at end of file