{"name":"define-properties","description":"Define multiple non-enumerable properties at once. Uses `Object.defineProperty` when available; falls back to standard assignment in older engines.","dist-tags":{"latest":"1.2.0"},"versions":{"1.2.0":{"name":"define-properties","version":"1.2.0","author":{"name":"Jordan Harband","email":"ljharb@gmail.com"},"funding":{"url":"https://github.com/sponsors/ljharb"},"description":"Define multiple non-enumerable properties at once. Uses `Object.defineProperty` when available; falls back to standard assignment in older engines.","license":"MIT","main":"index.js","scripts":{"prepack":"npmignore --auto --commentLines=autogenerated","prepublish":"not-in-publish || npm run prepublishOnly","prepublishOnly":"safe-publish-latest","pretest":"npm run lint","test":"npm run tests-only","posttest":"aud --production","tests-only":"nyc tape 'test/**/*.js'","lint":"eslint --ext=js,mjs .","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://github.com/ljharb/define-properties.git"},"dependencies":{"has-property-descriptors":"^1.0.0","object-keys":"^1.1.1"},"devDependencies":{"@ljharb/eslint-config":"^21.0.1","aud":"^2.0.2","auto-changelog":"^2.4.0","eslint":"=8.8.0","in-publish":"^2.0.1","npmignore":"^0.3.0","nyc":"^10.3.2","safe-publish-latest":"^2.0.0","tape":"^5.6.3"},"testling":{"files":"test/index.js","browsers":["iexplore/6.0..latest","firefox/3.0..6.0","firefox/15.0..latest","firefox/nightly","chrome/4.0..10.0","chrome/20.0..latest","chrome/canary","opera/10.0..latest","opera/next","safari/4.0..latest","ipad/6.0..latest","iphone/6.0..latest","android-browser/4.2"]},"engines":{"node":">= 0.4"},"auto-changelog":{"output":"CHANGELOG.md","template":"keepachangelog","unreleased":false,"commitLimit":false,"backfillLimit":false,"hideCredit":true,"startingVersion":"1.1.5"},"publishConfig":{"ignore":[".github/workflows","test/"]},"gitHead":"aa5afa274d736c1ebd59e403b5b3b5b404689a57","bugs":{"url":"https://github.com/ljharb/define-properties/issues"},"_id":"define-properties@1.2.0","_nodeVersion":"19.6.0","_npmVersion":"9.4.0","dist":{"integrity":"sha512-xvqAVKGfT1+UAvPwKTVw/njhdQ8ZhXK4lI0bCIuCMrp2up9nPnaDftrLtmpTazqd1o+UY4zgzU+avtMbDP+ldA==","shasum":"52988570670c9eacedd8064f4a990f2405849bd5","tarball":"http://localhost:4260/define-properties/define-properties-1.2.0.tgz","fileCount":9,"unpackedSize":12453,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC2R6SBVZWJCCg7Z1PkTr8TYLGBpk5aQNaXmqzjLJml2QIgJipbNCmGIXHgvp4vOv0L/SBkYkerCHZ2PyQBAVjAScQ="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj5niKACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqcWBAAgCes8tVtZ6ORE3V+bO+EyPBU76QcCa52bvve/uQKu2DvcSJz\r\nnvnC1aIUlDkR8/ZHI8LC5ONJOos5nIvVwC9cjqjXekk9Y1pXtdmNmplQms04\r\njWnZGp23RWhR0RkghJT7c33Zt+6o0f0RokC/pXheR37qRTclwtx/QXHc3U15\r\nqWb8fQbotRHSnoo7bMAM6DVmEeGQD8KIPd5NtoLx6qL0IWP0kQzo1LUs8Cif\r\nE6Y6jkrknPhptz9aVOIj2H0AVtj7NzjSSxtk4qjg3v3Vw35dSj1vC5UuoT65\r\nn6bBMSk2uS7ISTcKJJsYvRHbfk06XQJdO0/LXPlzqLDjt34tA7M91l+Wmvbz\r\nJNuuoo0jmnMk0PLK4PCvAGLBnPUiBH+02iPwLL0EfrGSRaBIOEi+ZNrAqu2M\r\n8kb58GjN4qtfBwobdq2AIDSJKJ3tkss0KV7a8j54+sKyDHEoAXD/XziI4Q4v\r\nNtZCiFF4xtmphCOgj04j1Bp26gB0c6SRTXm7Glsw7vm4bpwsxxdL5GIoIQAA\r\np3laNAtXOOgVDguFoGHwfJTkL2d2lCpfiY66YpemYptsA0lQEEjvVhyrkHpO\r\nesbdlZi8EiZcZTNdto2Gj5iFr8Pqd764Z9+DLH/DaVGFcX+z6NgNRN1Ia49L\r\nLOetyEJ8/3fa4D+k3b531EH/iXJl8zQu9q0=\r\n=oqSW\r\n-----END PGP SIGNATURE-----\r\n"},"directories":{},"_hasShrinkwrap":false}},"readme":"# define-properties [![Version Badge][npm-version-svg]][package-url]\n\n[![github actions][actions-image]][actions-url]\n[![coverage][codecov-image]][codecov-url]\n[![dependency status][deps-svg]][deps-url]\n[![dev dependency status][dev-deps-svg]][dev-deps-url]\n[![License][license-image]][license-url]\n[![Downloads][downloads-image]][downloads-url]\n\n[![npm badge][npm-badge-png]][package-url]\n\nDefine multiple non-enumerable properties at once. Uses `Object.defineProperty` when available; falls back to standard assignment in older engines.\nExisting properties are not overridden. Accepts a map of property names to a predicate that, when true, force-overrides.\n\n## Example\n\n```js\nvar define = require('define-properties');\nvar assert = require('assert');\n\nvar obj = define({ a: 1, b: 2 }, {\n\ta: 10,\n\tb: 20,\n\tc: 30\n});\nassert(obj.a === 1);\nassert(obj.b === 2);\nassert(obj.c === 30);\nif (define.supportsDescriptors) {\n\tassert.deepEqual(Object.keys(obj), ['a', 'b']);\n\tassert.deepEqual(Object.getOwnPropertyDescriptor(obj, 'c'), {\n\t\tconfigurable: true,\n\t\tenumerable: false,\n\t\tvalue: 30,\n\t\twritable: false\n\t});\n}\n```\n\nThen, with predicates:\n```js\nvar define = require('define-properties');\nvar assert = require('assert');\n\nvar obj = define({ a: 1, b: 2, c: 3 }, {\n\ta: 10,\n\tb: 20,\n\tc: 30\n}, {\n\ta: function () { return false; },\n\tb: function () { return true; }\n});\nassert(obj.a === 1);\nassert(obj.b === 20);\nassert(obj.c === 3);\nif (define.supportsDescriptors) {\n\tassert.deepEqual(Object.keys(obj), ['a', 'c']);\n\tassert.deepEqual(Object.getOwnPropertyDescriptor(obj, 'b'), {\n\t\tconfigurable: true,\n\t\tenumerable: false,\n\t\tvalue: 20,\n\t\twritable: false\n\t});\n}\n```\n\n## Tests\nSimply clone the repo, `npm install`, and run `npm test`\n\n[package-url]: https://npmjs.org/package/define-properties\n[npm-version-svg]: https://versionbadg.es/ljharb/define-properties.svg\n[deps-svg]: https://david-dm.org/ljharb/define-properties.svg\n[deps-url]: https://david-dm.org/ljharb/define-properties\n[dev-deps-svg]: https://david-dm.org/ljharb/define-properties/dev-status.svg\n[dev-deps-url]: https://david-dm.org/ljharb/define-properties#info=devDependencies\n[npm-badge-png]: https://nodei.co/npm/define-properties.png?downloads=true&stars=true\n[license-image]: https://img.shields.io/npm/l/define-properties.svg\n[license-url]: LICENSE\n[downloads-image]: https://img.shields.io/npm/dm/define-properties.svg\n[downloads-url]: https://npm-stat.com/charts.html?package=define-properties\n[codecov-image]: https://codecov.io/gh/ljharb/define-properties/branch/main/graphs/badge.svg\n[codecov-url]: https://app.codecov.io/gh/ljharb/define-properties/\n[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/define-properties\n[actions-url]: https://github.com/ljharb/define-properties/actions\n","homepage":"https://github.com/ljharb/define-properties#readme","repository":{"type":"git","url":"git://github.com/ljharb/define-properties.git"},"author":{"name":"Jordan Harband","email":"ljharb@gmail.com"},"bugs":{"url":"https://github.com/ljharb/define-properties/issues"},"license":"MIT","readmeFilename":"README.md"}