{"maintainers":[{"name":"anonymous","email":"yo@contra.io"},{"name":"anonymous","email":"blaine.bublitz@gmail.com"}],"keywords":["options","functions","resolver","type","configuration","config","opts","opt","default"],"dist-tags":{"latest":"2.0.0"},"author":{"name":"Gulp Team","email":"team@gulpjs.com","url":"http://gulpjs.com/"},"description":"Resolve an options object based on configuration.","readme":"<p align=\"center\">\n  <a href=\"https://gulpjs.com\">\n    <img height=\"257\" width=\"114\" src=\"https://raw.githubusercontent.com/gulpjs/artwork/master/gulp-2x.png\">\n  </a>\n</p>\n\n# resolve-options\n\n[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][ci-image]][ci-url] [![Coveralls Status][coveralls-image]][coveralls-url]\n\nResolve an options object based on configuration.\n\n## Usage\n\n```js\n// This example assumes a Vinyl file\n\nvar createResolver = require('resolve-options');\n\nvar config = {\n  cwd: {\n    type: 'string',\n    default: process.cwd,\n  },\n  sourcemaps: {\n    type: 'boolean',\n    default: false,\n  },\n  since: {\n    type: ['date', 'number'],\n  },\n  read: {\n    type: 'boolean',\n  },\n};\n\nvar options = {\n  sourcemaps: true,\n  since: Date.now(),\n  read: function (file) {\n    return file.extname !== '.mp4';\n  },\n};\n\nvar resolver = createResolver(config, options);\n\nvar cwd = resolver.resolve('cwd', file);\n// cwd === process.cwd()\n\nvar sourcemaps = resolver.resolve('sourcemaps', file);\n// sourcemaps === true\n\nvar read = resolver.resolve('read', file);\n// Given .mp4, read === false\n// Given .txt, read === true\n```\n\n## API\n\n### `createResolver([config,] [options])`\n\nTakes a `config` object that describes the options to accept/resolve and an `options` object (usually passed by a user) to resolve against the `config`. Returns a `resolver` that contains a `resolve` method for realtime resolution of options.\n\nThe `config` object takes the following structure:\n\n```graphql\nconfig {\n  [optionKey] {\n    type // string, array or function\n    default // any value or function\n  }\n}\n```\n\nEach option is represented by its `optionKey` in the `config` object. It must be an object with a `type` property.\n\nThe `type` property must be a string, array or function which will be passed to the [`value-or-function`][value-or-function] module (functions will be bound to the resolver to allow for dependent options).\n\nA `default` property may also be specified as a fallback if the option isn't available or is invalid. The `default` value can be any value or a function (functions will be bound to the resolver to allow for dependent defaults). **Note:** `default` values are not type-validated by the `value-or-function` module.\n\n### `resolver.resolve(optionKey, [...arguments])`\n\nTakes an `optionKey` string and any number of `arguments` to apply if an option is a function. Returns the resolved value for the `optionKey`.\n\n### `resolver.resolveConstant(optionKey)`\n\nLike `resolve`, but only returns a value if the option is constant (not a function).\n\n## License\n\nMIT\n\n<!-- prettier-ignore-start -->\n[downloads-image]: https://img.shields.io/npm/dm/resolve-options.svg?style=flat-square\n[npm-url]: https://npmjs.com/package/resolve-options\n[npm-image]: https://img.shields.io/npm/v/resolve-options.svg?style=flat-square\n\n[ci-url]: https://github.com/gulpjs/resolve-options/actions?query=workflow:dev\n[ci-image]: https://img.shields.io/github/workflow/status/gulpjs/resolve-options/dev?style=flat-square\n\n[coveralls-url]: https://coveralls.io/r/gulpjs/resolve-options\n[coveralls-image]: https://img.shields.io/coveralls/gulpjs/resolve-options/master.svg?style=flat-square\n<!-- prettier-ignore-end -->\n\n<!-- prettier-ignore-start -->\n[value-or-function]: https://github.com/gulpjs/value-or-function\n<!-- prettier-ignore-end -->\n","repository":{"type":"git","url":"git+https://github.com/gulpjs/resolve-options.git"},"bugs":{"url":"https://github.com/gulpjs/resolve-options/issues"},"license":"MIT","versions":{"1.0.0":{"name":"resolve-options","version":"1.0.0","description":"Resolve an options object based on configuration.","author":{"name":"Gulp Team","email":"team@gulpjs.com","url":"http://gulpjs.com/"},"contributors":[{"name":"Blaine Bublitz","email":"blaine.bublitz@gmail.com"}],"repository":{"type":"git","url":"git+https://github.com/gulpjs/resolve-options.git"},"license":"MIT","engines":{"node":">= 0.10"},"main":"index.js","files":["LICENSE","index.js"],"scripts":{"lint":"eslint index.js test/ && jscs index.js test/","pretest":"npm run lint","test":"mocha --async-only","cover":"istanbul cover _mocha --report lcovonly","coveralls":"npm run cover && istanbul-coveralls"},"dependencies":{"koalas":"^1.0.2","value-or-function":"^2.0.0"},"devDependencies":{"eslint":"^1.10.3","eslint-config-gulp":"^2.0.0","expect":"^1.20.2","istanbul":"^0.4.3","istanbul-coveralls":"^1.0.3","jscs":"^2.4.0","jscs-preset-gulp":"^1.0.0","mocha":"^3.2.0"},"keywords":["options","functions","resolver","type","configuration","config","opts","opt","default"],"gitHead":"4fbb627195e3870bed6603843241b04b7eaab4bf","bugs":{"url":"https://github.com/gulpjs/resolve-options/issues"},"homepage":"https://github.com/gulpjs/resolve-options#readme","_id":"resolve-options@1.0.0","_shasum":"bc59048d8ec3442d444b876ef4e83d28bb2a3206","_from":".","_npmVersion":"2.15.2","_nodeVersion":"0.10.41","_npmUser":{"name":"anonymous","email":"blaine.bublitz@gmail.com"},"maintainers":[{"name":"anonymous","email":"blaine.bublitz@gmail.com"}],"dist":{"shasum":"bc59048d8ec3442d444b876ef4e83d28bb2a3206","tarball":"http://repository.ncinga.com/nexus/content/repositories/npm-js-registry/resolve-options/-/resolve-options-1.0.0.tgz","integrity":"sha512-BzPs/LO5imPmJdHHJJO/ao3FoLuzCnj3RBoJ2QpCdW4+0ZYGmkoH0nJ4BoJm1AwLpFAnOJ0sOpVOl3S+6SmQ2g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD2WjQN3BldSO0CAc4jnUOi3b+GSjuw8lNwdyIhilq9NgIhAIx1USbb7D2Sa2RdG9+4wdOWJMtItRJ8fn4fEl9wqlT5"}]},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/resolve-options-1.0.0.tgz_1497297017756_0.06147619755938649"},"directories":{}},"1.1.0":{"name":"resolve-options","version":"1.1.0","description":"Resolve an options object based on configuration.","author":{"name":"Gulp Team","email":"team@gulpjs.com","url":"http://gulpjs.com/"},"contributors":[{"name":"Blaine Bublitz","email":"blaine.bublitz@gmail.com"}],"repository":{"type":"git","url":"git+https://github.com/gulpjs/resolve-options.git"},"license":"MIT","engines":{"node":">= 0.10"},"main":"index.js","files":["LICENSE","index.js"],"scripts":{"lint":"eslint index.js test/ && jscs index.js test/","pretest":"npm run lint","test":"mocha --async-only","cover":"istanbul cover _mocha --report lcovonly","coveralls":"npm run cover && istanbul-coveralls"},"dependencies":{"value-or-function":"^3.0.0"},"devDependencies":{"eslint":"^1.10.3","eslint-config-gulp":"^2.0.0","expect":"^1.20.2","istanbul":"^0.4.3","istanbul-coveralls":"^1.0.3","jscs":"^2.4.0","jscs-preset-gulp":"^1.0.0","mocha":"^3.2.0"},"keywords":["options","functions","resolver","type","configuration","config","opts","opt","default"],"gitHead":"0ef703616063c32751b66085732abfe5306d91a6","bugs":{"url":"https://github.com/gulpjs/resolve-options/issues"},"homepage":"https://github.com/gulpjs/resolve-options#readme","_id":"resolve-options@1.1.0","_shasum":"32bb9e39c06d67338dc9378c0d6d6074566ad131","_from":".","_npmVersion":"2.15.1","_nodeVersion":"0.10.48","_npmUser":{"name":"anonymous","email":"blaine.bublitz@gmail.com"},"maintainers":[{"name":"anonymous","email":"blaine.bublitz@gmail.com"}],"dist":{"shasum":"32bb9e39c06d67338dc9378c0d6d6074566ad131","tarball":"http://repository.ncinga.com/nexus/content/repositories/npm-js-registry/resolve-options/-/resolve-options-1.1.0.tgz","npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh25v/CRA9TVsSAnZWagAA6CkP/jv5/zzlybj4MnDo0jYy\niO7kNzxk3PsIJkx8Fs7FLjpMovcdkaSmSUmFMfBVG4aMwWomNKhDsIZWkC0y\nYUDJNZxlsBz0wRxP7jNdknoHbLR/wfABnFNLZFRFZLgzrXghKVzpkoev6Iog\nvYT0yADlG/xkkVs7q9GePoMACzPwNwHRTI4qiQS/gz0JAAr0+xDWaa8rNsWw\nlzRD0Be+NmEQIuKut06FqVtd6ZUITxEH+VYU5KgMlt48wchevgAmExNupwj2\na/DRMmVqwVPn9abLlNg/nEoxtPcJT9zsAGxtgHL+qDtGE2Y+zPHlZvGKvbpv\nZApRvvY8WIOC3juVvUFMsFolIdLQxKUXJ+eHrxu5BoSI9EZFElEgnzU63ABK\nzNRcX4jqvFbKWL9K6ZYzLK60PkgWEp9OkDofgObkMRYCfYsMARRiXzFKqd1I\nuAIQDQMtX3ntMLg3TwShS+lTfIDGUfvHuuvJybssly1kN1ywCYALMqE/Bit/\n6FNS9OaNxL6Go/GSQQa++7KmUSsYofW3XJ0oNzdwglLx6J5ArLtU2FswoVln\nZAOmr1OsqSpzsCOWEoaomZSn97qKKjEBSfmfIaDuy6MZ5j4y0Q47fnzDyA+N\na+jH0HN1RTKaeonmJI/EVvWBHOJbeL4fg+D+NgpbI7UfGZsCA5813W4Fkq+q\nG7NM\r\n=o7bs\r\n-----END PGP SIGNATURE-----\r\n","integrity":"sha512-NYDgziiroVeDC29xq7bp/CacZERYsA9bXYd1ZmcJlF3BcrZv5pTb4NG7SjdyKDnXZ84aC4vo2u6sNKIA1LCu/A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHGH8Nlx3eNJOnxkDA7YI+WRYFlGyze/EWH+jZB6F1GcAiEAisUT/pCq7hwGtcIUk20t7RM1wRAFkiRmej9EIqZR5V8="}]},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/resolve-options-1.1.0.tgz_1503109972338_0.7202406944707036"},"directories":{}},"2.0.0":{"name":"resolve-options","version":"2.0.0","description":"Resolve an options object based on configuration.","author":{"name":"Gulp Team","email":"team@gulpjs.com","url":"http://gulpjs.com/"},"contributors":[{"name":"Blaine Bublitz","email":"blaine.bublitz@gmail.com"}],"repository":{"type":"git","url":"git+https://github.com/gulpjs/resolve-options.git"},"license":"MIT","engines":{"node":">= 10.13.0"},"main":"index.js","scripts":{"lint":"eslint .","pretest":"npm run lint","test":"nyc mocha --async-only"},"dependencies":{"value-or-function":"^4.0.0"},"devDependencies":{"eslint":"^7.32.0","eslint-config-gulp":"^5.0.1","eslint-plugin-node":"^11.1.0","expect":"^27.5.1","mocha":"^8.4.0","nyc":"^15.1.0"},"nyc":{"reporter":["lcov","text-summary"]},"prettier":{"singleQuote":true},"keywords":["options","functions","resolver","type","configuration","config","opts","opt","default"],"gitHead":"b056ffca3975b7fffcc5ed356ac3c311d3a926f9","bugs":{"url":"https://github.com/gulpjs/resolve-options/issues"},"homepage":"https://github.com/gulpjs/resolve-options#readme","_id":"resolve-options@2.0.0","_nodeVersion":"16.14.2","_npmVersion":"8.11.0","dist":{"integrity":"sha512-/FopbmmFOQCfsCx77BRFdKOniglTiHumLgwvd6IDPihy1GKkadZbgQJBcTb2lMzSR1pndzd96b1nZrreZ7+9/A==","shasum":"a1a57a9949db549dd075de3f5550675f02f1e4c5","tarball":"http://repository.ncinga.com/nexus/content/repositories/npm-js-registry/resolve-options/-/resolve-options-2.0.0.tgz","fileCount":4,"unpackedSize":7874,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEh/nEH+4dauNm2Z5KzttoprHjK08QWGgwFXn3H1j7WEAiEAygCxatGBVV4kE5AKv+jVOTb2GYXvfxIHr2Ny+8WG5E8="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJitk1WACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrDPg/+K8CcnWlp8ktLdKatKFVR3EE/Elpt5+s1Rf2SeCxhBWktzBnx\r\nZ2mkvlRDAmeWOwI3s1teNRUwW5+4nHmokuzFr+duHCDtarlE10qGsu261Rce\r\nfixNWfEh5JycEXcGol2V3639IPdIsc6PwiaBIylsrZV3bZdVlrXLhkeikB27\r\nTwb68UcFdS6VaeV7KS11/4Oj/5VBSbzhPWhtceSTCDuL19/4+J1QyRtulZEq\r\nFxGnWippNri8E0B1SPoaEVjAblmKzy0g0Yz4rUg26dqqVYUGQFIu2AwGTkNQ\r\n67XOc3ZGJdTmCw86CAg5xGstooY147UXSexc252SRZGUmWFjPolQVeCa22hX\r\nrd7u7iFAaxjANdDlTp3fS4yRvcazIsv2LeNdSlf7bpjnq7dY04sGgujJg7ze\r\nb8uFQTH8MdQhL5LJD5c9b6Tx1s3xEUHDyvWXmKJYAkdscj9/l4T1tk5BmZgr\r\niEuyE0YTfufr2XEHz1Ho8GYnZAD4YB0g7f37Bgwwsl5i+9cFlI7FiwmbN+3J\r\nrO/ECZNYDpWEBq3wkWTWvZPiMOvsFfPpqWpx3URnOzASXkCNTyTNqAIML3vz\r\n7dMbHx9t0fv9QeY9zoW1RumcENlQXz/KWZxoxA+5Xjam64SUQDWAVWwhQLuc\r\n8+UVvcCBCZcrGaXKm2WZCo9wn4KJ1lWX7ds=\r\n=qZQ6\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"anonymous","email":"blaine.bublitz@gmail.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"yo@contra.io"},{"name":"anonymous","email":"blaine.bublitz@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/resolve-options_2.0.0_1656114518056_0.6518400814838576"},"_hasShrinkwrap":false}},"name":"resolve-options","time":{"modified":"2022-06-26T11:52:56.077Z","created":"2017-06-12T19:50:17.883Z","1.0.0":"2017-06-12T19:50:17.883Z","1.1.0":"2017-08-19T02:32:52.482Z","2.0.0":"2022-06-24T23:48:38.202Z"},"contributors":[{"name":"Blaine Bublitz","email":"blaine.bublitz@gmail.com"}],"readmeFilename":"README.md","homepage":"https://github.com/gulpjs/resolve-options#readme"}