{"_id":"wrap-options","_rev":"5-bc4a60fa5366f73e4e7936441e08ae2d","name":"wrap-options","description":"constructor options utility","dist-tags":{"latest":"0.0.3"},"versions":{"0.0.0":{"name":"wrap-options","version":"0.0.0","description":"constructor options utility","main":"index.js","repository":{"type":"git","url":"git+https://github.com/fgascon/wrap-options.git"},"keywords":["options"],"author":{"name":"fgascon","email":"frederic.gascon@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/fgascon/wrap-options/issues"},"homepage":"https://github.com/fgascon/wrap-options#readme","gitHead":"6883dfb6381e1155ebf5b784b37afb61ecfbc8a5","_id":"wrap-options@0.0.0","scripts":{},"_shasum":"2826dcbfd896f585b80bd7b92faa2fba952bbc8c","_from":".","_npmVersion":"2.15.1","_nodeVersion":"4.4.3","_npmUser":{"name":"fgascon","email":"frederic.gascon@gmail.com"},"dist":{"shasum":"2826dcbfd896f585b80bd7b92faa2fba952bbc8c","tarball":"https://registry.npmjs.org/wrap-options/-/wrap-options-0.0.0.tgz","integrity":"sha512-l70KnSM579fEoB6Xoz2AKhsd+41KSG3xQJX6nRu0+FCPexBWGtdWQIDHDkIs52ABrRohqg80PH5U/E4LVcM81g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGOmF3HsQ+rcwUKpRpfaKbP2j7qgApIrI7rGgTZ+emv9AiEAvetxkQvOE1IuhkLuyP69FUIACTelznPlQZg7i21DXmw="}]},"maintainers":[{"name":"fgascon","email":"frederic.gascon@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/wrap-options-0.0.0.tgz_1461961793606_0.31996578769758344"}},"0.0.1":{"name":"wrap-options","version":"0.0.1","description":"constructor options utility","main":"index.js","repository":{"type":"git","url":"git+https://github.com/fgascon/wrap-options.git"},"keywords":["options"],"author":{"name":"fgascon","email":"frederic.gascon@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/fgascon/wrap-options/issues"},"homepage":"https://github.com/fgascon/wrap-options#readme","gitHead":"39d0606154d72004a8d49a91cef49e62d25fb79d","_id":"wrap-options@0.0.1","scripts":{},"_shasum":"6cb5863bc67309a8ae7a516668405d0c51be83f8","_from":".","_npmVersion":"2.15.1","_nodeVersion":"4.4.3","_npmUser":{"name":"fgascon","email":"frederic.gascon@gmail.com"},"dist":{"shasum":"6cb5863bc67309a8ae7a516668405d0c51be83f8","tarball":"https://registry.npmjs.org/wrap-options/-/wrap-options-0.0.1.tgz","integrity":"sha512-JfOYRc2GxfbbuyfIPcGJlJKQrQY3mt4l/bj+67+7ucIuxH9r3oYthTehvcqbbPEPoZEmI+9Qor+H9GjT2MmS6g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGm3/BZy3CdIZ+PNsR6Bf8Pgvml1+6ykRIIvzfCJKAO9AiBfYGQqBBlBpBGQXHU7miAolxYrKvborFSi8xUDuH5fSw=="}]},"maintainers":[{"name":"fgascon","email":"frederic.gascon@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/wrap-options-0.0.1.tgz_1461963023229_0.1283850260078907"}},"0.0.3":{"name":"wrap-options","version":"0.0.3","description":"constructor options utility","main":"index.js","repository":{"type":"git","url":"git+https://github.com/fgascon/wrap-options.git"},"keywords":["options"],"author":{"name":"fgascon","email":"frederic.gascon@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/fgascon/wrap-options/issues"},"homepage":"https://github.com/fgascon/wrap-options#readme","gitHead":"34e2ab7abbe1c614f45c4130e037f74778cf1bac","_id":"wrap-options@0.0.3","scripts":{},"_shasum":"2a256aaa620fbbd37f48f22d652ce1dec778ac6b","_from":".","_npmVersion":"2.15.5","_nodeVersion":"4.4.5","_npmUser":{"name":"fgascon","email":"frederic.gascon@gmail.com"},"dist":{"shasum":"2a256aaa620fbbd37f48f22d652ce1dec778ac6b","tarball":"https://registry.npmjs.org/wrap-options/-/wrap-options-0.0.3.tgz","integrity":"sha512-HPW9ZfOzCzRHrhtFIesjfmd3hB94h3jvvMeafYG0jUHvTy5wEA/cGbWz3V3o0ZF6bXKYOWz3OplQUQeOmNfxlQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD9ErBmerCAvvXkwkqUnidFf6+nzz3G4nqu3rv9+R8c+AIgQDncdaEy6PiGydrmvEJryAlB1RmshEoZTcEyuJz7lvs="}]},"maintainers":[{"name":"fgascon","email":"frederic.gascon@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/wrap-options-0.0.3.tgz_1466434551112_0.003784372005611658"}}},"readme":"# wrap-options\n\n## Exemple Usage\n\n```js\nvar Options = require('wrap-options');\n\nfunction MyConstructor(options) {\n    var wrappedOptions = new Options(options);\n    this.name = wrappedOptions.require('name');\n    this.isVisible = wrappedOptions.get('isVisible', false);\n}\n\nvar result = new MyConstructor({ name: 'me' });\n\nconsole.log(result);\n// { name: 'me', isVisible: false }\n```\n\n## Base API\n\n### .get(name, defaultValue)\nReturn the option value if present, otherwise return the defaultValue.\n\n### .require(name)\nReturn the option value if present, otherwise throw an error.\n\n### .has(name)\nCheck if the option was passes. Return a boolean.\n\n## Shorthand functions\n\n### .map(name, iterator, context)\nSame as\n```js\noptions.get(name, []).map(iterator, context)\n```\n\n### .mapConstructor(name, constructor)\nSame as:\n```js\noptions.get(name, []).map(function (data) {\n    return new constructor(data);\n})\n```\n\n### .getOptions(name, defaultValue)\nSame as\n```js\nnew Options(options.get(name, defaultValue))\n```\n\n### .requireOptions(name)\nSame as\n```js\nnew Options(options.require(name))\n```\n\n### .mapOptions(name)\nSame as\n```js\noptions.get(name, []).map(function (data) {\n    return new Options(data);\n})\n```\n","maintainers":[{"name":"fgascon","email":"frederic.gascon@gmail.com"}],"time":{"modified":"2022-06-29T03:43:57.947Z","created":"2016-04-29T20:29:54.571Z","0.0.0":"2016-04-29T20:29:54.571Z","0.0.1":"2016-04-29T20:50:24.216Z","0.0.3":"2016-06-20T14:55:52.552Z"},"homepage":"https://github.com/fgascon/wrap-options#readme","keywords":["options"],"repository":{"type":"git","url":"git+https://github.com/fgascon/wrap-options.git"},"author":{"name":"fgascon","email":"frederic.gascon@gmail.com"},"bugs":{"url":"https://github.com/fgascon/wrap-options/issues"},"license":"MIT","readmeFilename":"README.md"}