{"_id":"defined","_rev":"2934783","name":"defined","description":"return the first argument that is `!== undefined`","dist-tags":{"latest":"1.0.1"},"maintainers":[{"name":"ljharb","email":""}],"time":{"modified":"2023-03-29T06:05:49.000Z","created":"2012-11-26T04:53:26.402Z","1.0.1":"2022-10-12T14:01:02.571Z","1.0.0":"2015-04-08T11:28:28.088Z","0.0.0":"2012-11-26T04:53:26.402Z"},"users":{"julien-f":true,"simplyianm":true,"kontrax":true,"irnnr":true,"scottfreecode":true,"sprying":true},"author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"},"repository":{"type":"git","url":"git://github.com/inspect-js/defined.git"},"versions":{"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":{"shasum":"c0b9db27bfaffd95d6f61399419b893df0f91ebf","size":4647,"noattachment":false,"key":"/defined/-/defined-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/defined/download/defined-1.0.1.tgz"},"_npmUser":{"name":"ljharb","email":"ljharb@gmail.com"},"maintainers":[{"name":"ljharb","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/defined_1.0.1_1665583262271_0.529315744685086"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-10-14T01:08:45.002Z","publish_time":1665583262571,"_cnpm_publish_time":1665583262571},"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":"ljharb","email":""}],"dist":{"shasum":"c98d9bcef75674188e110969151199e39b1fa693","size":2162,"noattachment":false,"key":"/defined/-/defined-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/defined/download/defined-1.0.0.tgz"},"publish_time":1428492508088,"_cnpm_publish_time":1428492508088,"_hasShrinkwrap":false},"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","size":2014,"noattachment":false,"key":"/defined/-/defined-0.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/defined/download/defined-0.0.0.tgz"},"_npmVersion":"1.1.59","_npmUser":{"name":"substack","email":"mail@substack.net"},"maintainers":[{"name":"ljharb","email":""}],"publish_time":1353905606402,"_cnpm_publish_time":1353905606402,"_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","_attachments":{},"homepage":"https://github.com/inspect-js/defined","bugs":{"url":"https://github.com/inspect-js/defined/issues"},"license":"MIT"}