{"name":"is-data-descriptor","version":"2.1.2","description":"Returns true if a value has the characteristics of a valid JavaScript data descriptor.","main":"index.js","exports":{".":"./index.js","./package.json":"./package.json"},"scripts":{"prepack":"npmignore --auto --commentLines=autogenerated","prepublishOnly":"safe-publish-latest","prepublish":"not-in-publish || npm run prepublishOnly","lint":"eslint --ext=js,mjs .","pretest":"npm run lint","tests-only":"nyc tape 'test/**/*.js'","test":"npm run tests-only","posttest":"aud --production","prelint":"evalmd README.md","version":"auto-changelog && git add CHANGELOG.md","postversion":"auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""},"repository":{"type":"git","url":"git+https://github.com/inspect-js/is-data-descriptor.git"},"keywords":["accessor","check","data","descriptor","get","getter","is","keys","object","properties","property","set","setter","type","valid","value"],"author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"license":"MIT","bugs":{"url":"https://github.com/inspect-js/is-data-descriptor/issues"},"homepage":"https://github.com/inspect-js/is-data-descriptor","contributors":[{"name":"Jordan Harband","url":"https://github.com/ljharb"},{"name":"Jon Schlinkert","url":"https://twitter.com/jonschlinkert"},{"name":"Rouven Weßling","url":"www.rouvenwessling.de"}],"devDependencies":{"@ljharb/eslint-config":"^21.1.0","aud":"^2.0.3","auto-changelog":"^2.4.0","eslint":"=8.8.0","evalmd":"^0.0.19","in-publish":"^2.0.1","npmignore":"^0.3.0","nyc":"^10.3.2","safe-publish-latest":"^2.0.0","tape":"^5.7.2"},"engines":{"node":">= 0.4"},"auto-changelog":{"output":"CHANGELOG.md","template":"keepachangelog","unreleased":false,"commitLimit":false,"backfillLimit":false,"hideCredit":true},"publishConfig":{"ignore":[".github/workflows"]},"dependencies":{"hasown":"^2.0.0"},"_id":"is-data-descriptor@2.1.2","gitHead":"a3ef44974d08bd2d217688df8212a27a57cdaafa","_nodeVersion":"21.0.0","_npmVersion":"10.2.0","dist":{"integrity":"sha512-RO85eqXJ+fMtF7HEwxY3InsXM9HRo7vAfXlefpIkKpWBjlzkT2BSbi0cf4iHb7OEdoqI8NKWheug60I1ZTdjIg==","shasum":"ca8d566a5a7371836c6f9de35f9e918496aa6e1d","tarball":"http://registry-npm.ywwl.com/is-data-descriptor/download/is-data-descriptor-2.1.2.tgz","fileCount":11,"unpackedSize":18064,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICHpe5gAWXzdWe1/U9BaSrutlqlTtYsb2vzz6Fe/qBweAiEAoRzk2WoWvu3AHeP86lRXXuM6jtYFRA6LCbZSR5458k8="}],"size":6400,"noattachment":false,"key":"/is-data-descriptor/-/is-data-descriptor-2.1.2.tgz"},"_npmUser":{"name":"ljharb","email":"ljharb@gmail.com"},"directories":{},"maintainers":[{"name":"ljharb","email":"ljharb@gmail.com"},{"name":"jonschlinkert","email":"github@sellside.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/is-data-descriptor_2.1.2_1698295966372_0.4596400400687235"},"_hasShrinkwrap":false,"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":1698295966652,"_cnpm_publish_time":1698295966652,"dist-tags":{"latest":"2.1.3","v0-backport":"0.1.5","v1-backport":"1.0.1"}}