{ "_id": "is-data-descriptor", "_rev": "7-31a9dd6ec5aa65222e038b64506f3927", "name": "is-data-descriptor", "description": "Returns true if a value has the characteristics of a valid JavaScript data descriptor.", "dist-tags": { "latest": "2.0.0" }, "versions": { "0.1.0": { "name": "is-data-descriptor", "description": "Returns true if a value appears to be a valid JavaScript data descriptor.", "version": "0.1.0", "homepage": "https://github.com/jonschlinkert/is-data-descriptor", "author": { "name": "Jon Schlinkert", "url": "https://github.com/jonschlinkert" }, "repository": { "type": "git", "url": "git+https://github.com/jonschlinkert/is-data-descriptor.git" }, "bugs": { "url": "https://github.com/jonschlinkert/is-data-descriptor/issues" }, "license": "MIT", "files": [ "index.js" ], "main": "index.js", "engines": { "node": ">=0.10.0" }, "scripts": { "test": "mocha" }, "dependencies": { "arr-diff": "^1.1.0", "kind-of": "^2.0.1" }, "devDependencies": { "mocha": "*", "should": "*" }, "keywords": [ "accessor", "check", "data", "descriptor", "get", "getter", "is", "keys", "object", "properties", "property", "set", "setter", "type", "valid", "value" ], "verb": { "related": { "list": [ "is-data-descriptor", "is-accessor-descriptor", "isobject", "arr-diff" ] } }, "gitHead": "a1915ae8a9a4a633d18630102264d266b6e08f08", "_id": "is-data-descriptor@0.1.0", "_shasum": "b7fc345d007b1a5211ae3431751e118116a07fe0", "_from": ".", "_npmVersion": "2.10.1", "_nodeVersion": "0.12.4", "_npmUser": { "name": "jonschlinkert", "email": "github@sellside.com" }, "maintainers": [ { "name": "jonschlinkert", "email": "github@sellside.com" } ], "dist": { "shasum": "b7fc345d007b1a5211ae3431751e118116a07fe0", "tarball": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.0.tgz" }, "directories": {} }, "0.1.1": { "name": "is-data-descriptor", "description": "Returns true if a value appears to be a valid JavaScript data descriptor.", "version": "0.1.1", "homepage": "https://github.com/jonschlinkert/is-data-descriptor", "author": { "name": "Jon Schlinkert", "url": "https://github.com/jonschlinkert" }, "repository": { "type": "git", "url": "git+https://github.com/jonschlinkert/is-data-descriptor.git" }, "bugs": { "url": "https://github.com/jonschlinkert/is-data-descriptor/issues" }, "license": "MIT", "files": [ "index.js" ], "main": "index.js", "engines": { "node": ">=0.10.0" }, "scripts": { "test": "mocha" }, "dependencies": { "arr-diff": "^1.1.0", "kind-of": "^2.0.1" }, "devDependencies": { "mocha": "*", "should": "*" }, "keywords": [ "accessor", "check", "data", "descriptor", "get", "getter", "is", "keys", "object", "properties", "property", "set", "setter", "type", "valid", "value" ], "verb": { "related": { "list": [ "is-descriptor", "is-data-descriptor", "is-accessor-descriptor", "isobject" ] } }, "gitHead": "fcd228a9a1b69ef5883fe513bd491665cd89fd2e", "_id": "is-data-descriptor@0.1.1", "_shasum": "fb8e8c4a87a2c43af9d5babf4471cfb60a1c6835", "_from": ".", "_npmVersion": "2.10.1", "_nodeVersion": "0.12.4", "_npmUser": { "name": "jonschlinkert", "email": "github@sellside.com" }, "maintainers": [ { "name": "jonschlinkert", "email": "github@sellside.com" } ], "dist": { "shasum": "fb8e8c4a87a2c43af9d5babf4471cfb60a1c6835", "tarball": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.1.tgz" }, "directories": {} }, "0.1.2": { "name": "is-data-descriptor", "description": "Returns true if a value has the characteristics of a valid JavaScript data descriptor.", "version": "0.1.2", "homepage": "https://github.com/jonschlinkert/is-data-descriptor", "author": { "name": "Jon Schlinkert", "url": "https://github.com/jonschlinkert" }, "repository": { "type": "git", "url": "git+https://github.com/jonschlinkert/is-data-descriptor.git" }, "bugs": { "url": "https://github.com/jonschlinkert/is-data-descriptor/issues" }, "license": "MIT", "files": [ "index.js" ], "main": "index.js", "engines": { "node": ">=0.10.0" }, "scripts": { "test": "mocha" }, "dependencies": { "arr-diff": "^1.1.0", "kind-of": "^2.0.1", "lazy-cache": "^0.2.3" }, "devDependencies": { "mocha": "*", "should": "*" }, "keywords": [ "accessor", "check", "data", "descriptor", "get", "getter", "is", "keys", "object", "properties", "property", "set", "setter", "type", "valid", "value" ], "verb": { "related": { "list": [ "is-descriptor", "is-data-descriptor", "is-accessor-descriptor", "isobject" ] } }, "gitHead": "51082c59bc2229442870c8be1eb9a7712e17239b", "_id": "is-data-descriptor@0.1.2", "_shasum": "ccd3287541ca100ee61e4d3d4fbc03af611c9a4f", "_from": ".", "_npmVersion": "2.14.4", "_nodeVersion": "4.1.1", "_npmUser": { "name": "jonschlinkert", "email": "github@sellside.com" }, "maintainers": [ { "name": "jonschlinkert", "email": "github@sellside.com" } ], "dist": { "shasum": "ccd3287541ca100ee61e4d3d4fbc03af611c9a4f", "tarball": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.2.tgz" }, "directories": {} }, "0.1.3": { "name": "is-data-descriptor", "description": "Returns true if a value has the characteristics of a valid JavaScript data descriptor.", "version": "0.1.3", "homepage": "https://github.com/jonschlinkert/is-data-descriptor", "author": { "name": "Jon Schlinkert", "url": "https://github.com/jonschlinkert" }, "repository": { "type": "git", "url": "git+https://github.com/jonschlinkert/is-data-descriptor.git" }, "bugs": { "url": "https://github.com/jonschlinkert/is-data-descriptor/issues" }, "license": "MIT", "files": [ "index.js", "utils.js" ], "main": "index.js", "engines": { "node": ">=0.10.0" }, "scripts": { "test": "mocha" }, "dependencies": { "arr-diff": "^1.1.0", "kind-of": "^2.0.1", "lazy-cache": "^0.2.3" }, "devDependencies": { "mocha": "*", "should": "*" }, "keywords": [ "accessor", "check", "data", "descriptor", "get", "getter", "is", "keys", "object", "properties", "property", "set", "setter", "type", "valid", "value" ], "verb": { "related": { "list": [ "is-descriptor", "is-data-descriptor", "is-accessor-descriptor", "isobject" ] } }, "gitHead": "4495b333d027292071cc03d0147099b92913de0d", "_id": "is-data-descriptor@0.1.3", "_shasum": "efa250bc0d94403f0cfb6079b579bc900a843bd0", "_from": ".", "_npmVersion": "2.14.4", "_nodeVersion": "4.1.1", "_npmUser": { "name": "jonschlinkert", "email": "github@sellside.com" }, "maintainers": [ { "name": "jonschlinkert", "email": "github@sellside.com" } ], "dist": { "shasum": "efa250bc0d94403f0cfb6079b579bc900a843bd0", "tarball": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.3.tgz" }, "directories": {} }, "0.1.4": { "name": "is-data-descriptor", "description": "Returns true if a value has the characteristics of a valid JavaScript data descriptor.", "version": "0.1.4", "homepage": "https://github.com/jonschlinkert/is-data-descriptor", "author": { "name": "Jon Schlinkert", "url": "https://github.com/jonschlinkert" }, "repository": { "type": "git", "url": "git+https://github.com/jonschlinkert/is-data-descriptor.git" }, "bugs": { "url": "https://github.com/jonschlinkert/is-data-descriptor/issues" }, "license": "MIT", "files": [ "index.js" ], "main": "index.js", "engines": { "node": ">=0.10.0" }, "scripts": { "test": "mocha" }, "dependencies": { "kind-of": "^3.0.2" }, "devDependencies": { "mocha": "*", "should": "*" }, "keywords": [ "accessor", "check", "data", "descriptor", "get", "getter", "is", "keys", "object", "properties", "property", "set", "setter", "type", "valid", "value" ], "verb": { "related": { "list": [ "is-accessor-descriptor", "is-data-descriptor", "is-descriptor", "isobject" ] }, "plugins": [ "gulp-format-md" ] }, "gitHead": "e6317dbcb27a95281a60120bac83f5938dda4e2c", "_id": "is-data-descriptor@0.1.4", "_shasum": "0b5ee648388e2c860282e793f1856fec3f301b56", "_from": ".", "_npmVersion": "3.3.6", "_nodeVersion": "5.0.0", "_npmUser": { "name": "jonschlinkert", "email": "github@sellside.com" }, "maintainers": [ { "name": "jonschlinkert", "email": "github@sellside.com" } ], "dist": { "shasum": "0b5ee648388e2c860282e793f1856fec3f301b56", "tarball": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz" }, "directories": {} }, "1.0.0": { "name": "is-data-descriptor", "description": "Returns true if a value has the characteristics of a valid JavaScript data descriptor.", "version": "1.0.0", "homepage": "https://github.com/jonschlinkert/is-data-descriptor", "author": { "name": "Jon Schlinkert", "url": "https://github.com/jonschlinkert" }, "contributors": [ { "name": "Jon Schlinkert", "url": "http://twitter.com/jonschlinkert" }, { "name": "Rouven Weßling", "url": "www.rouvenwessling.de" } ], "repository": { "type": "git", "url": "git+https://github.com/jonschlinkert/is-data-descriptor.git" }, "bugs": { "url": "https://github.com/jonschlinkert/is-data-descriptor/issues" }, "license": "MIT", "files": [ "index.js" ], "main": "index.js", "engines": { "node": ">=0.10.0" }, "scripts": { "test": "mocha" }, "dependencies": { "kind-of": "^6.0.0" }, "devDependencies": { "gulp-format-md": "^1.0.0", "mocha": "^3.5.3" }, "keywords": [ "accessor", "check", "data", "descriptor", "get", "getter", "is", "keys", "object", "properties", "property", "set", "setter", "type", "valid", "value" ], "verb": { "toc": false, "layout": "default", "tasks": [ "readme" ], "plugins": [ "gulp-format-md" ], "related": { "list": [ "is-accessor-descriptor", "is-data-descriptor", "is-descriptor", "isobject" ] }, "lint": { "reflinks": true } }, "gitHead": "42dcba2627fe655daa21aec843ca8de849f26cd6", "_id": "is-data-descriptor@1.0.0", "_npmVersion": "5.5.1", "_nodeVersion": "8.7.0", "_npmUser": { "name": "jonschlinkert", "email": "github@sellside.com" }, "dist": { "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", "shasum": "d84876321d0e7add03990406abbbbd36ba9268c7", "tarball": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz" }, "maintainers": [ { "name": "jonschlinkert", "email": "github@sellside.com" } ], "_npmOperationalInternal": { "host": "s3://npm-registry-packages", "tmp": "tmp/is-data-descriptor-1.0.0.tgz_1509518030206_0.015712385065853596" }, "directories": {} }, "2.0.0": { "name": "is-data-descriptor", "description": "Returns true if a value has the characteristics of a valid JavaScript data descriptor.", "version": "2.0.0", "homepage": "https://github.com/jonschlinkert/is-data-descriptor", "author": { "name": "Jon Schlinkert", "url": "https://github.com/jonschlinkert" }, "contributors": [ { "name": "Jon Schlinkert", "url": "http://twitter.com/jonschlinkert" }, { "name": "Rouven Weßling", "url": "www.rouvenwessling.de" } ], "repository": { "type": "git", "url": "git+https://github.com/jonschlinkert/is-data-descriptor.git" }, "bugs": { "url": "https://github.com/jonschlinkert/is-data-descriptor/issues" }, "license": "MIT", "main": "index.js", "engines": { "node": ">=6" }, "scripts": { "test": "mocha" }, "dependencies": { "kind-of": "^6.0.0" }, "devDependencies": { "gulp-format-md": "^1.0.0", "mocha": "^3.5.3" }, "keywords": [ "accessor", "check", "data", "descriptor", "get", "getter", "is", "keys", "object", "properties", "property", "set", "setter", "type", "valid", "value" ], "verb": { "toc": false, "layout": "default", "tasks": [ "readme" ], "plugins": [ "gulp-format-md" ], "related": { "list": [ "is-accessor-descriptor", "is-data-descriptor", "is-descriptor", "isobject" ] }, "lint": { "reflinks": true } }, "gitHead": "8dcc492bfb8e6d5b7964c1c566cdfe27ffbd8b0a", "_id": "is-data-descriptor@2.0.0", "_npmVersion": "6.4.1", "_nodeVersion": "11.4.0", "_npmUser": { "name": "jonschlinkert", "email": "github@sellside.com" }, "dist": { "integrity": "sha512-sbNf2A6rqSbDONhy0dbMlsgx0SNlDHH8zCNPNaG9Cxtb19HkMtqvoh4m9A246WX/Lj1zlMeNUsb0wPx+ZVrrmw==", "shasum": "90b4ec2922aa845ab946b26e06488bfc4a7bf23c", "tarball": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-2.0.0.tgz", "fileCount": 4, "unpackedSize": 8707, "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcEwd3CRA9TVsSAnZWagAAzdAP/1/QgCWHmKn+9ntVve++\njc6zv9NuHs12xKeueOuo6QzonOFfDNUCEgWm3AEQ7yPj1RT5cGJWKgz92pgI\nhaNtCJPPOslAjAJMfha1zYX00RR684b+YocPAGi0KwURtzoXw4vUokZ2Ksq0\nPkaRviNJ65bwJqbd4u7Cx6KRjEZD9OIcBOZUA+NbhzVYU1l83r3VXYOxdGkZ\n02Z9rHfKXzDctYMQ/dMbjp8lRTBiGCKQpyPAPnOuNuaqssIu98dEMHzIK6iD\n34Gaew8XysCN4MFaOmjuuSOjLVDf4tIgAXMd6Jxsf3xQPqbXrl0uSVNyDknF\nP2Ai6//82Hm+XPjXW5mMse537fCbl6PoI3uRTmnhO37us6UNo6ovOt+mOLHZ\n1W33naBZtkTLzVaRfK/1bl0LCYNVo3O7BirmX0bjohC6W+/2uLhaQUayyd3Y\nF3JM7LZKqPrsQd93pXgNz5U6zXHwUlR6Jo3pk6DsfV1lJUeQlMwvQFp2QwD3\nPWsJtMinjPSYIof8Q+PJy6luYiFf6iaQACC+AB5KN6s3Ce8DLndRIJDmfDrL\nT/O1TzZYbcwZj6orEt0xzZUXr6G6FjVKmR9Yucpb6Q8cPjGP8vcZA3qfbhn4\nuT/NEu2db1TNi3jYLTfrLuROnXBFpEKf3HZIP04STry2nr2KvQoND4vUzDgl\nMX3P\r\n=sNOi\r\n-----END PGP SIGNATURE-----\r\n" }, "maintainers": [ { "name": "jonschlinkert", "email": "github@sellside.com" } ], "directories": {}, "_npmOperationalInternal": { "host": "s3://npm-registry-packages", "tmp": "tmp/is-data-descriptor_2.0.0_1544750966547_0.8510560418397102" }, "_hasShrinkwrap": false } }, "readme": "# is-data-descriptor [![NPM version](https://img.shields.io/npm/v/is-data-descriptor.svg?style=flat)](https://www.npmjs.com/package/is-data-descriptor) [![NPM monthly downloads](https://img.shields.io/npm/dm/is-data-descriptor.svg?style=flat)](https://npmjs.org/package/is-data-descriptor) [![NPM total downloads](https://img.shields.io/npm/dt/is-data-descriptor.svg?style=flat)](https://npmjs.org/package/is-data-descriptor) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/is-data-descriptor.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/is-data-descriptor)\n\n> Returns true if a value has the characteristics of a valid JavaScript data descriptor.\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 is-data-descriptor\n```\n\n## Usage\n\n```js\nvar isDataDesc = require('is-data-descriptor');\n```\n\n## Examples\n\n`true` when the descriptor has valid properties with valid values.\n\n```js\n// `value` can be anything\nisDataDesc({value: 'foo'})\nisDataDesc({value: function() {}})\nisDataDesc({value: true})\n//=> true\n```\n\n`false` when not an object\n\n```js\nisDataDesc('a')\n//=> false\nisDataDesc(null)\n//=> false\nisDataDesc([])\n//=> false\n```\n\n`false` when the object has invalid properties\n\n```js\nisDataDesc({value: 'foo', bar: 'baz'})\n//=> false\nisDataDesc({value: 'foo', bar: 'baz'})\n//=> false\nisDataDesc({value: 'foo', get: function(){}})\n//=> false\nisDataDesc({get: function(){}, value: 'foo'})\n//=> false\n```\n\n`false` when a value is not the correct type\n\n```js\nisDataDesc({value: 'foo', enumerable: 'foo'})\n//=> false\nisDataDesc({value: 'foo', configurable: 'foo'})\n//=> false\nisDataDesc({value: 'foo', writable: 'foo'})\n//=> false\n```\n\n## Valid properties\n\nThe only valid data descriptor properties are the following:\n\n* `configurable` (required)\n* `enumerable` (required)\n* `value` (optional)\n* `writable` (optional)\n\nTo be a valid data descriptor, either `value` or `writable` must be defined.\n\n**Invalid properties**\n\nA descriptor may have additional _invalid_ properties (an error will **not** be thrown).\n\n```js\nvar foo = {};\n\nObject.defineProperty(foo, 'bar', {\n enumerable: true,\n whatever: 'blah', // invalid, but doesn't cause an error\n get: function() {\n return 'baz';\n }\n});\n\nconsole.log(foo.bar);\n//=> 'baz'\n```\n\n## About\n\n
\nContributing\n\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).\n\n
\n\n
\nRunning 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
\n\n
\nBuilding 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
\n\n### Related projects\n\nYou might also be interested in these 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### Contributors\n\n| **Commits** | **Contributor** | \n| --- | --- |\n| 21 | [jonschlinkert](https://github.com/jonschlinkert) |\n| 2 | [realityking](https://github.com/realityking) |\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 November 01, 2017._", "maintainers": [ { "name": "jonschlinkert", "email": "github@sellside.com" } ], "time": { "modified": "2019-01-04T05:37:15.580Z", "created": "2015-08-31T05:53:38.948Z", "0.1.0": "2015-08-31T05:53:38.948Z", "0.1.1": "2015-08-31T06:15:39.053Z", "0.1.2": "2015-10-04T18:58:53.735Z", "0.1.3": "2015-10-04T19:03:04.835Z", "0.1.4": "2015-12-28T09:06:01.896Z", "1.0.0": "2017-11-01T06:33:51.072Z", "2.0.0": "2018-12-14T01:29:26.701Z" }, "homepage": "https://github.com/jonschlinkert/is-data-descriptor", "keywords": [ "accessor", "check", "data", "descriptor", "get", "getter", "is", "keys", "object", "properties", "property", "set", "setter", "type", "valid", "value" ], "repository": { "type": "git", "url": "git+https://github.com/jonschlinkert/is-data-descriptor.git" }, "author": { "name": "Jon Schlinkert", "url": "https://github.com/jonschlinkert" }, "bugs": { "url": "https://github.com/jonschlinkert/is-data-descriptor/issues" }, "license": "MIT", "readmeFilename": "README.md", "contributors": [ { "name": "Jon Schlinkert", "url": "http://twitter.com/jonschlinkert" }, { "name": "Rouven Weßling", "url": "www.rouvenwessling.de" } ] }