{"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":"http://registry-npm.ywwl.com/is-data-descriptor/download/is-data-descriptor-0.1.0.tgz","integrity":"sha512-35HBCCOSeY5fCXA+IJqeO+oGnDQMoH4yEOXJwNoUKb2tzUJWcBtyjUnnIzt+3zpnW5SHjjyIJ8zTW2NrloKiOQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD3TD5UGfjNsmRqPQiGJipmpJa/5HorM5FF7LdkzWnpawIhAPbtH3iKwVMYTMmylrz7EXbJa4uq1zby6oDSDEiFJlHy"}],"size":2423,"noattachment":false,"key":"/is-data-descriptor/-/is-data-descriptor-0.1.0.tgz"},"directories":{},"readme":"# is-data-descriptor <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\n> Returns true if a value has the characteristics of a valid JavaScript data descriptor.\n\n## Examples\n\n`true` when the descriptor has valid properties with valid values.\n`false` when not an object or when the object has invalid properties.\n\n```js\nvar isDataDesc = require('is-data-descriptor');\nvar assert = require('assert');\n\nassert.equal(true, isDataDesc({ value: 'foo' }));\nassert.equal(true, isDataDesc({ value: function () {} }));\nassert.equal(true, isDataDesc({ value: true }));\n\nassert.equal(false, isDataDesc('a'));\nassert.equal(false, isDataDesc(null));\nassert.equal(false, isDataDesc([]));\n\nassert.equal(false, isDataDesc({ value: 'foo', bar: 'baz' }));\nassert.equal(false, isDataDesc({ value: 'foo', bar: 'baz' }));\nassert.equal(false, isDataDesc({ value: 'foo', get: function () {} }));\nassert.equal(false, isDataDesc({ get: function () {}, value: 'foo' }) );\n \nassert.equal(false, isDataDesc({ value: 'foo', enumerable: 'foo' }));\nassert.equal(false, isDataDesc({ value: 'foo', configurable: 'foo' }));\nassert.equal(false, isDataDesc({ value: 'foo', writable: 'foo' }));\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\tenumerable: true,\n\twhatever: 'blah', // invalid, but doesn't cause an error\n\tget() {\n\t\treturn 'baz';\n\t}\n});\n\nassert.equal(foo.bar, 'baz');\n```\n\n### Related projects\n\n* [is-accessor-descriptor](https://npmjs.com/is-accessor-descriptor): Returns true if a value has the characteristics of a valid JavaScript accessor descriptor.\n* [is-descriptor](https://npmjs.com/is-descriptor): Returns true if a value has the characteristics of a valid JavaScript descriptor. Works for… [more](https://npmjs.com/is-descriptor)\n\n## Tests\n\nSimply clone the repo, `npm install`, and run `npm test`\n\n[package-url]: https://npmjs.org/package/is-data-descriptor\n[npm-version-svg]: https://versionbadg.es/inspect-js/is-data-descriptor.svg\n[deps-svg]: https://david-dm.org/inspect-js/is-data-descriptor.svg\n[deps-url]: https://david-dm.org/inspect-js/is-data-descriptor\n[dev-deps-svg]: https://david-dm.org/inspect-js/is-data-descriptor/dev-status.svg\n[dev-deps-url]: https://david-dm.org/inspect-js/is-data-descriptor#info=devDependencies\n[npm-badge-png]: https://nodei.co/npm/is-data-descriptor.png?downloads=true&stars=true\n[license-image]: https://img.shields.io/npm/l/is-data-descriptor.svg\n[license-url]: LICENSE\n[downloads-image]: https://img.shields.io/npm/dm/is-data-descriptor.svg\n[downloads-url]: https://npm-stat.com/charts.html?package=is-data-descriptor\n[codecov-image]: https://codecov.io/gh/inspect-js/is-data-descriptor/branch/main/graphs/badge.svg\n[codecov-url]: https://app.codecov.io/gh/inspect-js/is-data-descriptor/\n[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/inspect-js/is-data-descriptor\n[actions-url]: https://github.com/inspect-js/is-data-descriptor/actions\n","publish_time":1441000418948,"_cnpm_publish_time":1441000418948,"dist-tags":{"latest":"2.1.3","v0-backport":"0.1.5","v1-backport":"1.0.1"}}