{"_id":"defined","_rev":"18-12080ff1a60f6504e5b23de96be64675","name":"defined","description":"return the first argument that is `!== undefined`","dist-tags":{"latest":"1.0.1"},"versions":{"0.0.0":{"name":"defined","version":"0.0.0","description":"return the first argument that is `!== undefined`","main":"index.js","directories":{"example":"example","test":"test"},"dependencies":{},"devDependencies":{"tap":"~0.3.0","tape":"~0.0.2"},"scripts":{"test":"tap test/*.js"},"repository":{"type":"git","url":"git://github.com/substack/defined.git"},"homepage":"https://github.com/substack/defined","keywords":["undefined","short-circuit","||","or","//","defined-or"],"author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"},"license":"MIT","_id":"defined@0.0.0","dist":{"shasum":"f35eea7d705e933baf13b2f03b3f83d921403b3e","tarball":"https://registry.npmjs.org/defined/-/defined-0.0.0.tgz","integrity":"sha512-zpqiCT8bODLu3QSmLLic8xJnYWBFjOSu/fBCm189oAiTtPq/PSanNACKZDS7kgSyCJY7P+IcODzlIogBK/9RBg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD9pz85rLWtzYvnN6XbbQWAMZ3qQyZ5qybocHxKILbK5wIhAN203WGZeqJP0iRx9WgUVWR/GEariiCp70EQpaFpkwBC"}]},"_npmVersion":"1.1.59","_npmUser":{"name":"substack","email":"mail@substack.net"},"maintainers":[{"name":"substack","email":"mail@substack.net"}]},"1.0.0":{"name":"defined","version":"1.0.0","description":"return the first argument that is `!== undefined`","main":"index.js","directories":{"example":"example","test":"test"},"dependencies":{},"devDependencies":{"tape":"~3.5.0"},"scripts":{"test":"tape test/*.js"},"testling":{"files":"test/*.js","browsers":{"ie":[6,7,8,9],"ff":[3.5,10,15],"chrome":[10,22],"safari":[5.1],"opera":[12]}},"repository":{"type":"git","url":"git://github.com/substack/defined.git"},"homepage":"https://github.com/substack/defined","keywords":["undefined","short-circuit","||","or","//","defined-or"],"author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"},"license":"MIT","gitHead":"3a46c81d39b5f94c0c17c47638939af2528520f3","bugs":{"url":"https://github.com/substack/defined/issues"},"_id":"defined@1.0.0","_shasum":"c98d9bcef75674188e110969151199e39b1fa693","_from":".","_npmVersion":"2.7.5","_nodeVersion":"0.12.0","_npmUser":{"name":"substack","email":"mail@substack.net"},"maintainers":[{"name":"substack","email":"mail@substack.net"}],"dist":{"shasum":"c98d9bcef75674188e110969151199e39b1fa693","tarball":"https://registry.npmjs.org/defined/-/defined-1.0.0.tgz","integrity":"sha512-Y2caI5+ZwS5c3RiNDJ6u53VhQHv+hHKwhkI1iHvceKUHw9Df6EK2zRLfjejRgMuCuxK7PfSWIMwWecceVvThjQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCiTJ6SGItw5DI8wUDv9OjsSYSrGpFkTxhmkF498ULOlwIgeAspYDC2yR5c7hWpe7rlrngjgzXFONdkdhQJKSfjf10="}]}},"1.0.1":{"name":"defined","version":"1.0.1","description":"return the first argument that is `!== undefined`","main":"index.js","directories":{"example":"example","test":"test"},"devDependencies":{"@ljharb/eslint-config":"^21.0.0","aud":"^2.0.1","auto-changelog":"^2.4.0","eslint":"=8.8.0","in-publish":"^2.0.1","npmignore":"^0.3.0","safe-publish-latest":"^2.0.0","tape":"^5.6.1"},"scripts":{"prepack":"npmignore --auto --commentLines=autogenerated","prepublish":"not-in-publish || npm run prepublishOnly","prepublishOnly":"safe-publish-latest","lint":"eslint --ext=js,mjs .","pretest":"npm run lint","tests-only":"tape 'test/**/*.js'","test":"npm run tests-only","posttest":"aud --production","version":"auto-changelog && git add CHANGELOG.md","postversion":"auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""},"testling":{"files":"test/*.js","browsers":{"ie":[6,7,8,9],"ff":[3.5,10,15],"chrome":[10,22],"safari":[5.1],"opera":[12]}},"repository":{"type":"git","url":"git://github.com/inspect-js/defined.git"},"homepage":"https://github.com/inspect-js/defined","keywords":["undefined","short-circuit","||","or","//","defined-or"],"author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"},"funding":{"url":"https://github.com/sponsors/ljharb"},"license":"MIT","auto-changelog":{"output":"CHANGELOG.md","template":"keepachangelog","unreleased":false,"commitLimit":false,"backfillLimit":false,"hideCredit":true},"publishConfig":{"ignore":[".github/workflows"]},"gitHead":"8613a02bb55958a035d1988113d4814e2928b293","bugs":{"url":"https://github.com/inspect-js/defined/issues"},"_id":"defined@1.0.1","_nodeVersion":"18.10.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-hsBd2qSVCRE+5PmNdHt1uzyrFu5d3RwmFDKzyNZMFq/EwDNJF7Ee5+D5oEKF0hU6LhtoUF1macFvOe4AskQC1Q==","shasum":"c0b9db27bfaffd95d6f61399419b893df0f91ebf","tarball":"https://registry.npmjs.org/defined/-/defined-1.0.1.tgz","fileCount":10,"unpackedSize":10746,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCMEulk4Ndfg7IORzgGBiFKBmJcCb1DX+ZmnNk62Xy2mQIgEiQkHYiBT2nSe9uXUdnOlrYSBZFf1Bw5eVT6YUrWT1o="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjRsieACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqUpQ//aY7BqAN58R36xl4A/HnYZLweECuZ4yM8OiDfunCHBLWEJIsl\r\nMnj/rbxJcgkMqT/DyU3UgMhI5sQfNQd1SQWCSD/+NIDs6ArTDjd/0+AMfdVa\r\nLc1Q2bo4Hy005m9GYJxKahC3BDjYnwb3/bR3AFJmy68TyggDLiaUWBoAierH\r\ncYPsTK4Zx31DR3uC1dpJdxlcjTqP73mIQumqY4SjoAHlJq53B95jInhSzOLS\r\no5MQptyAHEeGuXWC1awWQMFgO/4ix6YK7z2EL87+NjEyfXOqAGTePPzN3Sjz\r\noAIevOvCjbf3c1RUPQJbxkWxciId6SpEG5VpgOz2X4g85y3g6Rt1s3Hm0Hyy\r\nx2ezuVUgPgpyhpo5mJ53GY6tmavz0aQVElFJG3S6NazuIm3RJKKJSFVr/elW\r\nmCl94QNx+Xbxi+6awaQDfMY322P2l/Wz5dgUjXGPbwDjWiRgHzztbzUMgIMf\r\nSQ30RVSPhEAhfLtSjOefy2LgjOnnMfou680GWJm3iJdIgpKMOZl1mA4YC2eb\r\nPTTtYBh/2VsQrYw07EWksGFeiGXqeXIRMEuSr2LXCZbxVHx8vVAZRIYvv2iR\r\nUKn2bKKEjNfzxlzaehixURewhrXjgF0L/lBjdItr4A79gtcgO3c3BnD+kzNE\r\nJ/wGNs/wjTHinFpDEgdauouWocUnDaP4th0=\r\n=G3kL\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"ljharb","email":"ljharb@gmail.com"},"maintainers":[{"name":"substack","email":"substack@gmail.com"},{"name":"ljharb","email":"ljharb@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/defined_1.0.1_1665583262271_0.529315744685086"},"_hasShrinkwrap":false}},"readme":"# defined <sup>[![Version Badge][npm-version-svg]][package-url]</sup>\n\n[![github actions][actions-image]][actions-url]\n[![coverage][codecov-image]][codecov-url]\n[![License][license-image]][license-url]\n[![Downloads][downloads-image]][downloads-url]\n\n[![npm badge][npm-badge-png]][package-url]\n\nreturn the first argument that is `!== undefined`\n\nMost of the time when I chain together `||`s, I actually just want the first\nitem that is not `undefined`, not the first non-falsy item.\n\nThis module is like the defined-or (`//`) operator in perl 5.10+.\n\n# example\n\n``` js\nvar defined = require('defined');\nvar opts = { y : false, w : 4 };\nvar x = defined(opts.x, opts.y, opts.w, 100);\nconsole.log(x);\n```\n\n```\n$ node example/defined.js\nfalse\n```\n\nThe return value is `false` because `false` is the first item that is\n`!== undefined`.\n\n# methods\n\n``` js\nvar defined = require('defined')\n```\n\n## var x = defined(a, b, c...)\n\nReturn the first item in the argument list `a, b, c...` that is `!== undefined`.\n\nIf all the items are `=== undefined`, return undefined.\n\n# install\n\nWith [npm](https://npmjs.org) do:\n\n```\nnpm install defined\n```\n\n# license\n\nMIT\n\n[package-url]: https://npmjs.org/package/defined\n[npm-version-svg]: https://versionbadg.es/inspect-js/defined.svg\n[deps-svg]: https://david-dm.org/inspect-js/defined.svg\n[deps-url]: https://david-dm.org/inspect-js/defined\n[dev-deps-svg]: https://david-dm.org/inspect-js/defined/dev-status.svg\n[dev-deps-url]: https://david-dm.org/inspect-js/defined#info=devDependencies\n[npm-badge-png]: https://nodei.co/npm/defined.png?downloads=true&stars=true\n[license-image]: https://img.shields.io/npm/l/defined.svg\n[license-url]: LICENSE\n[downloads-image]: https://img.shields.io/npm/dm/defined.svg\n[downloads-url]: https://npm-stat.com/charts.html?package=defined\n[codecov-image]: https://codecov.io/gh/inspect-js/defined/branch/main/graphs/badge.svg\n[codecov-url]: https://app.codecov.io/gh/inspect-js/defined/\n[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/inspect-js/defined\n[actions-url]: https://github.com/inspect-js/defined/actions\n","maintainers":[{"email":"ljharb@gmail.com","name":"ljharb"}],"time":{"modified":"2023-06-09T21:33:17.698Z","created":"2012-11-26T04:53:25.352Z","0.0.0":"2012-11-26T04:53:26.402Z","1.0.0":"2015-04-08T11:28:28.088Z","1.0.1":"2022-10-12T14:01:02.571Z"},"author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"},"repository":{"type":"git","url":"git://github.com/inspect-js/defined.git"},"users":{"julien-f":true,"simplyianm":true,"kontrax":true,"irnnr":true,"scottfreecode":true,"sprying":true,"flumpus-dev":true},"homepage":"https://github.com/inspect-js/defined","keywords":["undefined","short-circuit","||","or","//","defined-or"],"license":"MIT","readmeFilename":"README.md","bugs":{"url":"https://github.com/inspect-js/defined/issues"}}