{"_id":"shallow-clone-shim","_rev":"3-856b6c498c56fa06611fca5d394c47f7","name":"shallow-clone-shim","dist-tags":{"latest":"2.0.0"},"versions":{"1.0.0":{"name":"shallow-clone-shim","version":"1.0.0","description":"Shallow clones an object while respecting the original property descriptors","main":"index.js","dependencies":{},"devDependencies":{"standard":"^14.3.1","tape":"^4.11.0"},"scripts":{"test":"standard && node test.js"},"repository":{"type":"git","url":"git+https://github.com/watson/shallow-clone-shim.git"},"keywords":["clone","shallow","copy","getter","setter","configurable","enumerable","writable","property","properties","descritor","descriptors","shim","shimming","overwrite","override","monkey","patch","monkey-patch","monkeypatch"],"author":{"name":"Thomas Watson","email":"w@tson.dk","url":"https://twitter.com/wa7son"},"license":"MIT","bugs":{"url":"https://github.com/watson/shallow-clone-shim/issues"},"homepage":"https://github.com/watson/shallow-clone-shim#readme","coordinates":[55.778269,12.593145],"gitHead":"c9e96cb5c06733f46c71b567fadc1b79ada935b2","_id":"shallow-clone-shim@1.0.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","_npmUser":{"name":"watson","email":"w@tson.dk"},"dist":{"integrity":"sha512-7L/kS1sVoEnPTLp9GMsSKiqPBK6O0Q95wSvH7sMjzgy6CIPQqC0h1ljXWfO66q3imYx00HOjeRURg+qlqFptsQ==","shasum":"2dd048b314c3ee099deaaa9e430e6c4c426f3743","tarball":"https://registry.npmjs.org/shallow-clone-shim/-/shallow-clone-shim-1.0.0.tgz","fileCount":4,"unpackedSize":4827,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdtr+VCRA9TVsSAnZWagAAcpIQAIjWfl1iHMJooP5knvyK\nbZDWJCzTSrOeqMG2lU/xGafzgEK/Ap4+SZGfdAD3i2EXKY5LwFpvM6Zv9jD9\nbdqMn6rBOcBz4zlL6Uw+nMQjIjiOYD8rW6zalk0NBw/tgNCRR5fM7qwVilzH\nXaDmnElbw/oAFyPTdgljPJSO2yOHe7TEY5apLyZDNidoZk4nMTFcSQg/k3rV\nkuLrxgKKk1kwC7tD2kuzb17z5QW1CWL7JEoCsia3q5ccqPsFNBtvGiz6JIhT\n4H9uWkNWErNtlUxQSPZj/mE7ZhWDUdBVTc+HTipmFZeG9VSTc4xaQcFV5gU4\nAupPjUPZo7WdXJBbG/4H2NT26P04vMYsoqHt5OcwepX3n1W84LywEA7mZaoz\nUwTGmP5FjdReECghIaq1UNZpPsomq0Q4seoJ6++7uUDQUw4X5Fv1j5ybesp9\nRolKaDVTm7E1dvIQHM+l9+drVqPNGooovOu7huX/jGya4C6hIrglGeXstZqc\nzsfFbZY2zBwD9aJ+m+igD/33ONMPBrZhuY0y3y7kRyaDpeDUMqG45FbKCwG6\nLm86FBqI6b9zYUbJSVGyDf/I4L3O71E/BGH3stWmRQduQ2NwDy8gm3e87sTT\n8MBwv2jFXf+APHYG0YHWdJiGcD1IWsoqKznnZO9FRaa+ghpuXQOpyU/vDigu\no8g4\r\n=bmM2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDmAffBD5fANqa7bqlyOQzNAjBaSnKhpXPsJsk9tI01NwIhAO/vOTVSSzS6zf9HfeDQf7O78xJMomAxKhm+xsjV1EDr"}]},"maintainers":[{"name":"watson","email":"w@tson.dk"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/shallow-clone-shim_1.0.0_1572257685385_0.43355966790226486"},"_hasShrinkwrap":false},"1.1.0":{"name":"shallow-clone-shim","version":"1.1.0","description":"Shallow clones an object while respecting the original property descriptors","main":"index.js","dependencies":{"get-own-property-descriptors-polyfill":"^1.0.1"},"devDependencies":{"standard":"^14.3.1","tape":"^4.11.0"},"scripts":{"test":"standard && node test.js"},"repository":{"type":"git","url":"git+https://github.com/watson/shallow-clone-shim.git"},"keywords":["clone","shallow","copy","getter","setter","configurable","enumerable","writable","property","properties","descritor","descriptors","shim","shimming","overwrite","override","monkey","patch","monkey-patch","monkeypatch"],"author":{"name":"Thomas Watson","email":"w@tson.dk","url":"https://twitter.com/wa7son"},"license":"MIT","bugs":{"url":"https://github.com/watson/shallow-clone-shim/issues"},"homepage":"https://github.com/watson/shallow-clone-shim#readme","coordinates":[55.778258,12.593204],"gitHead":"44216584c5f96f749c910cac4f8df05c21c4d776","_id":"shallow-clone-shim@1.1.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","_npmUser":{"name":"watson","email":"w@tson.dk"},"dist":{"integrity":"sha512-ZY+sf7fm8CDFecoL/IntHFhqu8Ll+elOcuXO5WlVgSfnpxuUMni/Y9sB9gMf85nWsVDM+CfMJpLBwiN/lOO5/w==","shasum":"c1048ba9167f313f4f4c019ff3f0a40626322960","tarball":"https://registry.npmjs.org/shallow-clone-shim/-/shallow-clone-shim-1.1.0.tgz","fileCount":4,"unpackedSize":4996,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJduv17CRA9TVsSAnZWagAA4h4P/1FTV40UFlNze3008gni\nMHb7Ml49+9SjgU1QrKe/RogbM+UeOaea9BX41QUywZ67y2d5ffsabq2U2cZE\nJj8Yzh12QGbwJYc1nx8GfXI3paC+AXbCPEl80sWV6UZSV3JxZvSWmGVHu0iT\nJ90ivY9g4JcEdIB5LWF6Sef0ByBECEXROQF89viR8986ZFBf/2QMpDT7qV/W\nByC+DG/iavGci93KfmEVZI1I5O4MC2WLeUnyZbHaRMnlboAmS3ALOgUyfNYn\nybTxefETfRWCpdBEfq6bk9WIRrnRD4ZHvB01SYvA4+X5jGidDFuOvpU35zC+\ncg7KdlEL+bieBMZuCrSp1cUCJrhFVX1Qj2SvC7w77SMr3uz7hgvxFVps6j0F\nVkmyeBtS3taRvzS8k0mwysBL778qcMSjoLTf7490tkILgurIsZ9S0drnss9o\nho5OeH+iGXSlGMCt0ChpnEJTYzMZH9paxK9B4HEwPZioxPxLlLYNnnyppMCs\nMmDJWj86ajJDYCXVtvtuOFlnPnR0//mnkTTEMC9QUCWyIKLTiVHMvExpC9rB\nXP19XwkXsEKVuyzL3yNN5MyyXzUYtzSeN9N7BsrQUX2EoHMyH4/GnAWVfgOj\n0lYDp0yOSY7gTpjl2vbQdfza9ba7v5H3SOAT/UDDit4mnVM/X1xcBv65nGja\nRNHd\r\n=xI4G\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDJfzPadbZOlVNq4XXpy9A1Wjf92zwKFe2aggwcCMpTdAiEA9vJY57BRPkRFAZpm1SqBoMjalkIWM9+ixJRWQ2UEKzg="}]},"maintainers":[{"name":"watson","email":"w@tson.dk"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/shallow-clone-shim_1.1.0_1572535674679_0.262770079610702"},"_hasShrinkwrap":false},"2.0.0":{"name":"shallow-clone-shim","version":"2.0.0","description":"Shallow clones an object while respecting the original property descriptors","main":"index.js","dependencies":{},"devDependencies":{"standard":"^14.3.1","tape":"^4.11.0"},"scripts":{"test":"standard && node test.js"},"repository":{"type":"git","url":"git+https://github.com/watson/shallow-clone-shim.git"},"keywords":["clone","shallow","copy","getter","setter","configurable","enumerable","writable","property","properties","descritor","descriptors","shim","shimming","overwrite","override","monkey","patch","monkey-patch","monkeypatch"],"author":{"name":"Thomas Watson","email":"w@tson.dk","url":"https://twitter.com/wa7son"},"license":"MIT","bugs":{"url":"https://github.com/watson/shallow-clone-shim/issues"},"homepage":"https://github.com/watson/shallow-clone-shim#readme","coordinates":[55.778278,12.592982],"gitHead":"b9c2a73e0ed1c7e01f4881a5cbfcfe37352bd9be","_id":"shallow-clone-shim@2.0.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","_npmUser":{"name":"watson","email":"w@tson.dk"},"dist":{"integrity":"sha512-YRNymdiL3KGOoS67d73TEmk4tdPTO9GSMCoiphQsTcC9EtC+AOmMPjkyBkRoCJfW9ASsaZw1craaiw1dPN2D3Q==","shasum":"b62bf55aed79f4c1430ea1dc4d293a193f52cf91","tarball":"https://registry.npmjs.org/shallow-clone-shim/-/shallow-clone-shim-2.0.0.tgz","fileCount":4,"unpackedSize":4826,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJduv+JCRA9TVsSAnZWagAAuksP/2/W3t7p7SCPb+IPiamn\nBFF/YBxJC4L3/Vi6peSvm4f6uJ3El0RH9Eu7o3xSG3s9inJe3zzIS6XHpfNg\nlRpgS+k6FRBk99bedi1d5wnxKtzCGotWzLhUlH5A8VQo3L1cPpDAp7rPzGV2\nwbT7i0XmSjo7hmNPlmZpOs8PiBKpbcq8ktbz4xQkGwJrYmT5ZsYxWb8BzAI+\nuqhm+docqom96O/CUQqkP5Piayj8NYqYk9aGBV3QFbIPknpupZgXuVrEHZId\nPuKu/H0XrOSql79ziH+G4PnAAuXr8uqArIlAlv6Dep1XtRVnugv5foQqp2CD\nHLfx3FhV+W4Dm4BgalVn4UK7MbnnPjn1zOmQm2wtMWI6E8k5iTdyoquWmSOs\nCqiAAJEdxDL48xiTdGK6jLyQ5O0aK7/+Tjln5Y+6fx3J/KsNEBnKLRCQnZcK\nGlqobqPMp9nPFtqN+zbhh09aQbBX8YpTFPzz2w+rQZIM0oQCJ9n5iVlbyzwh\nz8i6+0vaXdh1O9JAbbsQk8P4fmaeTUobCeH+u2F3+LSdBiHS716zF19pv8zX\nOw2a9so4BoF1JRAgK0yuTqYzDOwwDdV7UdmU9dV6VEnWDZv/LLTvEKQevWsu\nYuC0L6w26cqq8UTFCh8mUzX5ezaB+XlI23rmHYqll2qFDr+EdwIh0skgzie2\niIK1\r\n=DLj1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCPLKNRL5TAbD1c3mMFVs+0Kb2ZpkCWqh00WEQjNHN26AIhAK+4OJtYJNzcD/BkFFDNQqdm7xxXS6Ct2oMpRtcxXCPi"}]},"maintainers":[{"name":"watson","email":"w@tson.dk"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/shallow-clone-shim_2.0.0_1572536201415_0.1291804425156986"},"_hasShrinkwrap":false}},"time":{"created":"2019-10-28T10:14:45.385Z","1.0.0":"2019-10-28T10:14:45.534Z","modified":"2022-05-17T15:44:56.330Z","1.1.0":"2019-10-31T15:27:54.813Z","2.0.0":"2019-10-31T15:36:41.609Z"},"maintainers":[{"name":"watson","email":"w@tson.dk"}],"description":"Shallow clones an object while respecting the original property descriptors","homepage":"https://github.com/watson/shallow-clone-shim#readme","keywords":["clone","shallow","copy","getter","setter","configurable","enumerable","writable","property","properties","descritor","descriptors","shim","shimming","overwrite","override","monkey","patch","monkey-patch","monkeypatch"],"repository":{"type":"git","url":"git+https://github.com/watson/shallow-clone-shim.git"},"author":{"name":"Thomas Watson","email":"w@tson.dk","url":"https://twitter.com/wa7son"},"bugs":{"url":"https://github.com/watson/shallow-clone-shim/issues"},"license":"MIT","readme":"# shallow-clone-shim\n\nShallow clones an object, including non-enumerable properties, while\nrespecting the original data and accessor descriptors of the properties.\nThis means that for instances getters and setters are copied faithfully.\nOptionally allows for shimming/overwriting properties by redefining or\nmanipulating existing property descriptors.\n\n[![npm](https://img.shields.io/npm/v/shallow-clone-shim.svg)](https://www.npmjs.com/package/shallow-clone-shim)\n[![build status](https://travis-ci.org/watson/shallow-clone-shim.svg?branch=master)](https://travis-ci.org/watson/shallow-clone-shim)\n[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](https://github.com/feross/standard)\n\n## Installation\n\n```\nnpm install shallow-clone-shim --save\n```\n\n## Usage\n\n```js\nconst assert = require('assert')\nconst clone = require('shallow-clone-shim')\n\nconst original = Object.defineProperties({}, {\n  foo: { // non-writable\n    value: 1\n  },\n  bar: { // non-configurable\n    enumerable: true,\n    get: function get () {\n      return 2\n    }\n  }\n})\n\nassert.strictEqual(original.foo, 1)\nassert.strictEqual(original.bar, 2)\n\nconst copy = clone({}, original, {\n  bar (descriptor) {\n    // descriptor == Object.getOwnPropertyDescriptor(original, 'bar')\n    const getter = descriptor.get\n    descriptor.get = function get () {\n      return getter() + 1\n    }\n    return descriptor\n  }\n})\n\nassert.strictEqual(original.foo, 1)\nassert.strictEqual(original.bar, 3)\n```\n\n## API\n\n### `object = clone(object, original[, shim])`\n\nShallow copies all own properties of the `original` into `object`. Both\nenumerable and non-enumerable properties are copied.\n\nThe `object` is also returned.\n\nIf the optional `shim` argument is supplied, it's expected to be an\nobject containing functions. The names of the `shim` object propeties is\nexpected to match the names of properties in the `original` object. Each\nshim function is called with the property descriptor for that particular\nproperty in `original`. The function is expected to return a valid\nproperty descriptor as expected by [`Object.defineProperty()`]. The\nreturned desciptor will replace the original descriptor in the copied\nobject.\n\n## License\n\n[MIT](LICENSE)\n\n[`Object.defineProperty()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty\n","readmeFilename":"README.md"}