UNPKG

@zkochan/pnpm

Version:

Fast, disk space efficient package manager

156 lines (155 loc) 9.89 kB
{ "_args": [ [ { "raw": "is-descriptor@^0.1.0", "scope": null, "escapedName": "is-descriptor", "name": "is-descriptor", "rawSpec": "^0.1.0", "spec": ">=0.1.0 <0.2.0", "type": "range" }, "/home/zkochan/src/pnpm/packages/pnpm/node_modules/class-utils/node_modules/define-property" ] ], "_from": "is-descriptor@>=0.1.0 <0.2.0", "_id": "is-descriptor@0.1.6", "_inCache": true, "_location": "/is-descriptor", "_nodeVersion": "7.7.3", "_npmOperationalInternal": { "host": "s3://npm-registry-packages", "tmp": "tmp/is-descriptor-0.1.6.tgz_1500744018543_0.5760307745076716" }, "_npmUser": { "name": "jonschlinkert", "email": "github@sellside.com" }, "_npmVersion": "5.3.0", "_phantomChildren": {}, "_requested": { "raw": "is-descriptor@^0.1.0", "scope": null, "escapedName": "is-descriptor", "name": "is-descriptor", "rawSpec": "^0.1.0", "spec": ">=0.1.0 <0.2.0", "type": "range" }, "_requiredBy": [ "/class-utils/define-property", "/expand-brackets/define-property", "/object-copy/define-property", "/snapdragon/define-property", "/static-extend/define-property" ], "_resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", "_shasum": "366d8240dde487ca51823b1ab9f07a10a78251ca", "_shrinkwrap": null, "_spec": "is-descriptor@^0.1.0", "_where": "/home/zkochan/src/pnpm/packages/pnpm/node_modules/class-utils/node_modules/define-property", "author": { "name": "Jon Schlinkert", "url": "https://github.com/jonschlinkert" }, "bugs": { "url": "https://github.com/jonschlinkert/is-descriptor/issues" }, "contributors": [ { "name": "Brian Woodward", "url": "https://twitter.com/doowb" }, { "name": "Jon Schlinkert", "url": "http://twitter.com/jonschlinkert" }, { "url": "https://github.com/wtgtybhertgeghgtwtg" } ], "dependencies": { "is-accessor-descriptor": "^0.1.6", "is-data-descriptor": "^0.1.4", "kind-of": "^5.0.0" }, "description": "Returns true if a value has the characteristics of a valid JavaScript descriptor. Works for data descriptors and accessor descriptors.", "devDependencies": { "gulp-format-md": "^1.0.0", "mocha": "^3.4.2" }, "directories": {}, "dist": { "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", "shasum": "366d8240dde487ca51823b1ab9f07a10a78251ca", "tarball": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz" }, "engines": { "node": ">=0.10.0" }, "files": [ "index.js" ], "gitHead": "7559403830553097fcdd56ae93fe69d4ef2b21db", "homepage": "https://github.com/jonschlinkert/is-descriptor", "keywords": [ "accessor", "check", "data", "descriptor", "get", "getter", "is", "keys", "object", "properties", "property", "set", "setter", "type", "valid", "value" ], "license": "MIT", "main": "index.js", "maintainers": [ { "name": "jonschlinkert", "email": "github@sellside.com" } ], "name": "is-descriptor", "optionalDependencies": {}, "readme": "# is-descriptor [![NPM version](https://img.shields.io/npm/v/is-descriptor.svg?style=flat)](https://www.npmjs.com/package/is-descriptor) [![NPM monthly downloads](https://img.shields.io/npm/dm/is-descriptor.svg?style=flat)](https://npmjs.org/package/is-descriptor) [![NPM total downloads](https://img.shields.io/npm/dt/is-descriptor.svg?style=flat)](https://npmjs.org/package/is-descriptor) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/is-descriptor.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/is-descriptor)\n\n> Returns true if a value has the characteristics of a valid JavaScript descriptor. Works for data descriptors and accessor descriptors.\n\n## Install\n\nInstall with [npm](https://www.npmjs.com/):\n\n```sh\n$ npm install --save is-descriptor\n```\n\n## Usage\n\n```js\nvar isDescriptor = require('is-descriptor');\n\nisDescriptor({value: 'foo'})\n//=> true\nisDescriptor({get: function(){}, set: function(){}})\n//=> true\nisDescriptor({get: 'foo', set: function(){}})\n//=> false\n```\n\nYou may also check for a descriptor by passing an object as the first argument and property name (`string`) as the second argument.\n\n```js\nvar obj = {};\nobj.foo = 'abc';\n\nObject.defineProperty(obj, 'bar', {\n value: 'xyz'\n});\n\nisDescriptor(obj, 'foo');\n//=> true\nisDescriptor(obj, 'bar');\n//=> true\n```\n\n## Examples\n\n### value type\n\n`false` when not an object\n\n```js\nisDescriptor('a');\n//=> false\nisDescriptor(null);\n//=> false\nisDescriptor([]);\n//=> false\n```\n\n### data descriptor\n\n`true` when the object has valid properties with valid values.\n\n```js\nisDescriptor({value: 'foo'});\n//=> true\nisDescriptor({value: noop});\n//=> true\n```\n\n`false` when the object has invalid properties\n\n```js\nisDescriptor({value: 'foo', bar: 'baz'});\n//=> false\nisDescriptor({value: 'foo', bar: 'baz'});\n//=> false\nisDescriptor({value: 'foo', get: noop});\n//=> false\nisDescriptor({get: noop, value: noop});\n//=> false\n```\n\n`false` when a value is not the correct type\n\n```js\nisDescriptor({value: 'foo', enumerable: 'foo'});\n//=> false\nisDescriptor({value: 'foo', configurable: 'foo'});\n//=> false\nisDescriptor({value: 'foo', writable: 'foo'});\n//=> false\n```\n\n### accessor descriptor\n\n`true` when the object has valid properties with valid values.\n\n```js\nisDescriptor({get: noop, set: noop});\n//=> true\nisDescriptor({get: noop});\n//=> true\nisDescriptor({set: noop});\n//=> true\n```\n\n`false` when the object has invalid properties\n\n```js\nisDescriptor({get: noop, set: noop, bar: 'baz'});\n//=> false\nisDescriptor({get: noop, writable: true});\n//=> false\nisDescriptor({get: noop, value: true});\n//=> false\n```\n\n`false` when an accessor is not a function\n\n```js\nisDescriptor({get: noop, set: 'baz'});\n//=> false\nisDescriptor({get: 'foo', set: noop});\n//=> false\nisDescriptor({get: 'foo', bar: 'baz'});\n//=> false\nisDescriptor({get: 'foo', set: 'baz'});\n//=> false\n```\n\n`false` when a value is not the correct type\n\n```js\nisDescriptor({get: noop, set: noop, enumerable: 'foo'});\n//=> false\nisDescriptor({set: noop, configurable: 'foo'});\n//=> false\nisDescriptor({get: noop, configurable: 'foo'});\n//=> false\n```\n\n## About\n\n### Related projects\n\n* [is-accessor-descriptor](https://www.npmjs.com/package/is-accessor-descriptor): Returns true if a value has the characteristics of a valid JavaScript accessor descriptor. | [homepage](https://github.com/jonschlinkert/is-accessor-descriptor \"Returns true if a value has the characteristics of a valid JavaScript accessor descriptor.\")\n* [is-data-descriptor](https://www.npmjs.com/package/is-data-descriptor): Returns true if a value has the characteristics of a valid JavaScript data descriptor. | [homepage](https://github.com/jonschlinkert/is-data-descriptor \"Returns true if a value has the characteristics of a valid JavaScript data descriptor.\")\n* [is-descriptor](https://www.npmjs.com/package/is-descriptor): Returns true if a value has the characteristics of a valid JavaScript descriptor. Works for… [more](https://github.com/jonschlinkert/is-descriptor) | [homepage](https://github.com/jonschlinkert/is-descriptor \"Returns true if a value has the characteristics of a valid JavaScript descriptor. Works for data descriptors and accessor descriptors.\")\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\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| 24 | [jonschlinkert](https://github.com/jonschlinkert) |\n| 1 | [doowb](https://github.com/doowb) |\n| 1 | [wtgtybhertgeghgtwtg](https://github.com/wtgtybhertgeghgtwtg) |\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 July 22, 2017._", "readmeFilename": "README.md", "repository": { "type": "git", "url": "git+https://github.com/jonschlinkert/is-descriptor.git" }, "scripts": { "test": "mocha" }, "verb": { "related": { "list": [ "is-accessor-descriptor", "is-data-descriptor", "is-descriptor", "isobject" ] }, "plugins": [ "gulp-format-md" ], "toc": false, "layout": "default", "tasks": [ "readme" ], "lint": { "reflinks": true } }, "version": "0.1.6" }