UNPKG

pnpm

Version:

Fast, disk space efficient package manager

157 lines (156 loc) 8.16 kB
{ "_args": [ [ { "raw": "has-value@^1.0.0", "scope": null, "escapedName": "has-value", "name": "has-value", "rawSpec": "^1.0.0", "spec": ">=1.0.0 <2.0.0", "type": "range" }, "/home/zoltan/src/pnpm/pnpm/packages/pnpm/node_modules/cache-base" ] ], "_from": "has-value@>=1.0.0 <2.0.0", "_id": "has-value@1.0.0", "_inCache": true, "_location": "/has-value", "_nodeVersion": "7.7.3", "_npmOperationalInternal": { "host": "s3://npm-registry-packages", "tmp": "tmp/has-value-1.0.0.tgz_1495221082986_0.06325704883784056" }, "_npmUser": { "name": "jonschlinkert", "email": "github@sellside.com" }, "_npmVersion": "4.6.1", "_phantomChildren": {}, "_requested": { "raw": "has-value@^1.0.0", "scope": null, "escapedName": "has-value", "name": "has-value", "rawSpec": "^1.0.0", "spec": ">=1.0.0 <2.0.0", "type": "range" }, "_requiredBy": [ "/cache-base" ], "_resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", "_shasum": "18b281da585b1c5c51def24c930ed29a0be6b177", "_shrinkwrap": null, "_spec": "has-value@^1.0.0", "_where": "/home/zoltan/src/pnpm/pnpm/packages/pnpm/node_modules/cache-base", "author": { "name": "Jon Schlinkert", "url": "https://github.com/jonschlinkert" }, "bugs": { "url": "https://github.com/jonschlinkert/has-value/issues" }, "contributors": [ { "name": "Jon Schlinkert", "url": "http://twitter.com/jonschlinkert" }, { "name": "Ryan M Harrison", "url": "https://linkedin.com/in/harrisonrm" } ], "dependencies": { "get-value": "^2.0.6", "has-values": "^1.0.0", "isobject": "^3.0.0" }, "description": "Returns true if a value exists, false if empty. Works with deeply nested values using object paths.", "devDependencies": { "gulp-format-md": "^0.1.12", "mocha": "^3.4.1" }, "directories": {}, "dist": { "shasum": "18b281da585b1c5c51def24c930ed29a0be6b177", "tarball": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz" }, "engines": { "node": ">=0.10.0" }, "files": [ "index.js" ], "gitHead": "61b5671a48ac40206eb33b4ea75dc2507168d687", "homepage": "https://github.com/jonschlinkert/has-value", "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" ], "license": "MIT", "main": "index.js", "maintainers": [ { "name": "jonschlinkert", "email": "github@sellside.com" } ], "name": "has-value", "optionalDependencies": {}, "readme": "# has-value [![NPM version](https://img.shields.io/npm/v/has-value.svg?style=flat)](https://www.npmjs.com/package/has-value) [![NPM monthly downloads](https://img.shields.io/npm/dm/has-value.svg?style=flat)](https://npmjs.org/package/has-value) [![NPM total downloads](https://img.shields.io/npm/dt/has-value.svg?style=flat)](https://npmjs.org/package/has-value) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/has-value.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/has-value)\n\n> Returns true if a value exists, false if empty. Works with deeply nested values using object paths.\n\n## Install\n\nInstall with [npm](https://www.npmjs.com/):\n\n```sh\n$ npm install --save has-value\n```\n\n**Works for:**\n\n* booleans\n* functions\n* numbers\n* strings\n* nulls\n* object\n* arrays\n\n## Usage\n\nWorks with property values (supports object-path notation, like `foo.bar`) or a single value:\n\n```js\nvar hasValue = require('has-value');\n\nhasValue('foo');\nhasValue({foo: 'bar'}, 'foo');\nhasValue({a: {b: {c: 'foo'}}}, 'a.b.c');\n//=> true\n\nhasValue('');\nhasValue({foo: ''}, 'foo');\n//=> false\n\nhasValue(0);\nhasValue(1);\nhasValue({foo: 0}, 'foo');\nhasValue({foo: 1}, 'foo');\nhasValue({foo: null}, 'foo');\nhasValue({foo: {bar: 'a'}}}, 'foo');\nhasValue({foo: {bar: 'a'}}}, 'foo.bar');\n//=> true\n\nhasValue({foo: {}}}, 'foo');\nhasValue({foo: {bar: {}}}}, 'foo.bar');\nhasValue({foo: undefined}, 'foo');\n//=> false\n\nhasValue([]);\nhasValue([[]]);\nhasValue([[], []]);\nhasValue([undefined]);\nhasValue({foo: []}, 'foo');\n//=> false\n\nhasValue([0]);\nhasValue([null]);\nhasValue(['foo']);\nhasValue({foo: ['a']}, 'foo');\n//=> true\n\nhasValue(function() {})\nhasValue(function(foo) {})\nhasValue({foo: function(foo) {}}, 'foo'); \nhasValue({foo: function() {}}, 'foo');\n//=> true\n\nhasValue(true);\nhasValue(false);\nhasValue({foo: true}, 'foo');\nhasValue({foo: false}, 'foo');\n//=> true\n```\n\n## isEmpty\n\nTo do the opposite and test for empty values, do:\n\n```js\nfunction isEmpty(o) {\n return !hasValue.apply(hasValue, arguments);\n}\n```\n\n## Release history\n\n### v1.0.0\n\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### Related projects\n\n* [define-property](https://www.npmjs.com/package/define-property): Define a non-enumerable property on an object. | [homepage](https://github.com/jonschlinkert/define-property \"Define a non-enumerable property on an object.\")\n* [get-value](https://www.npmjs.com/package/get-value): Use property paths (`a.b.c`) to get a nested value from an object. | [homepage](https://github.com/jonschlinkert/get-value \"Use property paths (`a.b.c`) to get a nested value from an object.\")\n* [set-value](https://www.npmjs.com/package/set-value): Create nested values and any intermediaries using dot notation (`'a.b.c'`) paths. | [homepage](https://github.com/jonschlinkert/set-value \"Create nested values and any intermediaries using dot notation (`'a.b.c'`) paths.\")\n* [unset-value](https://www.npmjs.com/package/unset-value): Delete nested properties from an object using dot notation. | [homepage](https://github.com/jonschlinkert/unset-value \"Delete nested properties from an object using dot notation.\")\n\n### Contributing\n\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).\n\n### Contributors\n\n| **Commits** | **Contributor** | \n| --- | --- |\n| 17 | [jonschlinkert](https://github.com/jonschlinkert) |\n| 2 | [rmharrison](https://github.com/rmharrison) |\n\n### Building docs\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### Running tests\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### Author\n\n**Jon Schlinkert**\n\n* [github/jonschlinkert](https://github.com/jonschlinkert)\n* [twitter/jonschlinkert](https://twitter.com/jonschlinkert)\n\n### License\n\nCopyright © 2017, [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 May 19, 2017._", "readmeFilename": "README.md", "repository": { "type": "git", "url": "git+https://github.com/jonschlinkert/has-value.git" }, "scripts": { "test": "mocha" }, "verb": { "run": true, "toc": false, "layout": "default", "tasks": [ "readme" ], "plugins": [ "gulp-format-md" ], "related": { "list": [ "define-property", "get-value", "set-value", "unset-value" ] }, "reflinks": [], "lint": { "reflinks": true } }, "version": "1.0.0" }