{"_id":"glob-option-error","_rev":"4-3f17ce450d4ff4b31d435e3fb99aaa44","name":"glob-option-error","description":"Create an error from the result of validate-glob-opts","dist-tags":{"latest":"1.0.0"},"versions":{"0.0.0":{"name":"glob-option-error","version":"0.0.0","description":"Create an error from the result of validate-glob-opts","repository":{"type":"git","url":"git+https://github.com/shinnn/glob-option-error.git"},"author":{"name":"Shinnosuke Watanabe","url":"https://github.com/shinnn"},"scripts":{"pretest":"eslint --fix --format=codeframe index.js test.js","test":"node --throw-deprecation test.js","coverage":"istanbul cover --print=both test.js"},"license":"MIT","files":["index.js"],"keywords":["glob","option","options","validate","validation","invalidate","check","type","error","strict"],"devDependencies":{"@shinnn/eslint-config-node":"^3.0.0","eslint":"^3.15.0","graceful-fs":"^4.1.11","istanbul":"^0.4.5","tape":"^4.6.3","validate-glob-opts":"^0.4.0"},"eslintConfig":{"extends":"@shinnn/node"},"bugs":{"url":"https://github.com/shinnn/glob-option-error/issues"},"homepage":"https://github.com/shinnn/glob-option-error#readme","_id":"glob-option-error@0.0.0","_shasum":"b625ecb1ce18215eaebcd38d5d39acc681433107","_from":".","_npmVersion":"4.1.2","_nodeVersion":"7.5.0","_npmUser":{"name":"shinnn","email":"snnskwtnb@gmail.com"},"dist":{"shasum":"b625ecb1ce18215eaebcd38d5d39acc681433107","tarball":"https://registry.npmjs.org/glob-option-error/-/glob-option-error-0.0.0.tgz","integrity":"sha512-l1kFyy7jk/P1YhkcVHrqjy1HYq5g6cnMio3sAArecCDLNJGK59AYdgO6f/7KSMqctNY6mve4d12Psg1A7iUEgA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICb7vgZMDx50On8DbgCXgcvYuEGBkcIZKZe6bdscJlw3AiEAtVJBYP1oTeDMb6zeuN+JLw0A9zZie8L/HiMOHMEJ2lM="}]},"maintainers":[{"name":"shinnn","email":"snnskwtnb@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/glob-option-error-0.0.0.tgz_1486382345599_0.879455434391275"}},"0.1.0":{"name":"glob-option-error","version":"0.1.0","description":"Create an error from the result of validate-glob-opts","repository":{"type":"git","url":"git+https://github.com/shinnn/glob-option-error.git"},"author":{"name":"Shinnosuke Watanabe","url":"https://github.com/shinnn"},"scripts":{"pretest":"eslint --fix --format=codeframe index.js test.js","test":"node --throw-deprecation test.js","coverage":"istanbul cover --print=both test.js"},"license":"MIT","files":["index.js"],"keywords":["glob","option","options","validate","validation","invalidate","check","type","error","strict"],"devDependencies":{"@shinnn/eslint-config-node":"^3.0.0","eslint":"^3.15.0","graceful-fs":"^4.1.11","istanbul":"^0.4.5","tape":"^4.6.3","validate-glob-opts":"^0.4.0"},"eslintConfig":{"extends":"@shinnn/node"},"gitHead":"f22e05f14eb6e61c366cf6dd4f28814fb27ce1d2","bugs":{"url":"https://github.com/shinnn/glob-option-error/issues"},"homepage":"https://github.com/shinnn/glob-option-error#readme","_id":"glob-option-error@0.1.0","_shasum":"3d6c34cb629bc6e1cecf87edf6275d64ce363bff","_from":".","_npmVersion":"4.1.2","_nodeVersion":"7.5.0","_npmUser":{"name":"shinnn","email":"snnskwtnb@gmail.com"},"dist":{"shasum":"3d6c34cb629bc6e1cecf87edf6275d64ce363bff","tarball":"https://registry.npmjs.org/glob-option-error/-/glob-option-error-0.1.0.tgz","integrity":"sha512-vcTn039vCKyPmoKmiafZUCCVnqsFlGGCPk/ZMbh/5LQsDqk8iN9COxotB1aU2EBS2FIkyvgyQ86KUyJtO3pTNg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQClXg/ejlxs23Gt0bmVeAqLKpfTlrXUSs3k+esk03dTwwIhAKgMbP0FDUZyb5mxl+YYRbo/SQxgx6RkBsIdXLp0g/EQ"}]},"maintainers":[{"name":"shinnn","email":"snnskwtnb@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/glob-option-error-0.1.0.tgz_1486382947127_0.4915274705272168"}},"1.0.0":{"name":"glob-option-error","version":"1.0.0","description":"Create an error from the result of validate-glob-opts","repository":{"type":"git","url":"git+https://github.com/shinnn/glob-option-error.git"},"author":{"name":"Shinnosuke Watanabe","url":"https://github.com/shinnn"},"scripts":{"pretest":"eslint --fix --format=codeframe index.js test.js","test":"node --throw-deprecation test.js","coverage":"istanbul cover --print=both test.js"},"license":"MIT","files":["index.js"],"keywords":["glob","option","options","validate","validation","invalidate","check","type","error","strict"],"devDependencies":{"@shinnn/eslint-config-node":"^3.0.0","eslint":"^3.16.0","graceful-fs":"^4.1.11","istanbul":"^0.4.5","tape":"^4.6.3","validate-glob-opts":"^0.4.0"},"eslintConfig":{"extends":"@shinnn/node"},"gitHead":"9164500f5612c9f5f8bd2557da4679a88c01a953","bugs":{"url":"https://github.com/shinnn/glob-option-error/issues"},"homepage":"https://github.com/shinnn/glob-option-error#readme","_id":"glob-option-error@1.0.0","_shasum":"57cc65def9c7d5c1461baf13129bb5403cff6176","_from":".","_npmVersion":"4.2.0","_nodeVersion":"7.5.0","_npmUser":{"name":"shinnn","email":"snnskwtnb@gmail.com"},"dist":{"shasum":"57cc65def9c7d5c1461baf13129bb5403cff6176","tarball":"https://registry.npmjs.org/glob-option-error/-/glob-option-error-1.0.0.tgz","integrity":"sha512-AD7lbWbwF2Ii9gBQsQIOEzwuqP/jsnyvK27/3JDq1kn/JyfDtYI6AWz3ZQwcPuQdHSBcFh+A2yT/SEep27LOGg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDorRK99YLGCDvlZGGEXEaGnWT+7+hkbR3W18MySkQNaAIgag+X2EiM4X303kJQfjJC4gtL43EZB8sLz5GIVv2rAj8="}]},"maintainers":[{"name":"shinnn","email":"snnskwtnb@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/glob-option-error-1.0.0.tgz_1487673215087_0.5204861334059387"}}},"readme":"# glob-option-error\n\n[![NPM version](https://img.shields.io/npm/v/glob-option-error.svg)](https://www.npmjs.com/package/glob-option-error)\n[![Build Status](https://travis-ci.org/shinnn/glob-option-error.svg?branch=master)](https://travis-ci.org/shinnn/glob-option-error)\n[![Coverage Status](https://img.shields.io/coveralls/shinnn/glob-option-error.svg)](https://coveralls.io/r/shinnn/glob-option-error)\n\nCreate an error from the result of [validate-glob-opts](https://github.com/shinnn/validate-glob-opts)\n\n```javascript\nconst GlobOptionError = require('glob-option-error');\nconst validateGlobOpts = require('validate-glob-opts');\n\nnew GlobOptionError(validateGlobOpts({\n  sync: true,\n  mark: '/',\n  caches: {}\n}));\n/* => Error: 3 errors found in the glob options:\n  1. `sync` option is deprecated and there’s no need to pass any values to that option, but true was provided.\n  2. node-glob expected `mark` option to be a Boolean value, but got '/'.\n  3. node-glob doesn't have `caches` option. Probably you meant `cache`.\n    at new GlobOptionError (/Users/me/exmaple/node_modules/glob-option-error/index.js:33:17)\n    at Object.<anonymous> (/Users/me/exmaple/app.js:2:13)\n    at Module._compile (module.js:571:32)\n    at Object.Module._extensions..js (module.js:580:10)\n    ...\n*/\n```\n\n## Installation\n\n[Use npm.](https://docs.npmjs.com/cli/install)\n\n```\nnpm install glob-option-error\n```\n\n## API\n\n```javascript\nconst GlobOptionError = require('glob-option-error');\n```\n\n### GlobOptionError(*array*)\n\n*array*: `Array<error>` (return value of [validate-glob-opts](https://github.com/shinnn/validate-glob-opts#api))  \nReturn: `Error` with an [iterator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) that returns the individual errors one by one\n\n```javascript\nconst GlobOptionError = require('glob-option-error');\nconst validateGlobOpts = require('validate-glob-opts');\n\nconst results = validateGlobOpts({\n  root: Buffer.from('Hi'),\n  nodir: NaN,\n  ignore: ['path1', 1]\n});\n/*=> [\n  TypeError: node-glob expected `root` option to be a directory path (string), but got <Buffer 48 69>.,\n  TypeError: node-glob expected `nodir` option to be a Boolean value, but got NaN.,\n  TypeError: Expected every value in the `ignore` option to be a string, but the array includes a non-string value 1.\n] */\n\nconst error = new GlobOptionError(results); //=> TypeError: 3 errors found in the glob options: ...\n\nfor (const {message} of error) {\n  console.log(message);\n  // node-glob expected `root` option to be a directory path (string), but got <Buffer 48 69>.\n  // node-glob expected `nodir` option to be a Boolean value, but got NaN.\n  // Expected every value in the `ignore` option to be a string, but the array includes a non-string value 1.\n}\n```\n\nThe argument must include at least one element.\n\n```javascript\nnew GlobOptionError([]);\n// throws a RangeError: Expected an array with at least one error, but got [] (empty array).\n```\n\n## License\n\nCopyright (c) 2017 [Shinnosuke Watanabe](https://github.com/shinnn)\n\nLicensed under [the MIT License](./LICENSE).\n","maintainers":[{"name":"shinnn","email":"snnskwtnb@gmail.com"}],"time":{"modified":"2022-06-18T12:54:20.817Z","created":"2017-02-06T11:59:05.840Z","0.0.0":"2017-02-06T11:59:05.840Z","0.1.0":"2017-02-06T12:09:07.381Z","1.0.0":"2017-02-21T10:33:35.310Z"},"homepage":"https://github.com/shinnn/glob-option-error#readme","keywords":["glob","option","options","validate","validation","invalidate","check","type","error","strict"],"repository":{"type":"git","url":"git+https://github.com/shinnn/glob-option-error.git"},"author":{"name":"Shinnosuke Watanabe","url":"https://github.com/shinnn"},"bugs":{"url":"https://github.com/shinnn/glob-option-error/issues"},"license":"MIT","readmeFilename":"README.md"}