{"name":"has-values","description":"Returns true if any values exist, false if empty. Works for booleans, functions, numbers, strings, nulls, objects and arrays. ","version":"1.0.0","homepage":"https://github.com/jonschlinkert/has-values","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git+https://github.com/jonschlinkert/has-values.git"},"bugs":{"url":"https://github.com/jonschlinkert/has-values/issues"},"license":"MIT","files":["index.js"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"dependencies":{"is-number":"^3.0.0","kind-of":"^4.0.0"},"devDependencies":{"gulp-format-md":"^0.1.12","mocha":"^3.4.1"},"keywords":["array","boolean","empty","find","function","has","hasOwn","javascript","js","key","keys","node.js","null","number","object","properties","property","string","type","util","utilities","utility","value","values"],"verb":{"run":true,"toc":false,"layout":"default","tasks":["readme"],"plugins":["gulp-format-md"],"related":{"list":["has-value","kind-of","is-number","is-plain-object","isobject"]},"reflinks":["verb"],"lint":{"reflinks":true}},"gitHead":"fead695044aafcfb337c7125af5479c7eaf1c92c","_id":"has-values@1.0.0","_shasum":"95b0b63fec2146619a6fe57fe75628d5a39efe4f","_from":".","_npmVersion":"4.6.1","_nodeVersion":"7.7.3","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"95b0b63fec2146619a6fe57fe75628d5a39efe4f","tarball":"http://registry-npm.ywwl.com/has-values/download/has-values-1.0.0.tgz","integrity":"sha512-ODYZC64uqzmtfGMEAX/FvZiRyWLpAC3vYnNunURUnkGVTS+mI0smVsWaPydRBsE3g+ok7h960jChO8mFcWlHaQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFmiLaVbtKgAFSpoKW0QwQf30IsbxXsXJon6DXeEI4ECAiEAgHKhjJblDAIjMNt+a2xtzK6nQGWDvqNV7vglJD7T8PQ="}],"size":3009,"noattachment":false,"key":"/has-values/-/has-values-1.0.0.tgz"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/has-values-1.0.0.tgz_1495219418678_0.2592258816584945"},"directories":{},"readme":"# has-values [![NPM version](https://img.shields.io/npm/v/has-values.svg?style=flat)](https://www.npmjs.com/package/has-values) [![NPM monthly downloads](https://img.shields.io/npm/dm/has-values.svg?style=flat)](https://npmjs.org/package/has-values) [![NPM total downloads](https://img.shields.io/npm/dt/has-values.svg?style=flat)](https://npmjs.org/package/has-values) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/has-values.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/has-values)\n\n> Returns true if any values exist, false if empty. Works for booleans, functions, numbers, strings, nulls, objects and arrays.\n\nPlease consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support.\n\n## Install\n\nInstall with [npm](https://www.npmjs.com/):\n\n```sh\n$ npm install --save has-values\n```\n\n## Usage\n\n```js\nconst has = require('has-values');\n```\n\nCreate an `isEmpty` function by returning the inverse of the result from has-values:\n\n```js\nconst isEmpty = val => !has(val);\n```\n\n## Supported types\n\n### Arrays\n\n```js\nconsole.log(has(['a']));      //=> true\nconsole.log(has([0]));        //=> true\nconsole.log(has([[[]]]));     //=> false\nconsole.log(has([[], []]));   //=> false\nconsole.log(has([]));         //=> false\n```\n\n### Booleans\n\n```js\nconsole.log(has(true));  //=> true\nconsole.log(has(false)); //=> true\n```\n\n### Buffers\n\n```js\nconsole.log(has(new Buffer()));      //=> false\nconsole.log(has(new Buffer('foo'))); //=> true\n```\n\n### Dates\n\nDates are always true.\n\n```js\nconsole.log(has(new Date())); //=> true\n```\n\n### Errors\n\nReturns `false` if `err.message` is an empty string.\n\n```js\nconsole.log(has(new Error()));      //=> false\nconsole.log(has(new Error('foo'))); //=> true\n```\n\n### Functions\n\nFunctions are always true.\n\n```js\nconsole.log(has(function(foo) {})); //=> true\nconsole.log(has(function() {}));    //=> true\n```\n\n### Maps\n\n```js\nconsole.log(has(new Map()));                 //=> false\nconsole.log(has(new Map([['foo', 'bar']]))); //=> true\n```\n\n### Null\n\n`null` is always true, as it's assumed that this is a user-defined value, versus `undefined` which is not.\n\n```js\nconsole.log(has(null)); //=> true\n```\n\n### Objects\n\n```js\nconsole.log(has({})); //=> false\nconsole.log(has({ a: 'a' }}));        //=> true\nconsole.log(has({ foo: undefined })); //=> false\nconsole.log(has({ foo: null }));      //=> true\n```\n\n### Numbers\n\n```js\nconsole.log(has(1)); //=> true\nconsole.log(has(0)); //=> true\n```\n\n### Regular expressions\n\n```js\nconsole.log(has(new RegExp()));      //=> false\nconsole.log(has(new RegExp('foo'))); //=> true\n```\n\n### Sets\n\n```js\nconsole.log(has(new Set()));               //=> false\nconsole.log(has(new Set(['foo', 'bar']))); //=> true\n```\n\n### Strings\n\n```js\nconsole.log(has('a')); //=> true\nconsole.log(has(''));  //=> false\n```\n\n## Undefined\n\n```js\nconsole.log(has());          //=> false\nconsole.log(has(void 0));    //=> false\nconsole.log(has(undefined)); //=> false\n```\n\n## Release history\n\n### v2.0.0\n\n* no longer supports numbers as a string\n* optimizations\n* adds support for `regex` and `buffer`\n\n### v1.0.0\n\n* adds support for `Map` and `Set`\n* `zero` always returns true\n* `array` now recurses, so that an array of empty arrays will return `false`\n* `null` now returns true\n\n## About\n\n<details>\n<summary><strong>Contributing</strong></summary>\n\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).\n\n</details>\n\n<details>\n<summary><strong>Running Tests</strong></summary>\n\nRunning and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:\n\n```sh\n$ npm install && npm test\n```\n\n</details>\n\n<details>\n<summary><strong>Building docs</strong></summary>\n\n_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_\n\nTo generate the readme, run the following command:\n\n```sh\n$ npm install -g verbose/verb#dev verb-generate-readme && verb\n```\n\n</details>\n\n### Related projects\n\nYou might also be interested in these projects:\n\n* [has-value](https://www.npmjs.com/package/has-value): Returns true if a value exists, false if empty. Works with deeply nested values using… [more](https://github.com/jonschlinkert/has-value) | [homepage](https://github.com/jonschlinkert/has-value \"Returns true if a value exists, false if empty. Works with deeply nested values using object paths.\")\n* [is-number](https://www.npmjs.com/package/is-number): Returns true if the value is a number. comprehensive tests. | [homepage](https://github.com/jonschlinkert/is-number \"Returns true if the value is a number. comprehensive tests.\")\n* [is-plain-object](https://www.npmjs.com/package/is-plain-object): Returns true if an object was created by the `Object` constructor. | [homepage](https://github.com/jonschlinkert/is-plain-object \"Returns true if an object was created by the `Object` constructor.\")\n* [isobject](https://www.npmjs.com/package/isobject): Returns true if the value is an object and not an array or null. | [homepage](https://github.com/jonschlinkert/isobject \"Returns true if the value is an object and not an array or null.\")\n* [kind-of](https://www.npmjs.com/package/kind-of): Get the native type of a value. | [homepage](https://github.com/jonschlinkert/kind-of \"Get the native type of a value.\")\n\n### Author\n\n**Jon Schlinkert**\n\n* [linkedin/in/jonschlinkert](https://linkedin.com/in/jonschlinkert)\n* [github/jonschlinkert](https://github.com/jonschlinkert)\n* [twitter/jonschlinkert](https://twitter.com/jonschlinkert)\n\n### License\n\nCopyright © 2018, [Jon Schlinkert](https://github.com/jonschlinkert).\nReleased under the [MIT License](LICENSE).\n\n***\n\n_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on January 30, 2018._","publish_time":1495219419654,"_cnpm_publish_time":1495219419654,"dist-tags":{"latest":"2.0.1"}}