{"_id":"@konfirm/trap","_rev":"26-8f0e13f8304ca60e02c9fd27fcb459ee","name":"@konfirm/trap","description":"Provide traps for use as Proxy handler, allowing to keep track of changes and choose to commit or rollback changes","dist-tags":{"latest":"2.0.3","beta":"2.0.0-beta.7"},"versions":{"1.0.0":{"name":"@konfirm/trap","version":"1.0.0","description":"Provide traps for use as Proxy handler, allowing to keep track of changes and choose to commit or rollback changes","main":"source/trap.js","scripts":{"test":"lab -clr","test-coverage-html":"lab -clr html -o report.html"},"keywords":["proxy","trap"],"author":{"name":"Rogier Spieker","email":"rogier@konfirm.eu"},"license":"MIT","devDependencies":{"@konfirm/labrat":"^1.1.0","eslint-config-strict":"^14.0.1"},"gitHead":"753b213ffd87e98673339821416874a86e0d01e0","_id":"@konfirm/trap@1.0.0","_shasum":"790eec716601eaa67dbe5cf41c8c6440113f8716","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.9.1","_npmUser":{"name":"rogier.spieker","email":"rogier+npm@konfirm.io"},"maintainers":[{"name":"rogier.spieker","email":"rogier+npm@konfirm.eu"}],"dist":{"shasum":"790eec716601eaa67dbe5cf41c8c6440113f8716","tarball":"https://registry.npmjs.org/@konfirm/trap/-/trap-1.0.0.tgz","integrity":"sha512-q5HmHtziY2gwZirSazOVJFwJ0GtnRncN5T6R36GF+W5MYAkniowL/iqRqVszihooRH4Cfh9pZCiX16qma+4JlQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDAUrRF149lDF17c+fJL1mB53O8UbO4p1LFvgg/SSOHtQIgAR8W4vc8OmBznjWjuLhaM9bCArwRJ77AO6Cp/mRDsoU="}]},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trap-1.0.0.tgz_1512315299466_0.11820419016294181"},"directories":{}},"1.0.1":{"name":"@konfirm/trap","version":"1.0.1","description":"Provide traps for use as Proxy handler, allowing to keep track of changes and choose to commit or rollback changes","main":"source/trap.js","scripts":{"test":"lab -clr","test-coverage-html":"lab -clr html -o report.html"},"keywords":["proxy","trap"],"author":{"name":"Rogier Spieker","email":"rogier@konfirm.eu"},"license":"MIT","devDependencies":{"@konfirm/labrat":"^1.1.0","eslint-config-strict":"^14.0.1"},"gitHead":"a19a99b9759f2ee32af7b412e1b267af9d91f376","_id":"@konfirm/trap@1.0.1","_shasum":"3a684e2e8af3226a5ed86b5d023535fa90b211a1","_from":".","_npmVersion":"4.2.0","_nodeVersion":"7.10.0","_npmUser":{"name":"rogier.spieker","email":"rogier+npm@konfirm.io"},"dist":{"shasum":"3a684e2e8af3226a5ed86b5d023535fa90b211a1","tarball":"https://registry.npmjs.org/@konfirm/trap/-/trap-1.0.1.tgz","integrity":"sha512-g4766+rwhssJ/aGDD3a0be8FL5O1rvF0+Shar8k/YE4lO6M/GqLgCjRMS3A0sFzIQMcnoSwVOXu5gcIM70IejA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIET1n2/wdhGF7XMXZ3Cvm/Puf1MXfJppyj9S1VLdvX5PAiAnWtXdcQXKhpcW9aHyXmoZAE7yOyM7ImCzncb63PI17A=="}]},"maintainers":[{"name":"rogier.spieker","email":"rogier+npm@konfirm.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trap-1.0.1.tgz_1512408170987_0.7682715517003089"},"directories":{}},"1.1.0":{"name":"@konfirm/trap","version":"1.1.0","description":"Provide traps for use as Proxy handler, allowing to keep track of changes and choose to commit or rollback changes","main":"source/trap.js","scripts":{"test":"lab -clr","test-coverage-html":"lab -clr html -o report.html"},"keywords":["proxy","trap"],"author":{"name":"Rogier Spieker","email":"rogier@konfirm.eu"},"license":"MIT","devDependencies":{"@konfirm/labrat":"^1.1.0","eslint-config-strict":"^14.0.1"},"gitHead":"17f36db21b2f23da1cd2188787d1e5f890c01ec6","_id":"@konfirm/trap@1.1.0","_shasum":"26bfe1530c9157e5c11ade07c7bb4cd4c1d30e5d","_from":".","_npmVersion":"4.2.0","_nodeVersion":"7.10.0","_npmUser":{"name":"rogier.spieker","email":"rogier+npm@konfirm.io"},"dist":{"shasum":"26bfe1530c9157e5c11ade07c7bb4cd4c1d30e5d","tarball":"https://registry.npmjs.org/@konfirm/trap/-/trap-1.1.0.tgz","integrity":"sha512-kwhplBX8men5JJv7Pr2jhDonjw9GvQm3zSKGZrrQigjJB+T14Xo43Fkb4vJ3uXukAaqOSdeos2fTQsdXVEVhNA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCbqVs1DLtZE3nvIA/NBwpujRYcSiI+Q2sNPLI6wXAOEQIhAMbQw6KRucPxBSTj5E+9K1FvBrpv+DPAhDIuI7ccRqOD"}]},"maintainers":[{"name":"rogier.spieker","email":"rogier+npm@konfirm.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trap-1.1.0.tgz_1512410153362_0.6977809765376151"},"directories":{}},"1.1.1":{"name":"@konfirm/trap","version":"1.1.1","description":"Provide traps for use as Proxy handler, allowing to keep track of changes and choose to commit or rollback changes","main":"source/trap.js","scripts":{"test":"lab -clr","test-coverage-html":"lab -clr html -o report.html"},"keywords":["proxy","trap"],"author":{"name":"Rogier Spieker","email":"rogier@konfirm.eu"},"license":"MIT","devDependencies":{"@konfirm/labrat":"^1.1.0","eslint-config-strict":"^14.0.1"},"gitHead":"03dad4ec25d5c537a0b21422429bd6d384e48afc","_id":"@konfirm/trap@1.1.1","_shasum":"5db319ddad9d4822a75f2d2f58104eae1e126dd6","_from":".","_npmVersion":"4.2.0","_nodeVersion":"7.10.0","_npmUser":{"name":"rogier.spieker","email":"rogier+npm@konfirm.io"},"dist":{"shasum":"5db319ddad9d4822a75f2d2f58104eae1e126dd6","tarball":"https://registry.npmjs.org/@konfirm/trap/-/trap-1.1.1.tgz","integrity":"sha512-wUKNOwwHIoA/TWFkM5jaXvpP/vghYq7RjiS6cA78nluCdiKi/2ZhuaKkQ0ynq1NEaWSXeJrNzrkAHtyDqW/yAQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIE1/4ZznucfnyG44SAHZlV0BbS8amLZEOcBzRlnIevJIAiEA83jWdnQ6zpksPRbN25ox8jS1kHGgyGw52yER3XlXPMk="}]},"maintainers":[{"name":"rogier.spieker","email":"rogier+npm@konfirm.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trap-1.1.1.tgz_1512452762611_0.04656105418689549"},"directories":{}},"1.1.2":{"name":"@konfirm/trap","version":"1.1.2","description":"Provide traps for use as Proxy handler, allowing to keep track of changes and choose to commit or rollback changes","main":"source/trap.js","scripts":{"test":"lab -vclr","test-coverage-html":"lab -clr html -o report.html"},"repository":{"type":"git","url":"git+https://github.com/konfirm/node-trap.git"},"bugs":{"url":"https://github.com/konfirm/node-trap/issues"},"keywords":["proxy","trap"],"author":{"name":"Rogier Spieker","email":"rogier@konfirm.eu"},"license":"MIT","devDependencies":{"@konfirm/labrat":"^1.1.0","eslint-config-strict":"^14.0.1"},"gitHead":"1c21741db06f51333b7f590432f2f6af1fcdf3bd","homepage":"https://github.com/konfirm/node-trap#readme","_id":"@konfirm/trap@1.1.2","_shasum":"b2fc15f6c62fd60d54027e37f18e3d6805c59f58","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.9.1","_npmUser":{"name":"rogier.spieker","email":"rogier+npm@konfirm.io"},"maintainers":[{"name":"rogier.spieker","email":"rogier+npm@konfirm.io"}],"dist":{"shasum":"b2fc15f6c62fd60d54027e37f18e3d6805c59f58","tarball":"https://registry.npmjs.org/@konfirm/trap/-/trap-1.1.2.tgz","integrity":"sha512-o57nVTIviSxqgDQ1vgaVrABJoDxbrayamjwp/zeSohc6XTPEhz4bTsm3rb/YZu1TF6z9AE9kkh5bvmHmuFAk6w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDJxgKKSvcYp8JbuWULkhOt2UpHw2qiEXK6nTWVWtWXuAiEAuHEazA+pLwW4tg8MevAvwbVaPONg85wIhSjOHhkJ/0o="}]},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trap-1.1.2.tgz_1512561812851_0.008891916600987315"},"directories":{}},"1.1.3":{"name":"@konfirm/trap","version":"1.1.3","description":"Provide traps for use as Proxy handler, allowing to keep track of changes and choose to commit or rollback changes","main":"source/trap.js","scripts":{"test":"lab -vclr","test-coverage-html":"lab -clr html -o report.html"},"repository":{"type":"git","url":"git+https://github.com/konfirm/node-trap.git"},"bugs":{"url":"https://github.com/konfirm/node-trap/issues"},"keywords":["proxy","trap"],"author":{"name":"Rogier Spieker","email":"rogier@konfirm.eu"},"license":"MIT","devDependencies":{"@konfirm/labrat":"^1.1.0","eslint-config-strict":"^14.0.1"},"gitHead":"30831c4191c3bf7cc773b6c1a099cc028e97e300","homepage":"https://github.com/konfirm/node-trap#readme","_id":"@konfirm/trap@1.1.3","_shasum":"c1c60235df7ab8c0a505d0221b7f9f016541f6f5","_from":".","_npmVersion":"4.2.0","_nodeVersion":"7.10.0","_npmUser":{"name":"rogier.spieker","email":"rogier+npm@konfirm.io"},"dist":{"shasum":"c1c60235df7ab8c0a505d0221b7f9f016541f6f5","tarball":"https://registry.npmjs.org/@konfirm/trap/-/trap-1.1.3.tgz","integrity":"sha512-ufOS+sGcY9pxon1POU/kEe0xgxV5kKO0+oBK2asOVZRq+DuHPKPCk0lDjeEZM2dxzxoijzlelkrEnRteCeaPBw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFAPBH9r7/qqNiNnGNeRZHXjqfJ2RzBkGL8TOcvdB5iFAiEAhVde1fwlU4hQNKxiTeqY7nSDTt/oymFZrZ6uxZt0lh8="}]},"maintainers":[{"name":"rogier.spieker","email":"rogier+npm@konfirm.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trap-1.1.3.tgz_1513962045362_0.17570971115492284"},"directories":{}},"1.2.0":{"name":"@konfirm/trap","version":"1.2.0","description":"Provide traps for use as Proxy handler, allowing to keep track of changes and choose to commit or rollback changes","main":"source/trap.js","scripts":{"test":"lab -vclr","test-coverage-html":"lab -clr html -o report.html"},"repository":{"type":"git","url":"git+https://github.com/konfirm/node-trap.git"},"bugs":{"url":"https://github.com/konfirm/node-trap/issues"},"keywords":["proxy","trap"],"author":{"name":"Rogier Spieker","email":"rogier@konfirm.eu"},"license":"MIT","devDependencies":{"@konfirm/labrat":"^1.1.0","eslint-config-strict":"^14.0.1"},"gitHead":"7798e58cc412ed4fa946ff8e747454b0f6afce6a","homepage":"https://github.com/konfirm/node-trap#readme","_id":"@konfirm/trap@1.2.0","_npmVersion":"5.6.0","_nodeVersion":"8.10.0","_npmUser":{"name":"rogier.spieker","email":"rogier+npm@konfirm.io"},"dist":{"integrity":"sha512-Hj56x57n6MbUDkoqfN/zgGSvP1B8XicYei3BROwkQ05J4nBLJro87Tfc/ZziNyI36nK2zPYVbkCC8xM/Ru/6pg==","shasum":"0396de0a387cd074f71059f00a90136f13cfdc46","tarball":"https://registry.npmjs.org/@konfirm/trap/-/trap-1.2.0.tgz","fileCount":8,"unpackedSize":16904,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa1mPlCRA9TVsSAnZWagAAcc0P/RdQ+eTUlfJKnA38oOGy\njHQWoJIS8XiEn8WOB8TzdPRCWMOOpHsWZOaEZ3fq+z0LhiMIF8jQFJBCRQGP\n2dtisAIKRX/6dFjKefTvpXk8GizYHBV3OSx72W5wVJXuIrdH/k11VbZfbKVw\nblecciJgUv25P9X89qlJpGuFyABymswiYGrb2rbtweqFl4AE8//BTp118tnI\n1S4URpsnHj/9OYeK4dq7HD4dS5qMoAWBflTYvUT4fBG+RN79hp2mPfJN9cG9\n55mWuzfcc7IK8gb/urXScdkX6oAw5mgq3EXucXdAeoHXej4Oespz4zkFvQh+\ndH7nGQ7P/TINAYPz0nOKJkFhhpPWylvwRhaGKdRNynJMF2yBR2DnwIkbxLal\nP8MQkEuta16aU3+uDcoaHEWmyY3VXwY/ydaZ9Pmp2YcjTzqmHdbj5M7SbAhe\nvFj7jcedYFRcaohLZyLXFb5bc525V/N2WTzvcSC+UZDc7XJx1HLUvJEIfg6R\nWI8FfNtpSiWz7PGzr7kR0FTt8SEeV/b98g5mYR3g6717Njvo5qTiIXHeSWuy\niafTC4xuvUIQlnIdqt0NDkYo2z3lutCnd2XslLMYeDRt9S11zImYqBGsX2K1\nM4CcuFKcvw8gLQPY0kFhwTmTBHj2EDnY+8XQb/2g4B6ldnyEvSb4Unw2piUE\nmeTi\r\n=voLC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCYtgRaUerrWq1vJeuAIEPT+8yMnZwYs/OuLPPZ7L1gawIhAK11YYdnhmS7oV3Ix6rW/gc2WzVtQtglj76i/RJE5YJo"}]},"maintainers":[{"name":"rogier.spieker","email":"rogier+npm@konfirm.io"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trap_1.2.0_1523999716089_0.2676244959968235"},"_hasShrinkwrap":false},"1.2.1":{"name":"@konfirm/trap","version":"1.2.1","description":"Provide traps for use as Proxy handler, allowing to keep track of changes and choose to commit or rollback changes","main":"source/trap.js","scripts":{"test":"lab -vclr","test-coverage-html":"lab -clr html -o report.html"},"repository":{"type":"git","url":"git+https://github.com/konfirm/node-trap.git"},"bugs":{"url":"https://github.com/konfirm/node-trap/issues"},"keywords":["proxy","trap"],"author":{"name":"Rogier Spieker","email":"rogier@konfirm.eu"},"license":"MIT","devDependencies":{"@konfirm/labrat":"^1.2.0","eslint-config-strict":"^14.0.1"},"gitHead":"47316c9f7d507005d4efda061b0230726add0b02","homepage":"https://github.com/konfirm/node-trap#readme","_id":"@konfirm/trap@1.2.1","_npmVersion":"5.6.0","_nodeVersion":"8.11.1","_npmUser":{"name":"rogier.spieker","email":"rogier+npm@konfirm.io"},"maintainers":[{"name":"rogier.spieker","email":"rogier+npm@konfirm.io"}],"dist":{"integrity":"sha512-JKy97d+wBn9PYbLwU2NgQW89VQktPOO3mjsL0WCsmUtupa4Jn22ii4jLUmTgcB9Ra8slbQfsFbn2f4LNNnJPKg==","shasum":"00cfed08e8ec599ef68b7158b243b7e4526ec782","tarball":"https://registry.npmjs.org/@konfirm/trap/-/trap-1.2.1.tgz","fileCount":8,"unpackedSize":16904,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa4sTkCRA9TVsSAnZWagAAYpcP/j0dwF4RrZEAXGvk/bea\nC+Eb4wSvKQIQT5Kc0HkelyVcBNpyivUO/rTj5ugllWmYdM9LTqbTZ69pCdpB\nKzhOe/RVQGz8le+c2qtUooj8df3cPCPhJzp2aNbt1vZuWYkyiwpV1Wv7GyOH\nJtHXIOB1I9ujuepZfnzMECubo6523I+uzit2/Un4sMDy/1aapbtLrD9UVEfc\ncPWhPMllfDUW0jh/3pmPxf8vDvwLI17WJlifM/c6BOPZOW7WNduILxC1ufAq\n6YGssDab3nsYjLwDjioqnCJWEL/h0BH1Tm2VPFqvBHsFSJgaLbX+Xt/5EIuX\nHp8EzKiatUEBGCxz8BOmYtluJoMChPmcGHpiihTPCZRbFXWY3/HsEtj/Yihc\nW/vDqm+rk+QA55KfHxX4TBCcK7rXVC6ANVDKhHagwndrNKXDnojOxotixZnw\nEXZx9Jrb53Als7pzUlraiAzwidwGCOTg1UdIg0YCGBR9KO0Txji9ZWEfb9ps\ng/OQ/Kd1+Rz4aVxBcgdG+ASsxtXRgTho+xZ+IKE/BvA2PBrEI1VjafZfItUA\nAdhMb+ygZbeEOjRwBSpbWycW8uVe5hJeUBWXgnohHWW9N+xzX+sUZ98agjxy\n7NQly66dBqvlaHpdky3FDHH09jfpZBV5ll9aV80Aa9WlwjwAXwyyCZsqgw3v\nwx8w\r\n=XQzF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCznxlgKKaM5DmhlxQ8MXimVtGYAB46058UrKkRFjcFAQIgFWuem/0b7HYe0Fe6oBS2CcOu+gbJSJoWQGrSOnT4Wh4="}]},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trap_1.2.1_1524810979812_0.7982043487370656"},"_hasShrinkwrap":false},"1.2.2":{"name":"@konfirm/trap","version":"1.2.2","description":"Provide traps for use as Proxy handler, allowing to keep track of changes and choose to commit or rollback changes","main":"source/trap.js","scripts":{"test":"lab -vclr","test-coverage-html":"lab -clr html -o report.html"},"repository":{"type":"git","url":"git+https://github.com/konfirm/node-trap.git"},"bugs":{"url":"https://github.com/konfirm/node-trap/issues"},"keywords":["proxy","trap"],"author":{"name":"Rogier Spieker","email":"rogier@konfirm.eu"},"license":"MIT","devDependencies":{"@konfirm/labrat":"^1.2.0","eslint-config-strict":"^14.0.1"},"gitHead":"8b44f316f5af26d1e0ba0df3d862cc5b5f0410d3","homepage":"https://github.com/konfirm/node-trap#readme","_id":"@konfirm/trap@1.2.2","_npmVersion":"5.6.0","_nodeVersion":"8.11.1","_npmUser":{"name":"rogier.spieker","email":"rogier+npm@konfirm.io"},"maintainers":[{"name":"rogier.spieker","email":"rogier+npm@konfirm.io"}],"dist":{"integrity":"sha512-NhpqcgB/+I9Qcq7CsCOvRoth/B7PrwooZ4aR+OZMPVm3HRCjHKSUXvPUUI9b2YTFBB3/ktBjTq5RbSykHpEWHg==","shasum":"d6b49d2a6907693f4c4a4a6b58535556eb054673","tarball":"https://registry.npmjs.org/@konfirm/trap/-/trap-1.2.2.tgz","fileCount":8,"unpackedSize":16919,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbQdvVCRA9TVsSAnZWagAAgoIP/3prSLgejQ7quBZ/uyxq\n1JW0ZBA8gIiFGH3EAY34aJJ3CSa9zalNJpAxg68C/pysEMGeQIdL2D/janu8\nm7MxEkkjo+7flOB0WYjjezzgrSI827RCJpbIog1f5LuTHMr6JttM270qsrI5\niUdQ5cwBSZUaF9pDrFxMJW9cwvjePTfU/2J/PGhfYmVO6NoGTsOtOn5K5Mz+\nuJOyj6NA6GT+hrHf43ibJBVg3+35zwPpVy1ccKSLZe5cjhjzX2VJY20Ipc4y\n0d2bM98ZrlBUNlgqo1pSv4h0KNN9GjN4jp2YgGo98/CwYtUkh9R64mPycPry\nsNQdAClLmAr7WBqJzedgfxWOqD1t2LR5thWOyT6PQAArxylzvmKOU4/vt1WR\nEVpxdWNDFuCXZEg0cp5mSdnojXWP35E1Loi9yqYxeLroiUG7DUE4WMveIJqn\npL1+00YW40Nj77IyfTlb2w1/2XjUEunG87yf49JRw00dzqSfG6B+Lo9DfB1D\neLIhnfGa672/2MBs5XyViBz+WrhQp6wuQVn9E95rS6L/guLq/sKD4EN4E4so\nCOWZr1ix9KuQbu0heoXNBI4y9RDxveqIOaP8d/XQFybMc5PDF7VKteBt4P0M\nDOEBfwM0+BmswMmv9UjJdtzNm33V44M+650fF1aKJZY1t1tB3eR5KdFhwgmo\n5uob\r\n=9N/5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC9fiLvc2Sp9fjVvKFFiNMePB/sHiIuMxKtEFEZb4T/KAiAxfYq0O60h2yUflvPDAIQDy83J/ZkFninwQmxen339uQ=="}]},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trap_1.2.2_1531042773075_0.5127042715016599"},"_hasShrinkwrap":false},"1.2.3":{"name":"@konfirm/trap","version":"1.2.3","description":"Provide traps for use as Proxy handler, allowing to keep track of changes and choose to commit or rollback changes","main":"source/trap.js","scripts":{"test":"lab -vclr","test-coverage-html":"lab -clr html -o report.html"},"repository":{"type":"git","url":"git+https://github.com/konfirm/node-trap.git"},"bugs":{"url":"https://github.com/konfirm/node-trap/issues"},"keywords":["proxy","trap"],"author":{"name":"Rogier Spieker","email":"rogier@konfirm.eu"},"license":"MIT","devDependencies":{"@konfirm/labrat":"^1.4.0","eslint-config-strict":"^14.0.1"},"gitHead":"8afe0ba341b0954310f52e67821d70dda1e937ca","homepage":"https://github.com/konfirm/node-trap#readme","_id":"@konfirm/trap@1.2.3","_npmVersion":"6.4.1","_nodeVersion":"10.15.0","_npmUser":{"name":"rogier.spieker","email":"rogier+npm@konfirm.io"},"dist":{"integrity":"sha512-nu1q9T6NzKGjfexKA81FKsUeqRAimK8AZrp/J1qX6Q69giHqNWDinR5gnMje7vC24qVyNPfWbMXlxB/bgX17ng==","shasum":"060bb77799baa480d6c84a3b63f73298a957a62e","tarball":"https://registry.npmjs.org/@konfirm/trap/-/trap-1.2.3.tgz","fileCount":8,"unpackedSize":16919,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcXffZCRA9TVsSAnZWagAAAwYP/RHz69rST8uUYopNn9sj\niPQJpU3vZrhJuhe7+NyEzbnnewODTNV2K8Gs3vSurBIxvXIJJI6XK5MUbRuy\n2ybJcZOW9Ei4WcgpiQibLrpST00fiL7RQniPKgHWjOCbSddOb0oLTFUwwc3q\ns6o45ocLibYwUByZClCHaxWZ+jRkHhkXIKF10R3ExvT0FQ+SRNUscq3DL2M/\ny2/CGjS8XNU5ke0+mw7JcJPBeRd4TVO7/swS0EvVK8R95Y4MpjAyqs1ylrmB\nhebffZ6bDOutAd9uGDk1Wn4hA8HaS/rCxQyBusAAWMSLVUC/vqmEVlw3a/ht\nfQkq6LqII5Ws1u5LoMowPv7mMvp3RyCCx7VRlFEy9zgRMFzPg3F/M8xnUwvi\nattlsOeGFuOErYhryRd2qUwtN9ztwIdvNTXALR9/Yns/yPJ0e1yk5Tbsl/yA\n76OGS8HP1XSWMRtZBVO2UxBmfYz3PNmD+AaCW7o6GCAroOn3SCtvvQJaXUyd\ndAQzOOhDh60+JuPg+4qfft3/jhclSsB/OdXC77ZIUxGRWxfpQZEFMFKfZc5+\nxePvQAmMgoskMz8L+T4pY9CgZVoNaH5DFk41zf9v2jjVOnLoQ7cbJ30vJkCG\nYdQIcqF/KPx3pLVkwa/IB27B++UFFEv0VNoYJbEMNe1dDvnfiky0vbAoqYMT\nClw4\r\n=o7a8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDGvamyepIRB0BLYt3jH1n13Rvz9OAu3tiW3rZssGKEDAIgepL5daHryKCxF0bqYAOY4z04BgD8geTH3qMhTeN1QX4="}]},"maintainers":[{"name":"rogier.spieker","email":"rogier+npm@konfirm.io"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trap_1.2.3_1549662169271_0.04768606222535299"},"_hasShrinkwrap":false},"1.2.4":{"name":"@konfirm/trap","version":"1.2.4","description":"Provide traps for use as Proxy handler, allowing to keep track of changes and choose to commit or rollback changes","main":"source/trap.js","scripts":{"test":"lab -vclr","test-coverage-html":"lab -clr html -o report.html"},"repository":{"type":"git","url":"git+https://github.com/konfirm/node-trap.git"},"bugs":{"url":"https://github.com/konfirm/node-trap/issues"},"keywords":["proxy","trap"],"author":{"name":"Rogier Spieker","email":"rogier@konfirm.eu"},"license":"MIT","devDependencies":{"@konfirm/labrat":"^2.0.0","eslint-config-strict":"^14.0.1"},"gitHead":"a6b77e0b1a0bcace390f0abd0ddcb0b97b59b415","homepage":"https://github.com/konfirm/node-trap#readme","_id":"@konfirm/trap@1.2.4","_npmVersion":"5.6.0","_nodeVersion":"8.11.1","_npmUser":{"name":"rogier.spieker","email":"rogier+npm@konfirm.io"},"dist":{"integrity":"sha512-JDy0MNhPQALRzvSR1MDXpwEiBuQ6P4DPVkikRqkRveOM/pN+5I4KvuLtmOY+xbNiKWif2Y94cl/OTgNRO1AxjA==","shasum":"f58d7878b0705277c749b585332f3baefbec043f","tarball":"https://registry.npmjs.org/@konfirm/trap/-/trap-1.2.4.tgz","fileCount":8,"unpackedSize":16919,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc91XWCRA9TVsSAnZWagAAR1QQAI+i1xsixOoq/uzqzRiO\nHRblynlrSzy90ivA1HEMHyi6tAl3lFWO1HdwwCRgmLD7Lcgv7LzpPBx5LvTh\nE1456FboxP9WTazbKUiejTACc3/bTzX9f9ZOBEVhlfzLdKuw2O4P+9dfzJJF\no2OAb1HnitAFM26t7E5ugOKJJo+cLAwfDFdXsi4xrFYct5C6LjDHOrSmCgzS\neuE6mZSOoL2AVQViExqD0o4L2AVHbN97xkZ74dyTTw7dTHLlCOw6I4o4bOJM\nfk4aJQDcgnPrKTUoy8zqVSS5uHm2AQHLaXtnPva+2js4EewYdS7XWMnsvvTD\nrWFtSvOD7OlVoMsDZM2/COoE9GYuiFP4im6yfHb3UZ6L1D59hN6zFR/YJFZo\nRFQO4pJpyKT2UMp4itNRpoaPIOYGPYM2mBe+R9ytDD9IQ3v7u1jKDpGsiG7O\nBeLmErhrRkj4NrcLxu/JPitvFU3ILa6mlkRMXm0YgVU7OS4wUNWASUxOBgro\n/Cs4BhTHV0YAwzJp7af4A2xVNPX1SgTGuti6sDOiTEMscnwjWOKQ1kHwDDZq\nqjXEzcaPLyUYfCEoYeopYBhTwSwB7sHcxAi3qIhe+emZRl3f5wXt3yvCqBGk\n+6HE3XhDcq+8qdJTPfxNiQVk1wUHvh2pKr5rx85ApwRdXhA4XnkuXNP4EISO\nplFL\r\n=nIAk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC0wLjsuFQXXJzzCOcD1Xj9QS6S1WEUpGs2wWr6CMVL5wIhAOP2aswCt1OFchWPeWt/SvioNQvIKrG3WZ2fTR8WO3Vp"}]},"maintainers":[{"name":"rogier.spieker","email":"rogier+npm@konfirm.io"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trap_1.2.4_1559713237425_0.28482899003566997"},"_hasShrinkwrap":false},"1.2.5":{"name":"@konfirm/trap","version":"1.2.5","description":"Provide traps for use as Proxy handler, allowing to keep track of changes and choose to commit or rollback changes","main":"source/trap.js","scripts":{"test":"lab -vclr","test-coverage-html":"lab -clr html -o report.html"},"repository":{"type":"git","url":"git+https://github.com/konfirm/node-trap.git"},"bugs":{"url":"https://github.com/konfirm/node-trap/issues"},"keywords":["proxy","trap"],"author":{"name":"Rogier Spieker","email":"rogier@konfirm.eu"},"license":"MIT","devDependencies":{"@konfirm/labrat":"^2.0.1","eslint-config-strict":"^14.0.1"},"gitHead":"36a3b377d939e1ab6166c1464fe7f946dff915b7","homepage":"https://github.com/konfirm/node-trap#readme","_id":"@konfirm/trap@1.2.5","_nodeVersion":"12.6.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-VPja6vK9UEoDscpvi0uLYh497rxdSPMTAtDcI8IYaCTZJ9q70I7bB91FQyKsA1+l6vg5eaycHcJreKnffkuw7Q==","shasum":"30478daa28f9ba886f75e9dccfc1d78dcd67db4a","tarball":"https://registry.npmjs.org/@konfirm/trap/-/trap-1.2.5.tgz","fileCount":8,"unpackedSize":16919,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdLOEOCRA9TVsSAnZWagAA7MgP/icg6KIrhJrgpgms79sn\nI+ZOtINwll13cj1ZIGwn6Bez1vlPXTu5c740PssL1vOr2WHA0yY4nzJsRU9n\nZi6XboTsgSHlvq9BhWUY9tUebdgoMV7R2IcdS6AD/zHZO8yH7VDKqSO/Xk8e\n0zr64lrhGCTUs2dCwTpq0dt61EPwXXvlc5mslnFj1d2pJnp3SbdBv88HiM8J\nV7fNAj6dmmPYnrG/nW56t57w8SdMJIeuLQmoVXO7uNlW7/FR7C7H+FHRYYSI\n8RNtHvba1HwmpnHI2S00/R0CnPAUx539zR8mswcP2ppfPiQPn8koFXkby3JN\n1vF3r/uuOyv5OiiT0o6tzMYQ2kukRilU7lFaqRO3+mmkJIFSocRS8Rs2S0il\nl2zGP9TPA6zMLIi9JB9uA8e29I4JqjIDbR8ZUiycwk3kFy8zC/utM3rD7Aku\nV4TSLYdYnduSMGMcKBuDVlmjOOTrtpkBy3X13XhAknItcgBA0iDi/yLQYxpu\nFVTlB7On8UHqluupgJqKPfF3Py1h5M+b76gVAWCR5JKfb0bTG5tEE6df3BpE\nvQePHy2vPwOgknEtDjhOwyGV6ShAOWmznqsXPA1R2CfrONZOLj0zcjzm6wr6\nzaV1+Y9a6LAmmpDMnpEKqCH2/dHSgXN3STXIq7jv/RcGGCQi+WvJ3IGXP7Sd\nqmBV\r\n=NRTV\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCJydCf6KKEwWMvvRSyz0k9xlpJqUjKn3BeM0oHoJY5dgIhAMBOP1S7o9/C6WlQyaVeVAbRujYlRac6D7hnF8wMSxVH"}]},"maintainers":[{"name":"rogier.spieker","email":"rogier+npm@konfirm.io"}],"_npmUser":{"name":"rogier.spieker","email":"rogier+npm@konfirm.io"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trap_1.2.5_1563222285366_0.45949333320177854"},"_hasShrinkwrap":false},"1.2.6":{"name":"@konfirm/trap","version":"1.2.6","description":"Provide traps for use as Proxy handler, allowing to keep track of changes and choose to commit or rollback changes","main":"source/trap.js","scripts":{"test":"lab -vclr","test-coverage-html":"lab -clr html -o report.html"},"repository":{"type":"git","url":"git+https://github.com/konfirm/node-trap.git"},"bugs":{"url":"https://github.com/konfirm/node-trap/issues"},"keywords":["proxy","trap"],"author":{"name":"Rogier Spieker","email":"rogier@konfirm.eu"},"license":"MIT","devDependencies":{"@konfirm/labrat":"^2.0.2","eslint-config-strict":"^14.0.1"},"gitHead":"240411acc49d4bfda5af9ef0bb6ed68a7cec1eb7","homepage":"https://github.com/konfirm/node-trap#readme","_id":"@konfirm/trap@1.2.6","_nodeVersion":"12.9.1","_npmVersion":"6.10.2","dist":{"integrity":"sha512-DV+WVRVF22pM4SuhZbSmo06dXnCTMU+HnwbhwQpFM0q9Uas5Ap9vY38SZGK8NgfHJ7xcib83kaXL8IJOvXEdhA==","shasum":"9f8ca65e2feacc2060ee1ec47eedc3ca690e9df3","tarball":"https://registry.npmjs.org/@konfirm/trap/-/trap-1.2.6.tgz","fileCount":8,"unpackedSize":16959,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdZEb7CRA9TVsSAnZWagAAOsUP/AxrsbJ0KfwG7VvrIOfM\nEGLFhUrnvFCrtjnR69269LtUNLr8gEpDwlV21/5EWyNxRv4w4nBaZIrEzKrH\naFcxSAvvJzGBIeO9mZ9R49lJc5cXI2HTY/VOYtbyDNa8LSYwPuCXD6SKnMYQ\nFdqgFPKLs2i8x1UgPygSTQJWmsSq6uleUgjXnEvo+PovEshbkpXJQGcNuG1s\nEYlX2jhmhKOYanSn2SCIeOYZ+AxPwzCEG4nrReyOQPsQUt22opwh1eibGpTa\nbu/ojQDr9jU05bQgBmtlHuWd5KZ6V21oahVQRE7xIFgRJt+HfpbDe7RDgmnO\n3ISNyRasouwoi9/AXj5RW3T3/h8kWCKfecQKFc3zzGYl6ZTER2w+qeUIbwcA\nwF1GBRO/vIV+WU0wrW2PJDH1x8iuk0f6cFC1RDKzSAYdhTy8wy7PYpsuecMd\ngmnYL4hdBAkqFQQyTbZ+0S9c3+s7H5B6gnko3Cwvp8TZemLYntAN4BKXbLgP\nWdR4ElySevJ6/N06ykOMN0+EMpmz6RcbYwkqdhnuhyAbrJ/sPSq/yzBXMfXU\nnwtwVY1bg4JqPE3GA55355rmyEurvU4mNVo3V6Cyr18oak+NUJsaPYB+bbY7\nET05xhli7DjzfZN5wG6j19WvoZHMw5S9Vjj9fEAVW38BTTqHAlJRMK09tqGi\n0sx3\r\n=4cnk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDwyVktPZ4Wqig+jLGhEigi4Ll3mb6cz0V931blZohX7AIhALdDeZ8ayOM7MrV005lErbLT8VQC/qPAA6OqmdPxM0rf"}]},"maintainers":[{"name":"rogier.spieker","email":"rogier+npm@konfirm.io"}],"_npmUser":{"name":"rogier.spieker","email":"rogier+npm@konfirm.io"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trap_1.2.6_1566852858435_0.869067157053973"},"_hasShrinkwrap":false},"1.2.7":{"name":"@konfirm/trap","version":"1.2.7","description":"Provide traps for use as Proxy handler, allowing to keep track of changes and choose to commit or rollback changes","main":"source/Domain/ValueObject/Trap.js","scripts":{"test":"lab -vclr","test-coverage-html":"lab -clr html -o report.html"},"repository":{"type":"git","url":"git+https://github.com/konfirm/node-trap.git"},"bugs":{"url":"https://github.com/konfirm/node-trap/issues"},"keywords":["proxy","trap"],"author":{"name":"Rogier Spieker","email":"rogier@konfirm.eu"},"license":"MIT","devDependencies":{"@konfirm/labrat":"^2.0.2","eslint-config-strict":"^14.0.1"},"gitHead":"d4f1e82b561e3991931407df1dc3a869df699a60","homepage":"https://github.com/konfirm/node-trap#readme","_id":"@konfirm/trap@1.2.7","_npmVersion":"6.4.1","_nodeVersion":"10.15.3","_npmUser":{"name":"rogier.spieker","email":"rogier+npm@konfirm.io"},"dist":{"integrity":"sha512-boUVxadVF+VMZ+C8ThJJfYSbYh5axr1dOcukNDzc5xAiRgD34RHJhyXYKRxRTelIDFLt3loHyzJ/8pmJu6XTgg==","shasum":"d44489900161b9df0d2188e9a859aac596467cc4","tarball":"https://registry.npmjs.org/@konfirm/trap/-/trap-1.2.7.tgz","fileCount":11,"unpackedSize":21429,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeH/aLCRA9TVsSAnZWagAAOj4P/14GE/fNtO1R6TDW8gVc\n/5hxfX2HV3mKlfC3e7lkvgo0I6KYQ1tyXxZQ+Q8sHvEVCBdx65iBABXcV0Ec\nPn9TXsOhuCOfSzAJ5I/l4qA20nwOTrqOxs53kv34uJCstUKH6nyGmyPXGHRa\nq3qK5iSaWOZCFK+irgQOQdGNfUsQsq0g94e++Y05YGSyTsLZ6aFXFGb7ofFu\nzKQUBKDh67DwBF+Snz2mrzQVfTVPHpoZ7Z8fCUCChUquGL+isdW8pX/PUAQf\nDdT5y/foCxhsxbkXpi+u+6fCQJQoV5jfBwwjV6MMRdt0qOV9QHvORHSDXzG3\nK+Bsrs7MLGtnzLrY/x0/TTsZ74n8WxYHm9jd0EyUSRYUIe7U5Xqv+D4odepr\n6x6jDgWHyATIURwnLqpYqrOr4902ZFzpDpsavdtM0NbT77A/JSN8KRso414X\nrmx4DKjERjqYVSb46MjbCksGxCTG4TazGxzNAACd0/8jDNV2d3Xi0Mb6esM1\nNh9Sub4xVuwjEF9wkXIocRlSNZSp7/A9scjmh3VRNgv1Clpf2yfjQdo1AGGd\nOazvPl9xxujH5PEmN36ohNOnTvI3ahYYc3vxI3mtjKY8f3Wzpqq9JSQS/MGW\na1KTrUwxm4FYljR38OjlRiiFm9xPyI0VfgKs0MZMZ+LeNOKzDXqj6RVd89Jo\nh6Sl\r\n=arSB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDOQzYr5fUvXThsXv11Q8B4C3MHd/TvShVCYWJZJN5qlgIhAJxtCeylJ3LhRY/aK3eWt1PJBRck5+nIpk8yGh9gKP6e"}]},"maintainers":[{"name":"rogier.spieker","email":"rogier+npm@konfirm.io"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trap_1.2.7_1579153035009_0.2616062013766114"},"_hasShrinkwrap":false},"2.0.0-beta.1":{"name":"@konfirm/trap","version":"2.0.0-beta.1","description":"Provide traps for use as Proxy handler, allowing to keep track of changes and choose to commit or rollback changes","iife":"dist/trap.js","main":"dist/trap.cjs.js","module":"dist/trap.es.js","types":"dist/trap.d.ts","scripts":{"test":"run-script-os","test:nix":"ts-node node_modules/tape/bin/tape 'test/**/*.ts'","test:win32":"ts-node node_modules/tape/bin/tape test/**/*.ts","test:coverage":"run-script-os","test:coverage:nix":"nyc --reporter=html --require ts-node/register tape 'test/**/*.ts' | tap-arc","test:coverage:win32":"nyc --reporter=html --require ts-node/register tape test/**/*.ts | tap-arc","test:pretty":"run-script-os","test:pretty:nix":"nyc --require ts-node/register tape 'test/**/*.ts' | tap-arc","test:pretty:win32":"nyc --require ts-node/register tape test/**/*.ts | tap-arc","prebuild":"tsc --declarationDir temp --declaration true --emitDeclarationOnly true","build":"rollup -c rollup.config.js","postbuild":"rm -rf temp","prepublish":"npm run build"},"repository":{"type":"git","url":"git+https://github.com/konfirm/node-trap.git"},"bugs":{"url":"https://github.com/konfirm/node-trap/issues"},"keywords":["proxy","trap"],"author":{"name":"Rogier Spieker","email":"rogier@konfirm.eu"},"license":"MIT","engines":{"node":">=12"},"devDependencies":{"@rollup/plugin-commonjs":"^19.0.0","@rollup/plugin-node-resolve":"^13.0.0","@rollup/plugin-typescript":"^8.2.1","@types/tape":"^4.13.0","nyc":"^15.1.0","rollup":"^2.52.2","rollup-plugin-dts":"^3.0.2","rollup-plugin-terser":"^7.0.2","run-script-os":"^1.1.6","tap-arc":"^0.1.1","tape":"^5.3.1","template-literal-each":"^2.0.0","ts-node":"^10.3.0","tslib":"^2.3.0","typescript":"^4.4.4"},"dependencies":{"@konfirm/descriptor":"^1.0.0","@konfirm/guard":"^2.0.0"},"readme":"# Trap Module\r\n\r\n[![Codacy Badge](https://api.codacy.com/project/badge/Grade/4a1262f6063b47428c144ae57b0fc38a)](https://www.codacy.com/app/konfirm/node-trap?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=konfirm/node-trap&amp;utm_campaign=Badge_Grade)\r\n[![Build Status](https://travis-ci.org/konfirm/node-trap.svg?branch=master)](https://travis-ci.org/konfirm/node-trap)\r\n\r\nProvide traps for use as Proxy handler, allowing to keep track of changes and choose to commit or rollback changes\r\n\r\n## Installation\r\n\r\n```\r\n$ npm install --save @konfirm/trap\r\n```\r\n\r\n## Usage\r\nThe Trap module is designed to handle and reflect Proxy manipulations to an object [Proxy](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy), during its handler assignment you can provide a Trap-instance or parts of it.\r\n\r\n### Trap all mutations\r\n```js\r\n//  include the Trap module\r\n// const { Trap } = require('@konfirm/trap');\r\nimport { Trap } from '@konfirm/trap';\r\n//  create a trap instance\r\nconst trap = new Trap();\r\n//  create the affected object\r\nconst affect = { foo: 'bar', bar: 'baz' };\r\n//  create the proxy\r\nconst proxy = new Proxy(affect, trap);\r\n\r\nproxy.foo = 'hello world';\r\n\r\nconsole.log(proxy.foo);       //  'hello world'\r\nconsole.log(affect.foo);      //  'bar'\r\n\r\ndelete proxy.bar;\r\n\r\nconsole.log('bar' in proxy);   //  false\r\nconsole.log('bar' in affect);  //  true\r\n\r\n//  commit all trapped changes\r\ntrap.commit();\r\n\r\nconsole.log(affect.foo);  //  'hello world'\r\nconsole.log('bar' in affect);  //  false\r\n```\r\n\r\n\r\n## API\r\nTrap keeps track of changes within proxied objects, and exposes two methods besides the implemented [trap functions](https://github.com/konfirm/node-trap#implementedtrapfunctions).\r\n\r\n### Exports\r\n\r\n| name                  | description                                                                                                                  |\r\n| --------------------- | ---------------------------------------------------------------------------------------------------------------------------- |\r\n| `Trap`                | The `Trap` class itself                                                                                                      |\r\n| `MutationInterface`   | _TypeScript_ interface describing Mutations                                                                                  |\r\n| `isMutationInterface` | Type Guard validating whether the input is a `MutationInterface`                                                             |\r\n| `MutationOptions`     | _TypeScript_ type describing the target, key and optional value members of a `MutationInterface`                             |\r\n| `isMutationOptions`   | Type Guard validating whether the input is `MutationOptions`                                                                 |\r\n| `DeletionMutation`    | Mutation describing deletion mutations, created by `deleteProperty` (`delete target.key`) operations                         |\r\n| `PropertyMutation`    | Mutation describing property mutations, created by `defineProperty` (`Object.defineProperty(target, key, {...})`) operations |\r\n| `ValueMutation`       | Mutation describing value mutations, created by `set` (`target.key = ...`) operations                                        |\r\n| `AbstractMutation`    | abstract implementation of a Mutation                                                                                        |\r\n\r\n\r\n### `Trap([trackOnlyLastMutation])`\r\nThe Trap constructor accepts the `trackOnlyLastMutation` argument (default `false`) indicating whether or not the mutations should be limited to one per property. If `trackOnlyLastMutation` is set to `true` value, any previous change to the trapped object is remove before applying the next value. Should the next value effectively restore the original state, no new mutations is created and the number of mutations is decreased.\r\n\r\n### `commit`\r\nApply collected mutations (optionally filtered by a search parameter) to the target and reset the mutation list.\r\n\r\n```js\r\ntrap.commit({ target: myTarget }); // applies all collected mutations with target myTarget\r\ntrap.commit({ key: 'sample' });    // applies all collected mutations for key 'sample'\r\ntrap.commit();                     // applies all collected mutations\r\n```\r\n\r\n### `rollback`\r\nDrop mutations (optionally filtered by a search parameter) so these will never be applied to the target.\r\n\r\n```js\r\ntrap.rollback({ target: myTarget }); // removes all collected mutations with target myTarget\r\ntrap.rollback({ key: 'sample' });    // removes all collected mutations for key 'sample'\r\ntrap.rollback();                     // removes all collected mutations\r\n```\r\n\r\n### `count`\r\nAs v2.0 of `Trap` removed the mutations collection from direct access, the `count` method allows for counting the number of mutations (optionally filtered by a search parameter).\r\n\r\n```js\r\ntrap.count({ target: myTarget }); // counts all mutations with target myTarget\r\ntrap.count({ key: 'sample' });    // counts all mutations for key 'sample'\r\ntrap.count();                     // counts all mutations\r\n```\r\n\r\n### Implemented Trap functions\r\nTrap provides most of the Proxy handler methods which directly change object properties.\r\n\r\n  - [`defineProperty`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/defineProperty); traps `Object.defineProperty` calls\r\n  - [`deleteProperty`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/deleteProperty); traps property deletion\r\n  - [`get`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/get); traps property value getting\r\n  - [`getOwnPropertyDescriptor`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/getOwnPropertyDescriptor); traps `Object.getOwnPropertyDescriptor` calls\r\n  - [`has`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/has); traps `<key> in <Object>` calls\r\n  - [`ownKeys`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/ownKeys); traps `Object.keys` calls\r\n  - [`set`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/set); traps property value setting\r\n\r\n\r\n### Trap functions not implemented\r\nThe following functions are currently not implemented by the Trap module, if there is a need for them to be added, feel free to submit an issue or create a pull request.\r\n\r\n  - [`apply`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/apply); traps method invocations\r\n  - [`construct`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/construct); traps new instance creation\r\n  - [`getPrototypeOf`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/getPrototypeOf); traps `Object.getPrototypeOf` calls\r\n  - [`isExtensible`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/isExtensible); traps `Object.isExtensible` calls\r\n  - [`preventExtensions`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/preventExtensions); traps `Object.preventExtensions` calls\r\n  - [`setPrototypeOf`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/setPrototypeOf); traps `Object.setPrototypeOf` calls\r\n\r\n\r\n## Licence\r\n\r\nMIT License\r\n\r\nCopyright (c) 2017-2021 Rogier Spieker (Konfirm)\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining a copy\r\nof this software and associated documentation files (the \"Software\"), to deal\r\nin the Software without restriction, including without limitation the rights\r\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r\ncopies of the Software, and to permit persons to whom the Software is\r\nfurnished to do so, subject to the following conditions:\r\n\r\nThe above copyright notice and this permission notice shall be included in all\r\ncopies or substantial portions of the Software.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r\nSOFTWARE.\r\n","readmeFilename":"README.md","gitHead":"07d24b3885078d19201201b2f6d25d6ae1c1e831","homepage":"https://github.com/konfirm/node-trap#readme","_id":"@konfirm/trap@2.0.0-beta.1","_nodeVersion":"14.17.6","_npmVersion":"6.14.15","dist":{"integrity":"sha512-nOpF9c/YQlpfRiO5eSElzrXntkXCwbE3HMP3wuPo/vjh0sDvZX67ettvj4MGCIFHXQeVIjyg7mqBkOlxUgaVPw==","shasum":"e1b7682547bb21819f27b66eb6179c5816f7bd50","tarball":"https://registry.npmjs.org/@konfirm/trap/-/trap-2.0.0-beta.1.tgz","fileCount":69,"unpackedSize":585247,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhqT7FCRA9TVsSAnZWagAAtB8P/3oAWO1sOMNBkyUGLg4k\nUUGybqTS9i+RmSNcv5BTmqUF4nqJtIO3HbQMa2VAjsIxe/gjpAFTpdvmLY8S\nCGy0DySk459VbyGvz3qPFfjWrFCAYdoes//tCMODUUsheJnMVdw7Km/iIAs5\nj40Dbhsqv/IxXhdfvC/GPzHM8CHtsywqlCbpBwaPxAEjU93Hx/47uF+M30un\nuUIxee7ccOxSJ8Ar3Ih7H5hXd3Flbt9k7IfPe0dWkF0rc4OARf05DMYEXDfg\ni54qywaYAy/RAnc7To60wI/p5CstiqcoeE3keqAoXNMy8xFemm20K3+m2hQI\nZEvJdymiLTsIfWIY8BJDrgg7USzG2Vs/B56k/ApmXkrw7W7ZjQidG85mMBHO\n+y8AnY1oA/iuWeZBOihCKqs6rEcwtpPhcZe9j4aNf9Ey2VL04fP0+VfVdBYS\nLMHEx/hTQ49yxnHg+5w34BZpWti/qFoUNZ3VtJUc6V4quh2ChjdqZ9mK1Sx4\ng7i3YsHKJYikV/g9SKvprTSPUDrtUq8H0UDnKFE8kHA1EDmpMatq1jxH2cAX\nL84ZfbsyklyP0c8Dm40+6F90mg6uJBExpkYVMJvnQX0/WpgaM57OrmFEC20R\nrXlRHhUR+gCMo2QYDYLPq7ZDju7B1Hju3EDhCFkyaXTpa/PWRr2OkT3C4ILK\nSyIa\r\n=x0DG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIB0QVSUAoQVGc2K+N0ELrjbgpCbF6wXtGbGaBbkhcIeSAiEAwSamQqDSxvE9iMocrWtQjz7/+P2hmxvVwaxZvAeEppo="}]},"_npmUser":{"name":"rogier.spieker","email":"rogier+npm@konfirm.io"},"directories":{},"maintainers":[{"name":"rogier.spieker","email":"rogier+npm@konfirm.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trap_2.0.0-beta.1_1638481604932_0.9282120665342566"},"_hasShrinkwrap":false},"2.0.0-beta.2":{"name":"@konfirm/trap","version":"2.0.0-beta.2","description":"Provide traps for use as Proxy handler, allowing to keep track of changes and choose to commit or rollback changes","iife":"dist/trap.js","main":"dist/trap.cjs.js","module":"dist/trap.es.js","types":"dist/trap.d.ts","scripts":{"test":"run-script-os","test:nix":"ts-node node_modules/tape/bin/tape 'test/**/*.ts'","test:win32":"ts-node node_modules/tape/bin/tape test/**/*.ts","test:coverage":"run-script-os","test:coverage:nix":"nyc --reporter=html --require ts-node/register tape 'test/**/*.ts' | tap-arc","test:coverage:win32":"nyc --reporter=html --require ts-node/register tape test/**/*.ts | tap-arc","test:pretty":"run-script-os","test:pretty:nix":"nyc --require ts-node/register tape 'test/**/*.ts' | tap-arc","test:pretty:win32":"nyc --require ts-node/register tape test/**/*.ts | tap-arc","prebuild":"tsc --declarationDir temp --declaration true --emitDeclarationOnly true","build":"rollup -c rollup.config.js","postbuild":"rm -rf temp","prepublish":"npm run build"},"repository":{"type":"git","url":"git+https://github.com/konfirm/node-trap.git"},"bugs":{"url":"https://github.com/konfirm/node-trap/issues"},"keywords":["proxy","trap"],"author":{"name":"Rogier Spieker","email":"rogier@konfirm.eu"},"license":"MIT","engines":{"node":">=12"},"devDependencies":{"@rollup/plugin-commonjs":"^19.0.0","@rollup/plugin-node-resolve":"^13.0.0","@rollup/plugin-typescript":"^8.2.1","@types/tape":"^4.13.0","nyc":"^15.1.0","rollup":"^2.52.2","rollup-plugin-dts":"^3.0.2","rollup-plugin-terser":"^7.0.2","run-script-os":"^1.1.6","tap-arc":"^0.1.1","tape":"^5.3.1","template-literal-each":"^2.0.0","ts-node":"^10.3.0","tslib":"^2.3.0","typescript":"^4.4.4"},"dependencies":{"@konfirm/descriptor":"^1.0.0","@konfirm/guard":"^2.0.0"},"readme":"# Trap Module\n\n[![Codacy Badge](https://api.codacy.com/project/badge/Grade/4a1262f6063b47428c144ae57b0fc38a)](https://www.codacy.com/app/konfirm/node-trap?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=konfirm/node-trap&amp;utm_campaign=Badge_Grade)\n[![Build Status](https://travis-ci.org/konfirm/node-trap.svg?branch=master)](https://travis-ci.org/konfirm/node-trap)\n\nProvide traps for use as Proxy handler, allowing to keep track of changes and choose to commit or rollback changes\n\n## Installation\n\n```\n$ npm install --save @konfirm/trap\n```\n\n## Usage\nThe Trap module is designed to handle and reflect Proxy manipulations to an object [Proxy](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy), during its handler assignment you can provide a Trap-instance or parts of it.\n\n### Trap all mutations\n```js\n//  include the Trap module\n// const { Trap } = require('@konfirm/trap');\nimport { Trap } from '@konfirm/trap';\n//  create a trap instance\nconst trap = new Trap();\n//  create the affected object\nconst affect = { foo: 'bar', bar: 'baz' };\n//  create the proxy\nconst proxy = new Proxy(affect, trap);\n\nproxy.foo = 'hello world';\n\nconsole.log(proxy.foo);       //  'hello world'\nconsole.log(affect.foo);      //  'bar'\n\ndelete proxy.bar;\n\nconsole.log('bar' in proxy);   //  false\nconsole.log('bar' in affect);  //  true\n\n//  commit all trapped changes\ntrap.commit();\n\nconsole.log(affect.foo);  //  'hello world'\nconsole.log('bar' in affect);  //  false\n```\n\n\n## API\nTrap keeps track of changes within proxied objects, and exposes two methods besides the implemented [trap functions](https://github.com/konfirm/node-trap#implementedtrapfunctions).\n\n### Exports\n\n| name                  | description                                                                                                                  |\n| --------------------- | ---------------------------------------------------------------------------------------------------------------------------- |\n| `Trap`                | The `Trap` class itself                                                                                                      |\n| `MutationInterface`   | _TypeScript_ interface describing Mutations                                                                                  |\n| `isMutationInterface` | Type Guard validating whether the input is a `MutationInterface`                                                             |\n| `MutationOptions`     | _TypeScript_ type describing the target, key and optional value members of a `MutationInterface`                             |\n| `isMutationOptions`   | Type Guard validating whether the input is `MutationOptions`                                                                 |\n| `DeletionMutation`    | Mutation describing deletion mutations, created by `deleteProperty` (`delete target.key`) operations                         |\n| `PropertyMutation`    | Mutation describing property mutations, created by `defineProperty` (`Object.defineProperty(target, key, {...})`) operations |\n| `ValueMutation`       | Mutation describing value mutations, created by `set` (`target.key = ...`) operations                                        |\n| `AbstractMutation`    | abstract implementation of a Mutation                                                                                        |\n\n### type `MutationOptions`\n\n| property | type                        | required | notes                                                                                                       |\n| -------- | --------------------------- | -------- | ----------------------------------------------------------------------------------------------------------- |\n| `target` | `Object | Function | Array` | yes      | this can be narrowed down (e.g. only objects of a specific type), but never widened (e.g. not add booleans) |\n| `key`    | `string | symbol`           | yes      | this can be narrowed doen (e.g. only strings), but not wideneded (e.g. not add numbers)                     |\n| `value`  | `any`                       | no       |\n\n### `Trap([trackOnlyLastMutation])`\nThe Trap constructor accepts the `trackOnlyLastMutation` argument (default `false`) indicating whether or not the mutations should be limited to one per property. If `trackOnlyLastMutation` is set to `true` value, any previous change to the trapped object is remove before applying the next value. Should the next value effectively restore the original state, no new mutations is created and the number of mutations is decreased.\n\n### `commit`\nApply collected mutations (optionally filtered by a search parameter) to the target and reset the mutation list.\n\n```js\ntrap.commit({ target: myTarget }); // applies all collected mutations with target myTarget\ntrap.commit({ key: 'sample' });    // applies all collected mutations for key 'sample'\ntrap.commit();                     // applies all collected mutations\n```\n\n### `rollback`\nDrop mutations (optionally filtered by a search parameter) so these will never be applied to the target.\n\n```js\ntrap.rollback({ target: myTarget }); // removes all collected mutations with target myTarget\ntrap.rollback({ key: 'sample' });    // removes all collected mutations for key 'sample'\ntrap.rollback();                     // removes all collected mutations\n```\n\n### `count`\nAs v2.0 of `Trap` removed the mutations collection from direct access, the `count` method allows for counting the number of mutations (optionally filtered by a search parameter).\n\n```js\ntrap.count({ target: myTarget }); // counts all mutations with target myTarget\ntrap.count({ key: 'sample' });    // counts all mutations for key 'sample'\ntrap.count();                     // counts all mutations\n```\n\n### Implemented Trap functions\nTrap provides most of the Proxy handler methods which directly change object properties.\n\n  - [`defineProperty`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/defineProperty); traps `Object.defineProperty` calls\n  - [`deleteProperty`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/deleteProperty); traps property deletion\n  - [`get`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/get); traps property value getting\n  - [`getOwnPropertyDescriptor`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/getOwnPropertyDescriptor); traps `Object.getOwnPropertyDescriptor` calls\n  - [`has`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/has); traps `<key> in <Object>` calls\n  - [`ownKeys`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/ownKeys); traps `Object.keys` calls\n  - [`set`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/set); traps property value setting\n\n\n### Trap functions not implemented\nThe following functions are currently not implemented by the Trap module, if there is a need for them to be added, feel free to submit an issue or create a pull request.\n\n  - [`apply`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/apply); traps method invocations\n  - [`construct`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/construct); traps new instance creation\n  - [`getPrototypeOf`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/getPrototypeOf); traps `Object.getPrototypeOf` calls\n  - [`isExtensible`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/isExtensible); traps `Object.isExtensible` calls\n  - [`preventExtensions`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/preventExtensions); traps `Object.preventExtensions` calls\n  - [`setPrototypeOf`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/setPrototypeOf); traps `Object.setPrototypeOf` calls\n\n\n## Licence\n\nMIT License\n\nCopyright (c) 2017-2021 Rogier Spieker (Konfirm)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","readmeFilename":"README.md","gitHead":"1d724a837b252136e20efc2c9ffcf18e222440f3","homepage":"https://github.com/konfirm/node-trap#readme","_id":"@konfirm/trap@2.0.0-beta.2","_nodeVersion":"14.17.6","_npmVersion":"6.14.15","dist":{"integrity":"sha512-W9eYegXIqkKjhu7p1SeVeuhQMGyvyyEbrUfRR8/tK2BYRICqwX+nb/YvOKN2ooGknKrEwD0f7rEJNheN7P88MQ==","shasum":"696a029dfd8e9fa30a5be8963ed291ba7aeeb078","tarball":"https://registry.npmjs.org/@konfirm/trap/-/trap-2.0.0-beta.2.tgz","fileCount":20,"unpackedSize":160322,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhqcg3CRA9TVsSAnZWagAAFu8P/i3xNWe4pbtwjlFDrfgz\nkdhz6t4C43oqN/+kRzV2iFpNILfb0FdbOIvCbCZUJL+MVZiymzkYC9APdDNJ\nCY/ZyksCey+lX4n/80s7EMMygXs3alamFtTxJVSPyE9PK0SYjpAkwh3OHxvV\nGflQnNfnNfn2Z/K+JBr6hzNoPMPQ14HslOmPOWRnDIp9ypisrKkoH9ZC4Lpk\ntFmw4gwC236/LiW/55esaIjpYx28p6/dPY3MZIAbWFUDhhnPpByWXmpsJPiy\ndVHh8mdGQRFuXAvVGa2yIZj9iO3g+5TAteAGYJBNI5jbCVro2El4UElKb3d+\nBPRPoZCBVNrWwVJseIsXTSHKRhhDPa9ErHkNhjgOoea15qel7ob79Z9ho4du\nqwkJ2+bJewiRIW7zYAeLey2xPT3BQGYdO5BBVAyAMCipttMEfRh7sD5mu98N\nXtsQ7cT7/F905yJQksmSdcfTJSQJXLMy8fCYPaupNyubAQNiKlh4BYiWHm0U\nGByQ6bjYQC+z74Ogh+Mj6BUxnJb/DRv8hzCnUFiB0ot4OMvnl44tE2Vvs+Jx\nSV1eSCA+P2iONaekVSzmzzZC/piOTc4gJUPlkCEm9rsjyVtXMrDFeQNSqX8Q\nVB4ZH1DRJ9Tw3jdCDkTPNk2erx+uyZ8/kj9Xqoo2b32aQ44D0Oz/YAVRds4B\nB1rC\r\n=x4I/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD6+hunH/Ls41kd228MhHrDHYundq8vk2YZBYJNkV2stQIhAKjV19IdhFmLX1HNi1TKM1LE/PKBAR7o0hk4aZEoVBTP"}]},"_npmUser":{"name":"rogier.spieker","email":"rogier+npm@konfirm.io"},"directories":{},"maintainers":[{"name":"rogier.spieker","email":"rogier+npm@konfirm.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trap_2.0.0-beta.2_1638516791804_0.43819437218048707"},"_hasShrinkwrap":false},"2.0.0-beta.3":{"name":"@konfirm/trap","version":"2.0.0-beta.3","description":"Provide traps for use as Proxy handler, allowing to keep track of changes and choose to commit or rollback changes","iife":"dist/trap.js","main":"dist/trap.cjs.js","module":"dist/trap.es.js","types":"dist/trap.d.ts","scripts":{"test":"run-script-os","test:nix":"ts-node node_modules/tape/bin/tape 'test/**/*.ts'","test:win32":"ts-node node_modules/tape/bin/tape test/**/*.ts","test:coverage":"run-script-os","test:coverage:nix":"nyc --reporter=html --require ts-node/register tape 'test/**/*.ts' | tap-arc","test:coverage:win32":"nyc --reporter=html --require ts-node/register tape test/**/*.ts | tap-arc","test:pretty":"run-script-os","test:pretty:nix":"nyc --require ts-node/register tape 'test/**/*.ts' | tap-arc","test:pretty:win32":"nyc --require ts-node/register tape test/**/*.ts | tap-arc","prebuild":"tsc --declarationDir temp --declaration true --emitDeclarationOnly true","build":"rollup -c rollup.config.js","postbuild":"rm -rf temp","prepublish":"npm run build"},"repository":{"type":"git","url":"git+https://github.com/konfirm/node-trap.git"},"bugs":{"url":"https://github.com/konfirm/node-trap/issues"},"keywords":["proxy","trap"],"author":{"name":"Rogier Spieker","email":"rogier@konfirm.eu"},"license":"MIT","engines":{"node":">=12"},"devDependencies":{"@rollup/plugin-commonjs":"^19.0.0","@rollup/plugin-node-resolve":"^13.0.0","@rollup/plugin-typescript":"^8.2.1","@types/tape":"^4.13.0","nyc":"^15.1.0","rollup":"^2.52.2","rollup-plugin-dts":"^3.0.2","rollup-plugin-terser":"^7.0.2","run-script-os":"^1.1.6","tap-arc":"^0.1.1","tape":"^5.3.1","template-literal-each":"^2.0.0","ts-node":"^10.3.0","tslib":"^2.3.0","typescript":"^4.4.4"},"dependencies":{"@konfirm/descriptor":"^1.0.0","@konfirm/guard":"^2.0.0"},"readme":"# Trap Module\n\n[![Codacy Badge](https://api.codacy.com/project/badge/Grade/4a1262f6063b47428c144ae57b0fc38a)](https://www.codacy.com/app/konfirm/node-trap?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=konfirm/node-trap&amp;utm_campaign=Badge_Grade)\n[![Build Status](https://travis-ci.org/konfirm/node-trap.svg?branch=master)](https://travis-ci.org/konfirm/node-trap)\n\nProvide traps for use as Proxy handler, allowing to keep track of changes and choose to commit or rollback changes\n\n## Installation\n\n```\n$ npm install --save @konfirm/trap\n```\n\n## Usage\nThe Trap module is designed to handle and reflect Proxy manipulations to an object [Proxy](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy), during its handler assignment you can provide a Trap-instance or parts of it.\n\n### Trap all mutations\n```js\n//  include the Trap module\n// const { Trap } = require('@konfirm/trap');\nimport { Trap } from '@konfirm/trap';\n//  create a trap instance\nconst trap = new Trap();\n//  create the affected object\nconst affect = { foo: 'bar', bar: 'baz' };\n//  create the proxy\nconst proxy = new Proxy(affect, trap);\n\nproxy.foo = 'hello world';\n\nconsole.log(proxy.foo);       //  'hello world'\nconsole.log(affect.foo);      //  'bar'\n\ndelete proxy.bar;\n\nconsole.log('bar' in proxy);   //  false\nconsole.log('bar' in affect);  //  true\n\n//  commit all trapped changes\ntrap.commit();\n\nconsole.log(affect.foo);  //  'hello world'\nconsole.log('bar' in affect);  //  false\n```\n\n\n## API\nTrap keeps track of changes within proxied objects, and exposes two methods besides the implemented [trap functions](https://github.com/konfirm/node-trap#implementedtrapfunctions).\n\n### Exports\n\n| name                  | description                                                                                                                  |\n| --------------------- | ---------------------------------------------------------------------------------------------------------------------------- |\n| `Trap`                | The `Trap` class itself                                                                                                      |\n| `MutationInterface`   | _TypeScript_ interface describing Mutations                                                                                  |\n| `isMutationInterface` | Type Guard validating whether the input is a `MutationInterface`                                                             |\n| `MutationOptions`     | _TypeScript_ type describing the target, key and optional value members of a `MutationInterface`                             |\n| `isMutationOptions`   | Type Guard validating whether the input is `MutationOptions`                                                                 |\n| `DeletionMutation`    | Mutation describing deletion mutations, created by `deleteProperty` (`delete target.key`) operations                         |\n| `PropertyMutation`    | Mutation describing property mutations, created by `defineProperty` (`Object.defineProperty(target, key, {...})`) operations |\n| `ValueMutation`       | Mutation describing value mutations, created by `set` (`target.key = ...`) operations                                        |\n| `AbstractMutation`    | abstract implementation of a Mutation                                                                                        |\n\n### type `MutationOptions`\n\n| property | type                        | required | notes                                                                                                       |\n| -------- | --------------------------- | -------- | ----------------------------------------------------------------------------------------------------------- |\n| `target` | `Object | Function | Array` | yes      | this can be narrowed down (e.g. only objects of a specific type), but never widened (e.g. not add booleans) |\n| `key`    | `string | symbol`           | yes      | this can be narrowed doen (e.g. only strings), but not wideneded (e.g. not add numbers)                     |\n| `value`  | `any`                       | no       |\n\n### `Trap([trackOnlyLastMutation])`\nThe Trap constructor accepts the `trackOnlyLastMutation` argument (default `false`) indicating whether or not the mutations should be limited to one per property. If `trackOnlyLastMutation` is set to `true` value, any previous change to the trapped object is remove before applying the next value. Should the next value effectively restore the original state, no new mutations is created and the number of mutations is decreased.\n\n### `commit`\nApply collected mutations (optionally filtered by a search parameter) to the target and reset the mutation list.\n\n```js\ntrap.commit({ target: myTarget }); // applies all collected mutations with target myTarget\ntrap.commit({ key: 'sample' });    // applies all collected mutations for key 'sample'\ntrap.commit();                     // applies all collected mutations\n```\n\n### `rollback`\nDrop mutations (optionally filtered by a search parameter) so these will never be applied to the target.\n\n```js\ntrap.rollback({ target: myTarget }); // removes all collected mutations with target myTarget\ntrap.rollback({ key: 'sample' });    // removes all collected mutations for key 'sample'\ntrap.rollback();                     // removes all collected mutations\n```\n\n### `count`\nAs v2.0 of `Trap` removed the mutations collection from direct access, the `count` method allows for counting the number of mutations (optionally filtered by a search parameter).\n\n```js\ntrap.count({ target: myTarget }); // counts all mutations with target myTarget\ntrap.count({ key: 'sample' });    // counts all mutations for key 'sample'\ntrap.count();                     // counts all mutations\n```\n\n### Implemented Trap functions\nTrap provides most of the Proxy handler methods which directly change object properties.\n\n  - [`defineProperty`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/defineProperty); traps `Object.defineProperty` calls\n  - [`deleteProperty`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/deleteProperty); traps property deletion\n  - [`get`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/get); traps property value getting\n  - [`getOwnPropertyDescriptor`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/getOwnPropertyDescriptor); traps `Object.getOwnPropertyDescriptor` calls\n  - [`has`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/has); traps `<key> in <Object>` calls\n  - [`ownKeys`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/ownKeys); traps `Object.keys` calls\n  - [`set`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/set); traps property value setting\n\n\n### Trap functions not implemented\nThe following functions are currently not implemented by the Trap module, if there is a need for them to be added, feel free to submit an issue or create a pull request.\n\n  - [`apply`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/apply); traps method invocations\n  - [`construct`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/construct); traps new instance creation\n  - [`getPrototypeOf`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/getPrototypeOf); traps `Object.getPrototypeOf` calls\n  - [`isExtensible`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/isExtensible); traps `Object.isExtensible` calls\n  - [`preventExtensions`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/preventExtensions); traps `Object.preventExtensions` calls\n  - [`setPrototypeOf`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/setPrototypeOf); traps `Object.setPrototypeOf` calls\n\n\n## Licence\n\nMIT License\n\nCopyright (c) 2017-2021 Rogier Spieker (Konfirm)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","readmeFilename":"README.md","gitHead":"7e78aaa787ed27ff8409b6d6a3605875663d3794","homepage":"https://github.com/konfirm/node-trap#readme","_id":"@konfirm/trap@2.0.0-beta.3","_nodeVersion":"14.17.6","_npmVersion":"6.14.15","dist":{"integrity":"sha512-WUcADw+dv+d8t6zN9uZ+V8Jz0elI9/Q+0PJh3CYhzwC0vwyKDSN56uuKASth3QpAqTKcONq0b6rxnph/EDes9Q==","shasum":"07316e86993dce3c6d912bd75b7179127eb85ef7","tarball":"https://registry.npmjs.org/@konfirm/trap/-/trap-2.0.0-beta.3.tgz","fileCount":20,"unpackedSize":160638,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhqq/hCRA9TVsSAnZWagAAHeMP/0hTzF0PQ6pu27apA483\nFFAqP5sl5Gum2jjdPDagrjKo09BXrMWTOpwLyWtdbt3cAU50pjteBRzE9Q5l\nUjviw8PA0vDIFbXQd0dNycjgnFkLLP2NS3FdbHvCMcfGTlrRkjmnqcnj5+XL\nxua6loe7p1sKgctwzmkBPYFCzqknBPRMzOOnoshZ7g7B2JMvSlnPJjdEROV1\nk1fsQ/f47yoJJ2pR0xs6hsTgkIZkUu/wi3A5bOclzmBAJuErtsTF0cqFnwNz\nAfiuqo1RyDDIM90hx2iDIrpdGQ1hVOJq6V1WI6w6ovrCH3GQJWtLfvvfqAmA\n7DnT/hF8P+n4NLbrD4slpqq6BXVJuatLUwwRwWIMTI1gzvlAnfP5UGIsddRE\nSRHSdqWEpukF5CQ9OfIuKzUKLhxJ12VArcHxk8SJuL4P8+5XhhZTS51SFWlX\nz4xo3vMmgut/RSokxmO96Vr83FBkdq6WqftQfIM6Ry92f/wi3kOkvqiJT2eB\nyUuhTTU32v1+2BkacIIiOtizvZQkpEmqCWSBBpsCs+j17u9brpAW4A33KZAh\n7sZ5rlFHTKWwaz6cV+IZ1xEhdFPV2pT7tVR6ogspNTBnhLbl7Jffe2q0W5NI\nQtttwFwp7scCwsZ3DRNaV/AD43cGa9ZsKJfc5LngTjxQs4DLqRSy6UrnuGoH\n90AR\r\n=laJW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD3+Jqz9+LT9/1EelKr7XKIU+41AriEjL/58ewX4t8VygIgE9REbwy2XluFIbDEoMYOVip38JkgDVq8fgfSJ6orXSs="}]},"_npmUser":{"name":"rogier.spieker","email":"rogier+npm@konfirm.io"},"directories":{},"maintainers":[{"name":"rogier.spieker","email":"rogier+npm@konfirm.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trap_2.0.0-beta.3_1638576097758_0.8982816193699501"},"_hasShrinkwrap":false},"2.0.0-beta.4":{"name":"@konfirm/trap","version":"2.0.0-beta.4","description":"Provide traps for use as Proxy handler, allowing to keep track of changes and choose to commit or rollback changes","iife":"dist/trap.js","main":"dist/trap.cjs.js","module":"dist/trap.es.js","types":"dist/trap.d.ts","scripts":{"test":"run-script-os","test:nix":"ts-node node_modules/tape/bin/tape 'test/**/*.ts'","test:win32":"ts-node node_modules/tape/bin/tape test/**/*.ts","test:coverage":"run-script-os","test:coverage:nix":"nyc --reporter=html --require ts-node/register tape 'test/**/*.ts' | tap-arc","test:coverage:win32":"nyc --reporter=html --require ts-node/register tape test/**/*.ts | tap-arc","test:pretty":"run-script-os","test:pretty:nix":"nyc --require ts-node/register tape 'test/**/*.ts' | tap-arc","test:pretty:win32":"nyc --require ts-node/register tape test/**/*.ts | tap-arc","prebuild":"tsc --declarationDir temp --declaration true --emitDeclarationOnly true","build":"rollup -c rollup.config.js","postbuild":"rm -rf temp","prepublish":"npm run build"},"repository":{"type":"git","url":"git+https://github.com/konfirm/node-trap.git"},"bugs":{"url":"https://github.com/konfirm/node-trap/issues"},"keywords":["proxy","trap"],"author":{"name":"Rogier Spieker","email":"rogier@konfirm.eu"},"license":"MIT","engines":{"node":">=12"},"devDependencies":{"@rollup/plugin-commonjs":"^19.0.0","@rollup/plugin-node-resolve":"^13.0.0","@rollup/plugin-typescript":"^8.2.1","@types/tape":"^4.13.0","nyc":"^15.1.0","rollup":"^2.52.2","rollup-plugin-dts":"^3.0.2","rollup-plugin-terser":"^7.0.2","run-script-os":"^1.1.6","tap-arc":"^0.1.1","tape":"^5.3.1","template-literal-each":"^2.0.0","ts-node":"^10.3.0","tslib":"^2.3.0","typescript":"^4.4.4"},"dependencies":{"@konfirm/descriptor":"^1.0.0","@konfirm/guard":"^2.0.0"},"readme":"# Trap Module\n\n[![Codacy Badge](https://api.codacy.com/project/badge/Grade/4a1262f6063b47428c144ae57b0fc38a)](https://www.codacy.com/app/konfirm/node-trap?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=konfirm/node-trap&amp;utm_campaign=Badge_Grade)\n[![Build Status](https://travis-ci.org/konfirm/node-trap.svg?branch=master)](https://travis-ci.org/konfirm/node-trap)\n\nProvide traps for use as Proxy handler, allowing to keep track of changes and choose to commit or rollback changes\n\n## Installation\n\n```\n$ npm install --save @konfirm/trap\n```\n\n## Usage\nThe Trap module is designed to handle and reflect Proxy manipulations to an object [Proxy](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy), during its handler assignment you can provide a Trap-instance or parts of it.\n\n### Trap all mutations\n```js\n//  include the Trap module\n// const { Trap } = require('@konfirm/trap');\nimport { Trap } from '@konfirm/trap';\n//  create a trap instance\nconst trap = new Trap();\n//  create the affected object\nconst affect = { foo: 'bar', bar: 'baz' };\n//  create the proxy\nconst proxy = new Proxy(affect, trap);\n\nproxy.foo = 'hello world';\n\nconsole.log(proxy.foo);       //  'hello world'\nconsole.log(affect.foo);      //  'bar'\n\ndelete proxy.bar;\n\nconsole.log('bar' in proxy);   //  false\nconsole.log('bar' in affect);  //  true\n\n//  commit all trapped changes\ntrap.commit();\n\nconsole.log(affect.foo);  //  'hello world'\nconsole.log('bar' in affect);  //  false\n```\n\n\n## API\nTrap keeps track of changes within proxied objects, and exposes two methods besides the implemented [trap functions](https://github.com/konfirm/node-trap#implementedtrapfunctions).\n\n### Exports\n\n| name                  | description                                                                                                                  |\n| --------------------- | ---------------------------------------------------------------------------------------------------------------------------- |\n| `Trap`                | The `Trap` class itself                                                                                                      |\n| `MutationInterface`   | _TypeScript_ interface describing Mutations                                                                                  |\n| `isMutationInterface` | Type Guard validating whether the input is a `MutationInterface`                                                             |\n| `MutationOptions`     | _TypeScript_ type describing the target, key and optional value members of a `MutationInterface`                             |\n| `isMutationOptions`   | Type Guard validating whether the input is `MutationOptions`                                                                 |\n| `DeletionMutation`    | Mutation describing deletion mutations, created by `deleteProperty` (`delete target.key`) operations                         |\n| `PropertyMutation`    | Mutation describing property mutations, created by `defineProperty` (`Object.defineProperty(target, key, {...})`) operations |\n| `ValueMutation`       | Mutation describing value mutations, created by `set` (`target.key = ...`) operations                                        |\n| `AbstractMutation`    | abstract implementation of a Mutation                                                                                        |\n\n### type `MutationOptions`\n\n| property | type                        | required | notes                                                                                                       |\n| -------- | --------------------------- | -------- | ----------------------------------------------------------------------------------------------------------- |\n| `target` | `Object | Function | Array` | yes      | this can be narrowed down (e.g. only objects of a specific type), but never widened (e.g. not add booleans) |\n| `key`    | `string | symbol`           | yes      | this can be narrowed doen (e.g. only strings), but not wideneded (e.g. not add numbers)                     |\n| `value`  | `any`                       | no       |\n\n### `Trap([trackOnlyLastMutation])`\nThe Trap constructor accepts the `trackOnlyLastMutation` argument (default `false`) indicating whether or not the mutations should be limited to one per property. If `trackOnlyLastMutation` is set to `true` value, any previous change to the trapped object is remove before applying the next value. Should the next value effectively restore the original state, no new mutations is created and the number of mutations is decreased.\n\n### `commit`\nApply collected mutations (optionally filtered by a search parameter) to the target and reset the mutation list.\n\n```js\ntrap.commit({ target: myTarget }); // applies all collected mutations with target myTarget\ntrap.commit({ key: 'sample' });    // applies all collected mutations for key 'sample'\ntrap.commit();                     // applies all collected mutations\n```\n\n### `rollback`\nDrop mutations (optionally filtered by a search parameter) so these will never be applied to the target.\n\n```js\ntrap.rollback({ target: myTarget }); // removes all collected mutations with target myTarget\ntrap.rollback({ key: 'sample' });    // removes all collected mutations for key 'sample'\ntrap.rollback();                     // removes all collected mutations\n```\n\n### `count`\nAs v2.0 of `Trap` removed the mutations collection from direct access, the `count` method allows for counting the number of mutations (optionally filtered by a search parameter).\n\n```js\ntrap.count({ target: myTarget }); // counts all mutations with target myTarget\ntrap.count({ key: 'sample' });    // counts all mutations for key 'sample'\ntrap.count();                     // counts all mutations\n```\n\n### Implemented Trap functions\nTrap provides most of the Proxy handler methods which directly change object properties.\n\n  - [`defineProperty`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/defineProperty); traps `Object.defineProperty` calls\n  - [`deleteProperty`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/deleteProperty); traps property deletion\n  - [`get`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/get); traps property value getting\n  - [`getOwnPropertyDescriptor`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/getOwnPropertyDescriptor); traps `Object.getOwnPropertyDescriptor` calls\n  - [`has`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/has); traps `<key> in <Object>` calls\n  - [`ownKeys`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/ownKeys); traps `Object.keys` calls\n  - [`set`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/set); traps property value setting\n\n\n### Trap functions not implemented\nThe following functions are currently not implemented by the Trap module, if there is a need for them to be added, feel free to submit an issue or create a pull request.\n\n  - [`apply`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/apply); traps method invocations\n  - [`construct`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/construct); traps new instance creation\n  - [`getPrototypeOf`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/getPrototypeOf); traps `Object.getPrototypeOf` calls\n  - [`isExtensible`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/isExtensible); traps `Object.isExtensible` calls\n  - [`preventExtensions`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/preventExtensions); traps `Object.preventExtensions` calls\n  - [`setPrototypeOf`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/setPrototypeOf); traps `Object.setPrototypeOf` calls\n\n\n## Licence\n\nMIT License\n\nCopyright (c) 2017-2021 Rogier Spieker (Konfirm)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","readmeFilename":"README.md","gitHead":"7e78aaa787ed27ff8409b6d6a3605875663d3794","homepage":"https://github.com/konfirm/node-trap#readme","_id":"@konfirm/trap@2.0.0-beta.4","_nodeVersion":"14.17.6","_npmVersion":"6.14.15","dist":{"integrity":"sha512-QDW/QaD8lvpMvPPxtGyEb1Vv9hSAh87+vtteU2xxnt9xRPBqu2/XRkIFcHISbyelJ68ZiJG5TrPQyS68vLFU/w==","shasum":"aeef6d680a0582cf08424d03c4066de987614fdb","tarball":"https://registry.npmjs.org/@konfirm/trap/-/trap-2.0.0-beta.4.tgz","fileCount":20,"unpackedSize":161023,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhqrDeCRA9TVsSAnZWagAAdy4P/Axdo6JXAYUKKur8OXp4\nZvjo9+Fs50F8u322dy22MR1pouAclQxMyHXzMpX71/1JuS/QqJqyXr/HhYfW\n86vik08DISHrpse64/m4S2T+uISwxt4lz5taMR7/OpkRsRToTzYJmuThjQy/\ngmYGzRyKgZ8t4SoXhWvP0dkOZpnqZP6Igp0eCca+B0mQFFAn5C8rqfwMEhbT\n8bIlDPgHNs5QKOILac91IdrzoXdQseTxM+AYp3haj36NUZbu4Hh6vOROcWAb\nItLCmRdVt1wLwbMsScfRNH3N12A19qrsgoMrx51jysx5s86IhgCkDfKw5ML5\nbRGfv1InKemUAyQbkMy/lytlHlbwrZwIxx/+ZMBbYPcgqAvwLGpw1YgZEeMA\ngLkBAHnU3rx7ji2CdGAvb5IDHIBK6ZhPcu9CMMeEVLTFH8w77Lz7d76iUbhS\nGj0/y3j7puSZLhvydaTPGv1egnH7Kn229C7Vs7G9sx3hRmci7Vw2iUOnxFVK\nwDhsG3TNU1bAsELfYY+rKr+LG4tE1TtLIGvE/3u3KHUh9yi80dZld3PTEQwg\nCpOKeIZdzlFWxY35I8Vpp0gJv0tC/2xTMrHGBbLgTFAWBE/OyFtGmpAeogdt\nqkc9F2xW9bySrmb3+pcJ4iSpRJFAI1jxl+5RsurLLY+5qhGZjdcNjaGGNEzQ\nUmwo\r\n=d0rS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCm6he2ceRTVjcKLBl+dfpqvwHrMxSpl9BSpFbmADBNfgIgIvWqi+k7LhHsFdizau3t30AZCwd4+Vdot5QdHLWZre8="}]},"_npmUser":{"name":"rogier.spieker","email":"rogier+npm@konfirm.io"},"directories":{},"maintainers":[{"name":"rogier.spieker","email":"rogier+npm@konfirm.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trap_2.0.0-beta.4_1638576349847_0.4878352443780274"},"_hasShrinkwrap":false},"2.0.0-beta.5":{"name":"@konfirm/trap","version":"2.0.0-beta.5","description":"Provide traps for use as Proxy handler, allowing to keep track of changes and choose to commit or rollback changes","iife":"dist/trap.js","main":"dist/trap.cjs.js","module":"dist/trap.es.js","types":"dist/trap.d.ts","scripts":{"test":"run-script-os","test:nix":"ts-node node_modules/tape/bin/tape 'test/**/*.ts'","test:win32":"ts-node node_modules/tape/bin/tape test/**/*.ts","test:coverage":"run-script-os","test:coverage:nix":"nyc --reporter=html --require ts-node/register tape 'test/**/*.ts' | tap-arc","test:coverage:win32":"nyc --reporter=html --require ts-node/register tape test/**/*.ts | tap-arc","test:pretty":"run-script-os","test:pretty:nix":"nyc --require ts-node/register tape 'test/**/*.ts' | tap-arc","test:pretty:win32":"nyc --require ts-node/register tape test/**/*.ts | tap-arc","prebuild":"tsc --declarationDir temp --declaration true --emitDeclarationOnly true","build":"rollup -c rollup.config.js","postbuild":"rm -rf temp","prepublish":"npm run build"},"repository":{"type":"git","url":"git+https://github.com/konfirm/node-trap.git"},"bugs":{"url":"https://github.com/konfirm/node-trap/issues"},"keywords":["proxy","trap"],"author":{"name":"Rogier Spieker","email":"rogier@konfirm.eu"},"license":"MIT","engines":{"node":">=12"},"devDependencies":{"@rollup/plugin-commonjs":"^19.0.0","@rollup/plugin-node-resolve":"^13.0.0","@rollup/plugin-typescript":"^8.2.1","@types/tape":"^4.13.0","nyc":"^15.1.0","rollup":"^2.52.2","rollup-plugin-dts":"^3.0.2","rollup-plugin-terser":"^7.0.2","run-script-os":"^1.1.6","tap-arc":"^0.1.1","tape":"^5.3.1","template-literal-each":"^2.0.0","ts-node":"^10.3.0","tslib":"^2.3.0","typescript":"^4.4.4"},"dependencies":{"@konfirm/descriptor":"^1.0.0","@konfirm/guard":"^2.0.0"},"readme":"# Trap Module\n\n[![Codacy Badge](https://api.codacy.com/project/badge/Grade/4a1262f6063b47428c144ae57b0fc38a)](https://www.codacy.com/app/konfirm/node-trap?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=konfirm/node-trap&amp;utm_campaign=Badge_Grade)\n[![Build Status](https://travis-ci.org/konfirm/node-trap.svg?branch=master)](https://travis-ci.org/konfirm/node-trap)\n\nProvide traps for use as Proxy handler, allowing to keep track of changes and choose to commit or rollback changes\n\n## Installation\n\n```\n$ npm install --save @konfirm/trap\n```\n\n## Usage\nThe Trap module is designed to handle and reflect Proxy manipulations to an object [Proxy](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy), during its handler assignment you can provide a Trap-instance or parts of it.\n\n### Trap all mutations\n```js\n//  include the Trap module\n// const { Trap } = require('@konfirm/trap');\nimport { Trap } from '@konfirm/trap';\n//  create a trap instance\nconst trap = new Trap();\n//  create the affected object\nconst affect = { foo: 'bar', bar: 'baz' };\n//  create the proxy\nconst proxy = new Proxy(affect, trap);\n\nproxy.foo = 'hello world';\n\nconsole.log(proxy.foo);       //  'hello world'\nconsole.log(affect.foo);      //  'bar'\n\ndelete proxy.bar;\n\nconsole.log('bar' in proxy);   //  false\nconsole.log('bar' in affect);  //  true\n\n//  commit all trapped changes\ntrap.commit();\n\nconsole.log(affect.foo);  //  'hello world'\nconsole.log('bar' in affect);  //  false\n```\n\n\n## API\nTrap keeps track of changes within proxied objects, and exposes two methods besides the implemented [trap functions](https://github.com/konfirm/node-trap#implementedtrapfunctions).\n\n### Exports\n\n| name                  | description                                                                                                                  |\n| --------------------- | ---------------------------------------------------------------------------------------------------------------------------- |\n| `Trap`                | The `Trap` class itself                                                                                                      |\n| `MutationInterface`   | _TypeScript_ interface describing Mutations                                                                                  |\n| `isMutationInterface` | Type Guard validating whether the input is a `MutationInterface`                                                             |\n| `MutationOptions`     | _TypeScript_ type describing the target, key and optional value members of a `MutationInterface`                             |\n| `isMutationOptions`   | Type Guard validating whether the input is `MutationOptions`                                                                 |\n| `DeletionMutation`    | Mutation describing deletion mutations, created by `deleteProperty` (`delete target.key`) operations                         |\n| `PropertyMutation`    | Mutation describing property mutations, created by `defineProperty` (`Object.defineProperty(target, key, {...})`) operations |\n| `ValueMutation`       | Mutation describing value mutations, created by `set` (`target.key = ...`) operations                                        |\n| `AbstractMutation`    | abstract implementation of a Mutation                                                                                        |\n\n### type `MutationOptions`\n\n| property | type                        | required | notes                                                                                                       |\n| -------- | --------------------------- | -------- | ----------------------------------------------------------------------------------------------------------- |\n| `target` | `Object | Function | Array` | yes      | this can be narrowed down (e.g. only objects of a specific type), but never widened (e.g. not add booleans) |\n| `key`    | `string | symbol`           | yes      | this can be narrowed doen (e.g. only strings), but not wideneded (e.g. not add numbers)                     |\n| `value`  | `any`                       | no       |\n\n### `Trap([trackOnlyLastMutation])`\nThe Trap constructor accepts the `trackOnlyLastMutation` argument (default `false`) indicating whether or not the mutations should be limited to one per property. If `trackOnlyLastMutation` is set to `true` value, any previous change to the trapped object is remove before applying the next value. Should the next value effectively restore the original state, no new mutations is created and the number of mutations is decreased.\n\n### `commit`\nApply collected mutations (optionally filtered by a search parameter) to the target and reset the mutation list.\n\n```js\ntrap.commit({ target: myTarget }); // applies all collected mutations with target myTarget\ntrap.commit({ key: 'sample' });    // applies all collected mutations for key 'sample'\ntrap.commit();                     // applies all collected mutations\n```\n\n### `rollback`\nDrop mutations (optionally filtered by a search parameter) so these will never be applied to the target.\n\n```js\ntrap.rollback({ target: myTarget }); // removes all collected mutations with target myTarget\ntrap.rollback({ key: 'sample' });    // removes all collected mutations for key 'sample'\ntrap.rollback();                     // removes all collected mutations\n```\n\n### `count`\nAs v2.0 of `Trap` removed the mutations collection from direct access, the `count` method allows for counting the number of mutations (optionally filtered by a search parameter).\n\n```js\ntrap.count({ target: myTarget }); // counts all mutations with target myTarget\ntrap.count({ key: 'sample' });    // counts all mutations for key 'sample'\ntrap.count();                     // counts all mutations\n```\n\n### Implemented Trap functions\nTrap provides most of the Proxy handler methods which directly change object properties.\n\n  - [`defineProperty`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/defineProperty); traps `Object.defineProperty` calls\n  - [`deleteProperty`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/deleteProperty); traps property deletion\n  - [`get`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/get); traps property value getting\n  - [`getOwnPropertyDescriptor`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/getOwnPropertyDescriptor); traps `Object.getOwnPropertyDescriptor` calls\n  - [`has`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/has); traps `<key> in <Object>` calls\n  - [`ownKeys`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/ownKeys); traps `Object.keys` calls\n  - [`set`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/set); traps property value setting\n\n\n### Trap functions not implemented\nThe following functions are currently not implemented by the Trap module, if there is a need for them to be added, feel free to submit an issue or create a pull request.\n\n  - [`apply`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/apply); traps method invocations\n  - [`construct`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/construct); traps new instance creation\n  - [`getPrototypeOf`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/getPrototypeOf); traps `Object.getPrototypeOf` calls\n  - [`isExtensible`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/isExtensible); traps `Object.isExtensible` calls\n  - [`preventExtensions`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/preventExtensions); traps `Object.preventExtensions` calls\n  - [`setPrototypeOf`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/setPrototypeOf); traps `Object.setPrototypeOf` calls\n\n\n## Licence\n\nMIT License\n\nCopyright (c) 2017-2021 Rogier Spieker (Konfirm)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","readmeFilename":"README.md","gitHead":"06168210dce1a0f4b1b19a6e37afc6ef86becdb4","homepage":"https://github.com/konfirm/node-trap#readme","_id":"@konfirm/trap@2.0.0-beta.5","_nodeVersion":"14.17.6","_npmVersion":"6.14.15","dist":{"integrity":"sha512-3HXL82rlSQi4+8qPO1i+KWNUej2duVUVpZvSoEXdafjO8jgq5C3sx0W+bAMMOvRSdWvKQyKcPNqGvFomXKdxVQ==","shasum":"898d9c1b46a04f991764c53e7ec843c5d781b191","tarball":"https://registry.npmjs.org/@konfirm/trap/-/trap-2.0.0-beta.5.tgz","fileCount":20,"unpackedSize":161088,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhqrGYCRA9TVsSAnZWagAAUiQQAJGp+VbjiYzDFN949EBr\nS8gxWwGeNgbrgmHlPqyDtWPFUchpomJWBHb01nVYpu+P/vIwbR0o49qBJZQ9\nJweH1+6wrzNVOIzQY5fo02hVFaLRO23zoL+r5G3f/A4Yml9T+dvC1T4feD2b\nzJ4Nof4jbd7HZIUspd3918bH3nC9sRst2YokED45xg+AgYHSbYWtkVaqCqw1\nDRGjWmdIRtcZQo9cXXdlbhcCNV8dPFzIaMxkgfpCgyU8Zo0E+uTupPT35sJY\nnFE5u15QHfOzWl37D9CiwL11s4RJOwuzOPOWtLQx6xflFFO5yQXzzm+c6Mhk\n9thwbNGGmqwcM9AHKVIiiFd1ubeAybst8d1kOqngqTEAC6cJLN6hJPNJmG5X\nC+HFG1kGNKw/K77GvpE8bnKS0b07CoH5GkNVBt8bWIjAYnAPIQ6bNGQRwxi3\nklzn4qv4y1fylHH/H844G6emtaL835ZN28JEhbi4qjVBryxSWLwxjXCD2bHO\n84pD3ZeluQxRyyYwrOp45yDtE5JMI7YnnFmU6CnfMrBC6FmWzNoHb+KurxUf\nERJSqtRnVOs1QJuhq7T3zIwnHbSgdAJUc2izul0FtERf7Yc09HLtYX02ryZf\ncL1K1n+19/HEaK11L8AlB2ynQ9TEAvUlYm1KnBRvSIivSxi6dkcltnGSZMwv\noY/x\r\n=W7LW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDIhiFTxERuKdGKoZu8+3EvNvK1Obzkn2iSwltQjaWPyAIgCK4XzCRL/gY6qWY4mUiWn5la+LadTC1Uvbh/E8TUrRw="}]},"_npmUser":{"name":"rogier.spieker","email":"rogier+npm@konfirm.io"},"directories":{},"maintainers":[{"name":"rogier.spieker","email":"rogier+npm@konfirm.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trap_2.0.0-beta.5_1638576536455_0.32692291145588337"},"_hasShrinkwrap":false},"2.0.0-beta.7":{"name":"@konfirm/trap","version":"2.0.0-beta.7","description":"Provide traps for use as Proxy handler, allowing to keep track of changes and choose to commit or rollback changes","iife":"dist/trap.js","main":"dist/trap.cjs.js","module":"dist/trap.es.js","types":"dist/trap.d.ts","scripts":{"test":"run-script-os","test:nix":"ts-node node_modules/tape/bin/tape 'test/**/*.ts'","test:win32":"ts-node node_modules/tape/bin/tape test/**/*.ts","test:coverage":"run-script-os","test:coverage:nix":"nyc --reporter=html --require ts-node/register tape 'test/**/*.ts' | tap-arc","test:coverage:win32":"nyc --reporter=html --require ts-node/register tape test/**/*.ts | tap-arc","test:pretty":"run-script-os","test:pretty:nix":"nyc --require ts-node/register tape 'test/**/*.ts' | tap-arc","test:pretty:win32":"nyc --require ts-node/register tape test/**/*.ts | tap-arc","prebuild":"tsc --declarationDir temp --declaration true --emitDeclarationOnly true","build":"rollup -c rollup.config.js","postbuild":"rm -rf temp","prepublish":"npm run build"},"repository":{"type":"git","url":"git+https://github.com/konfirm/node-trap.git"},"bugs":{"url":"https://github.com/konfirm/node-trap/issues"},"keywords":["proxy","trap"],"author":{"name":"Rogier Spieker","email":"rogier@konfirm.eu"},"license":"MIT","engines":{"node":">=12"},"devDependencies":{"@rollup/plugin-commonjs":"^19.0.0","@rollup/plugin-node-resolve":"^13.0.0","@rollup/plugin-typescript":"^8.2.1","@types/tape":"^4.13.0","nyc":"^15.1.0","rollup":"^2.52.2","rollup-plugin-dts":"^3.0.2","rollup-plugin-terser":"^7.0.2","run-script-os":"^1.1.6","tap-arc":"^0.1.1","tape":"^5.3.1","template-literal-each":"^2.0.0","ts-node":"^10.3.0","tslib":"^2.3.0","typescript":"^4.4.4"},"dependencies":{"@konfirm/descriptor":"^1.0.0","@konfirm/guard":"^2.0.0"},"readme":"# Trap Module\n\n[![Codacy Badge](https://api.codacy.com/project/badge/Grade/4a1262f6063b47428c144ae57b0fc38a)](https://www.codacy.com/app/konfirm/node-trap?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=konfirm/node-trap&amp;utm_campaign=Badge_Grade)\n[![Build Status](https://travis-ci.org/konfirm/node-trap.svg?branch=master)](https://travis-ci.org/konfirm/node-trap)\n\nProvide traps for use as Proxy handler, allowing to keep track of changes and choose to commit or rollback changes\n\n## Installation\n\n```\n$ npm install --save @konfirm/trap\n```\n\n## Usage\nThe Trap module is designed to handle and reflect Proxy manipulations to an object [Proxy](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy), during its handler assignment you can provide a Trap-instance or parts of it.\n\n### Trap all mutations\n```js\n//  include the Trap module\n// const { Trap } = require('@konfirm/trap');\nimport { Trap } from '@konfirm/trap';\n//  create a trap instance\nconst trap = new Trap();\n//  create the affected object\nconst affect = { foo: 'bar', bar: 'baz' };\n//  create the proxy\nconst proxy = new Proxy(affect, trap);\n\nproxy.foo = 'hello world';\n\nconsole.log(proxy.foo);       //  'hello world'\nconsole.log(affect.foo);      //  'bar'\n\ndelete proxy.bar;\n\nconsole.log('bar' in proxy);   //  false\nconsole.log('bar' in affect);  //  true\n\n//  commit all trapped changes\ntrap.commit();\n\nconsole.log(affect.foo);  //  'hello world'\nconsole.log('bar' in affect);  //  false\n```\n\n\n## API\nTrap keeps track of changes within proxied objects, and exposes two methods besides the implemented [trap functions](https://github.com/konfirm/node-trap#implementedtrapfunctions).\n\n### Exports\n\n| name                  | description                                                                                                                  |\n| --------------------- | ---------------------------------------------------------------------------------------------------------------------------- |\n| `Trap`                | The `Trap` class itself                                                                                                      |\n| `MutationInterface`   | _TypeScript_ interface describing Mutations                                                                                  |\n| `isMutationInterface` | Type Guard validating whether the input is a `MutationInterface`                                                             |\n| `MutationOptions`     | _TypeScript_ type describing the target, key and optional value members of a `MutationInterface`                             |\n| `isMutationOptions`   | Type Guard validating whether the input is `MutationOptions`                                                                 |\n| `DeletionMutation`    | Mutation describing deletion mutations, created by `deleteProperty` (`delete target.key`) operations                         |\n| `PropertyMutation`    | Mutation describing property mutations, created by `defineProperty` (`Object.defineProperty(target, key, {...})`) operations |\n| `ValueMutation`       | Mutation describing value mutations, created by `set` (`target.key = ...`) operations                                        |\n| `AbstractMutation`    | abstract implementation of a Mutation                                                                                        |\n\n### type `MutationOptions`\n\n| property | type                        | required | notes                                                                                                       |\n| -------- | --------------------------- | -------- | ----------------------------------------------------------------------------------------------------------- |\n| `target` | `Object | Function | Array` | yes      | this can be narrowed down (e.g. only objects of a specific type), but never widened (e.g. not add booleans) |\n| `key`    | `string | symbol`           | yes      | this can be narrowed doen (e.g. only strings), but not wideneded (e.g. not add numbers)                     |\n| `value`  | `any`                       | no       |\n\n### `Trap([trackOnlyLastMutation])`\nThe Trap constructor accepts the `trackOnlyLastMutation` argument (default `false`) indicating whether or not the mutations should be limited to one per property. If `trackOnlyLastMutation` is set to `true` value, any previous change to the trapped object is remove before applying the next value. Should the next value effectively restore the original state, no new mutations is created and the number of mutations is decreased.\n\n### `commit`\nApply collected mutations (optionally filtered by a search parameter) to the target and reset the mutation list.\n\n```js\ntrap.commit({ target: myTarget }); // applies all collected mutations with target myTarget\ntrap.commit({ key: 'sample' });    // applies all collected mutations for key 'sample'\ntrap.commit();                     // applies all collected mutations\n```\n\n### `rollback`\nDrop mutations (optionally filtered by a search parameter) so these will never be applied to the target.\n\n```js\ntrap.rollback({ target: myTarget }); // removes all collected mutations with target myTarget\ntrap.rollback({ key: 'sample' });    // removes all collected mutations for key 'sample'\ntrap.rollback();                     // removes all collected mutations\n```\n\n### `count`\nAs v2.0 of `Trap` removed the mutations collection from direct access, the `count` method allows for counting the number of mutations (optionally filtered by a search parameter).\n\n```js\ntrap.count({ target: myTarget }); // counts all mutations with target myTarget\ntrap.count({ key: 'sample' });    // counts all mutations for key 'sample'\ntrap.count();                     // counts all mutations\n```\n\n### Implemented Trap functions\nTrap provides most of the Proxy handler methods which directly change object properties.\n\n  - [`defineProperty`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/defineProperty); traps `Object.defineProperty` calls\n  - [`deleteProperty`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/deleteProperty); traps property deletion\n  - [`get`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/get); traps property value getting\n  - [`getOwnPropertyDescriptor`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/getOwnPropertyDescriptor); traps `Object.getOwnPropertyDescriptor` calls\n  - [`has`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/has); traps `<key> in <Object>` calls\n  - [`ownKeys`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/ownKeys); traps `Object.keys` calls\n  - [`set`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/set); traps property value setting\n\n\n### Trap functions not implemented\nThe following functions are currently not implemented by the Trap module, if there is a need for them to be added, feel free to submit an issue or create a pull request.\n\n  - [`apply`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/apply); traps method invocations\n  - [`construct`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/construct); traps new instance creation\n  - [`getPrototypeOf`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/getPrototypeOf); traps `Object.getPrototypeOf` calls\n  - [`isExtensible`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/isExtensible); traps `Object.isExtensible` calls\n  - [`preventExtensions`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/preventExtensions); traps `Object.preventExtensions` calls\n  - [`setPrototypeOf`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/setPrototypeOf); traps `Object.setPrototypeOf` calls\n\n\n## Licence\n\nMIT License\n\nCopyright (c) 2017-2021 Rogier Spieker (Konfirm)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","readmeFilename":"README.md","gitHead":"8246899a33af330c988011a333442cd80ef11fd6","homepage":"https://github.com/konfirm/node-trap#readme","_id":"@konfirm/trap@2.0.0-beta.7","_nodeVersion":"14.17.6","_npmVersion":"6.14.15","dist":{"integrity":"sha512-sKGLFPyd1ZKsFjsr/0XojpkCzTWhIVUDOX53Nn485jt1jgEArc3rnrqpjDy8y5OUGQLcxLXJSyn+OTdBeh9dUw==","shasum":"88753165fe917834df101090818b1dae26bea3ca","tarball":"https://registry.npmjs.org/@konfirm/trap/-/trap-2.0.0-beta.7.tgz","fileCount":20,"unpackedSize":161382,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhq2GkCRA9TVsSAnZWagAAEz4QAJmpyWz87qywk4hkCW7R\n8S/EsSPquSMU8AeC0DZNQgUZaiJlq+mL4vCUfmj8cGsRxWdpdc7JCshEOdJq\n9NC8waMajmlAYNgHEADwCUSEaJeYUDUNsnIGthwf7sYZ/1ZT9cAhpXX2SJ1v\nrvg+9CtT9np6ms7SsLcxGIT3mU7OqWgTOFBeEOkXLmfGI9m0Kh4+GZT8NLZ8\nWK+eVe8qw6Sxe6IXsfJ6cuU7QDDmUpOLzekkXVeUVYmyigZjrsNI229Ngahg\nl8ZExb/T02Q9yhSiduDwAK+k0BoEnTPuAHwGRq+I4MLI8QQejo9Yed3BSiUf\n+J4StpVrSqqHLBAu3zTa/DBuzR6/ipFY4kZZLQdvT11wHXlBciNrOtNuTR7p\nFUXBOakhi5LRJ13dk0/C4mjCD4P1FkgmswFEOkGYEuFaCCrVZjEwaeLdHyBB\neNx8AgFwHwCbfZhMaz/wrM89BRMi5i/PUdPKj/mcgXgvHq4jcROjTUbMcWzz\nFD2kAxxFIGarAKJbPGiyIIrned0jVMPUc3rIFH5ENqd4aeAO0/GF5UzKlQJO\nZuqOou92WhokFmigPa8OHianF5oRhET8WbpWR4CW1PAfmj1Vfqzrmc1xqCHW\nQhiVEr+gfi+MhPuEWOG7mGwA1FOYP6X7L5EZ1j1JdzsJ/scj6XPpurYPggjc\nyTEj\r\n=r2ol\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICntUIJRFJahXt5Y4ynneQTP0hEKJZrY8o7TXNEe54sEAiA/KeupX6ewCisGTwlS/E/WSgHhjdVbnc9+9B04QTU73Q=="}]},"_npmUser":{"name":"rogier.spieker","email":"rogier+npm@konfirm.io"},"directories":{},"maintainers":[{"name":"rogier.spieker","email":"rogier+npm@konfirm.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trap_2.0.0-beta.7_1638621603664_0.858330609179546"},"_hasShrinkwrap":false},"2.0.0":{"name":"@konfirm/trap","version":"2.0.0","description":"Provide traps for use as Proxy handler, allowing to keep track of changes and choose to commit or rollback changes","iife":"dist/trap.js","main":"dist/trap.cjs.js","module":"dist/trap.es.js","types":"dist/trap.d.ts","scripts":{"test":"run-script-os","test:nix":"ts-node node_modules/tape/bin/tape 'test/**/*.ts'","test:win32":"ts-node node_modules/tape/bin/tape test/**/*.ts","test:coverage":"run-script-os","test:coverage:nix":"nyc --reporter=html --require ts-node/register tape 'test/**/*.ts' | tap-arc","test:coverage:win32":"nyc --reporter=html --require ts-node/register tape test/**/*.ts | tap-arc","test:pretty":"run-script-os","test:pretty:nix":"nyc --require ts-node/register tape 'test/**/*.ts' | tap-arc","test:pretty:win32":"nyc --require ts-node/register tape test/**/*.ts | tap-arc","prebuild":"tsc --declarationDir temp --declaration true --emitDeclarationOnly true","build":"rollup -c rollup.config.mjs","postbuild":"rm -rf temp","prepublish":"npm run build"},"repository":{"type":"git","url":"git+https://github.com/konfirm/node-trap.git"},"bugs":{"url":"https://github.com/konfirm/node-trap/issues"},"keywords":["proxy","trap"],"author":{"name":"Rogier Spieker","email":"rogier@konfirm.eu"},"license":"MIT","engines":{"node":">=14"},"devDependencies":{"@rollup/plugin-commonjs":"^24.0.1","@rollup/plugin-node-resolve":"^15.0.1","@rollup/plugin-terser":"^0.4.0","@rollup/plugin-typescript":"^11.0.0","@types/tape":"^4.13.3","nyc":"^15.1.0","rollup":"^3.20.2","rollup-plugin-dts":"^5.3.0","run-script-os":"^1.1.6","tap-arc":"^0.3.5","tape":"^5.6.3","template-literal-each":"^3.0.0","ts-node":"^10.9.1","tslib":"^2.5.0","typescript":"^5.0.2"},"dependencies":{"@konfirm/descriptor":"^1.0.0","@konfirm/guard":"^2.0.1"},"gitHead":"b9aa045ac946372f752f58b1cf240495032af3b6","homepage":"https://github.com/konfirm/node-trap#readme","_id":"@konfirm/trap@2.0.0","_nodeVersion":"16.19.1","_npmVersion":"8.19.3","dist":{"integrity":"sha512-lV9NyCWCSXde0gn1d9dXbMMka8TDKAA0/1/a0JIedT/LyYbRQyiVeELcUoMUZjA1ml/03nBaNTZ8K2k5Cifvgg==","shasum":"f241752c1c397f661eaf02f37164a5ff0f8a1701","tarball":"https://registry.npmjs.org/@konfirm/trap/-/trap-2.0.0.tgz","fileCount":28,"unpackedSize":166133,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAH+ALLjyK61acDHIiaUs8BQHmR6XWgA8QaJKGRfa+j3AiEAi5WPqAiNBLlgh9xPTxirRFO6MwQNPRXGqTP6Hj0wXuA="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkHVYcACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoxPw//XlBqkSdLNF3AMfhMWIfWCBhmsWatJfeCL/zCGQPghf8lrk1T\r\niSYeXqu1sRuO3ClpXiKPsP1pWkC3ALPVIv46k9vFdUhYawEmtcus++YDlEbh\r\nWlP2vZGHjyTZTO5dGb400yEogoVFp/TVlMfsQ1SKjqQhwGeZlM9ZFeY3Q0v3\r\nbdD/cHr3CQs9oulNaWZapL+WFSOogPTrwdyzQfETxk8LJg1TCQECO+umanpJ\r\ncdkduNX9yZDjHeyT9lAznibb4sDuMmzne+7ioUijGbCjJ4jCp8Q62GCxeaeI\r\n1/1MpBZPY/4r+y9AFShEQdsGJBcfAwFouu2pdHfSf3DoFloGxDp0AugmgFIQ\r\nBvwQuWaYaSG0SZ5BZwsTj7hsVeg3pcA9NJuODK9gzNJVGrDEAxy1JmJK3FU9\r\n5FrnbK8jA6PxikTOpuWA5uYyPR2ean6Uojort4PgJeoP3CE0Ky6ZhxccqCL6\r\nXMzsNLUfsb2I8XIX2sHkVB/bt+zviuN8YT97FG+50mw3lm7/LoKue6PHA5Q+\r\nTIKMl9lkZISmE/AqDMjdwbt+tlGjL4kF6PQLciT4A6RAPY0kdPPZizQEg7+a\r\ndE0O8rnbFFdu8NwX+P0TtLhhgZzgw/xdS4ZYyzXF7tOeepMT8sdwnFnmANJg\r\nc/ruD0jp5ctWDlYexpd1RF10BsBD9hEsnUo=\r\n=bo+4\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"rogier.spieker","email":"rogier+npm@konfirm.io"},"directories":{},"maintainers":[{"name":"rogier.spieker","email":"rogier+npm@konfirm.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trap_2.0.0_1679644188567_0.6596991593988197"},"_hasShrinkwrap":false},"2.0.1":{"name":"@konfirm/trap","version":"2.0.1","description":"Provide traps for use as Proxy handler, allowing to keep track of changes and choose to commit or rollback changes","iife":"dist/trap.js","main":"dist/trap.cjs.js","module":"dist/trap.es.js","types":"dist/trap.d.ts","scripts":{"test":"run-script-os","test:nix":"ts-node node_modules/tape/bin/tape 'test/**/*.ts'","test:win32":"ts-node node_modules/tape/bin/tape test/**/*.ts","test:coverage":"run-script-os","test:coverage:nix":"nyc --reporter=html --require ts-node/register tape 'test/**/*.ts' | tap-arc","test:coverage:win32":"nyc --reporter=html --require ts-node/register tape test/**/*.ts | tap-arc","test:pretty":"run-script-os","test:pretty:nix":"nyc --require ts-node/register tape 'test/**/*.ts' | tap-arc","test:pretty:win32":"nyc --require ts-node/register tape test/**/*.ts | tap-arc","prebuild":"tsc --declarationDir temp --declaration true --emitDeclarationOnly true","build":"rollup -c rollup.config.mjs","postbuild":"rm -rf temp","prepublish":"npm run build"},"repository":{"type":"git","url":"git+https://github.com/konfirm/node-trap.git"},"bugs":{"url":"https://github.com/konfirm/node-trap/issues"},"keywords":["proxy","trap"],"author":{"name":"Rogier Spieker","email":"rogier@konfirm.eu"},"license":"MIT","engines":{"node":">=14"},"devDependencies":{"@rollup/plugin-commonjs":"^24.0.1","@rollup/plugin-node-resolve":"^15.0.1","@rollup/plugin-terser":"^0.4.0","@rollup/plugin-typescript":"^11.0.0","@types/tape":"^4.13.3","nyc":"^15.1.0","rollup":"^3.20.2","rollup-plugin-dts":"^5.3.0","run-script-os":"^1.1.6","tap-arc":"^0.3.5","tape":"^5.6.3","template-literal-each":"^3.0.0","ts-node":"^10.9.1","tslib":"^2.5.0","typescript":"^5.0.2"},"dependencies":{"@konfirm/descriptor":"^1.0.0","@konfirm/guard":"^2.0.1"},"gitHead":"ee43b2264d7d5e79e81fdc32e52a70f1302f64a9","homepage":"https://github.com/konfirm/node-trap#readme","_id":"@konfirm/trap@2.0.1","_nodeVersion":"16.19.1","_npmVersion":"8.19.3","dist":{"integrity":"sha512-q61HHIZR3tC3ouhSbNlo1qQUD4tytrEZtBu51WQR1wRgqhtG4hGWQiUFaNI0hTgo4HTzt5PygmCXDIii8kkGOA==","shasum":"81cc5f0228932e1158afbb7ecd1bf49d2b245cff","tarball":"https://registry.npmjs.org/@konfirm/trap/-/trap-2.0.1.tgz","fileCount":28,"unpackedSize":166461,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFqSSNJ1npQoq5kFgMh3EhDIe3WohK9J0Ffn9JRfCfY0AiAPWuuEF0sYj/MlnHwMVUIYCz2Hi7BlOEvWWk3QwHA31g=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkJCbIACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqEZg/8D0XujMu7f8q3A2kociJzC3GgxRqyu2RcnJONJWbs69Xt2QmO\r\nAtdXDM4NS0YwL4iIKnwDUtPEwkDD53jQTZw4zwYR0yRbKa9I9LdYXQ3mG5+I\r\nkDFsWZZz/SCM+coE/ExACcH0kB2g/cpUQWO40Iz8fuAEbD1KssXFv2O0izrN\r\ndhZJq0QbZ9onROs4zr/H2SaOT8LI1ktE4f7/MHJ+RBlR12G5H4ot6v7wJvci\r\nIw2YFEiPcPQt6IAsKRgxVBkHSmjkzMxRUlR1K/wEaa4BO2t1KsSRs9D4JxOo\r\nGFzvawjD2KsMDrL5Nts5YebvaOfuIa2Eij2wFQAPg2U+SWCeGBu7k/gC+SdS\r\nyx4o9s/seUs4DljQXwBtarDfXa+dvyXF2Zoo5Yow8QeAn1XAhKJt1Bh9434i\r\ndFzb9hmFhdl1JnqgnGo5mMYxv4EqFk7UUYv4fzo+BRD3rpCOKsc3ZaoIdaM0\r\ntFwyArVw1kx42t46NwNYQAlwBLXC7lpTIrm1LvvONCoGYK+I4qdijpq2dSLu\r\nZhrikvmzxAKiv/5CfR/d1FcMUviw2Iebw6omE/agnODuz9+DIorelfu5Hl/F\r\nfsIQZpzizKHC/4S97UhqO6Q0CIxTvjSz5pZG3FRK/qvZmPFsZ9khS3zz4iX5\r\n17e/BPfLByNi0QvdOjmLfrJxdg7Zs1YmZ9g=\r\n=VST+\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"rogier.spieker","email":"rogier+npm@konfirm.io"},"directories":{},"maintainers":[{"name":"rogier.spieker","email":"rogier+npm@konfirm.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trap_2.0.1_1680090824468_0.24054366055368437"},"_hasShrinkwrap":false},"2.0.2":{"name":"@konfirm/trap","version":"2.0.2","description":"Provide traps for use as Proxy handler, allowing to keep track of changes and choose to commit or rollback changes","iife":"dist/trap.js","main":"dist/trap.cjs.js","module":"dist/trap.es.js","types":"dist/trap.d.ts","scripts":{"test":"run-script-os","test:nix":"ts-node node_modules/tape/bin/tape 'test/**/*.ts'","test:win32":"ts-node node_modules/tape/bin/tape test/**/*.ts","test:coverage":"run-script-os","test:coverage:nix":"nyc --reporter=html --require ts-node/register tape 'test/**/*.ts' | tap-arc","test:coverage:win32":"nyc --reporter=html --require ts-node/register tape test/**/*.ts | tap-arc","test:pretty":"run-script-os","test:pretty:nix":"nyc --require ts-node/register tape 'test/**/*.ts' | tap-arc","test:pretty:win32":"nyc --require ts-node/register tape test/**/*.ts | tap-arc","prebuild":"tsc --declarationDir temp --declaration true --emitDeclarationOnly true","build":"rollup -c rollup.config.mjs","postbuild":"rm -rf temp","prepublish":"npm run build"},"repository":{"type":"git","url":"git+https://github.com/konfirm/node-trap.git"},"bugs":{"url":"https://github.com/konfirm/node-trap/issues"},"keywords":["proxy","trap"],"author":{"name":"Rogier Spieker","email":"rogier@konfirm.eu"},"license":"MIT","engines":{"node":">=14"},"devDependencies":{"@rollup/plugin-commonjs":"^24.0.1","@rollup/plugin-node-resolve":"^15.0.1","@rollup/plugin-terser":"^0.4.0","@rollup/plugin-typescript":"^11.0.0","@types/tape":"^4.13.3","nyc":"^15.1.0","rollup":"^3.20.2","rollup-plugin-dts":"^5.3.0","run-script-os":"^1.1.6","tap-arc":"^0.3.5","tape":"^5.6.3","template-literal-each":"^3.0.0","ts-node":"^10.9.1","tslib":"^2.5.0","typescript":"^5.0.2"},"dependencies":{"@konfirm/descriptor":"^1.0.0","@konfirm/guard":"^2.0.1"},"gitHead":"4fec96b63d5d8d165715be875d93b355c6ab9c11","homepage":"https://github.com/konfirm/node-trap#readme","_id":"@konfirm/trap@2.0.2","_nodeVersion":"16.19.1","_npmVersion":"8.19.3","dist":{"integrity":"sha512-8SH6JNpIuq9nCX/+Jw9ttB6ascXHUFHdCYk+9xQZYKPgUM74LAbcrh5+H9CcaeLjnA32gQtxWxDUxa0gafi8Dg==","shasum":"da3471a223692811687f0eccf50ae86adb3b0936","tarball":"https://registry.npmjs.org/@konfirm/trap/-/trap-2.0.2.tgz","fileCount":28,"unpackedSize":166675,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDfnkpuPfc2whKmqTaUDGLYlaTvtVxGUNjWff/MQ6NrAAiEAx+XIsHhLlKYjK+emS1WnXDBoBJJk6bJltgnfxGtX8kQ="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkJC4UACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmokdw//Vo93dnDd9O8Dm2Gw/8juX1B7VxBUVPHtH12juzXN+lMjRBlT\r\nQApipGfjPJQanEupy/rx5vhHgIYmwWDq5R6J3fmv6M0dn6S0ccDDvbaCogt0\r\nYJUsJGNBgSUnozLAUIGtMu+XcEeIMdSpLlei7LsKiWH+7vHNlCuKuCoMqZGu\r\nNG360rwiimv+ndXrXVOQglqCJnldEwbtgW0yve95F1qfMhTSVah35jXFbj1Z\r\ndeDa2bXriAQCR08CJHt3dyU2/oIMCD6lNTObtM+EEmE5uNlsihIItLgIP8A8\r\nLsdRzL407W0ntUaq6e5XOtioAZ8HxHDLPrw6j+Xuhugwgqaqe06rbkwPMmRe\r\ndQ8+xGezgJw1zw7NaxI9CokdwAri3cIJGBkHvsF7VrhzEf3n9dtwqU52BKCB\r\nHYMYi9xqdOTjdic6f9JUr5SSUXIHet5Y1dTbFwT3c/56F8FrZuW0zDDH9mUg\r\nkMMegQJP6ZoHFnzKvBch694D8S6dzWoV7Ah1adsctAO7cPbmPRgbNVDJCDXb\r\nj1+eWJmhLEvDMpXJRQV11CksWyoV6igqXJvqnaznRks/ndCNFycSPcOmGD0w\r\nxKXKkneqHFGoWdQgz1KeMNIfs6Bll1QOOgDgln7Sewax6VmnReTiY4CUkeKm\r\nIP9JMdaRG2WzAowV0k72R19gTLgkKNe1soM=\r\n=sMIQ\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"rogier.spieker","email":"rogier+npm@konfirm.io"},"directories":{},"maintainers":[{"name":"rogier.spieker","email":"rogier+npm@konfirm.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trap_2.0.2_1680092692244_0.2107021994363114"},"_hasShrinkwrap":false},"2.0.3":{"name":"@konfirm/trap","version":"2.0.3","description":"Provide traps for use as Proxy handler, allowing to keep track of changes and choose to commit or rollback changes","iife":"dist/trap.js","main":"dist/trap.cjs.js","module":"dist/trap.es.js","types":"dist/trap.d.ts","scripts":{"test":"run-script-os","test:nix":"ts-node node_modules/tape/bin/tape 'test/**/*.ts'","test:win32":"ts-node node_modules/tape/bin/tape test/**/*.ts","test:coverage":"run-script-os","test:coverage:nix":"nyc --reporter=html --require ts-node/register tape 'test/**/*.ts' | tap-arc","test:coverage:win32":"nyc --reporter=html --require ts-node/register tape test/**/*.ts | tap-arc","test:pretty":"run-script-os","test:pretty:nix":"nyc --require ts-node/register tape 'test/**/*.ts' | tap-arc","test:pretty:win32":"nyc --require ts-node/register tape test/**/*.ts | tap-arc","prebuild":"tsc --declarationDir temp --declaration true --emitDeclarationOnly true","build":"rollup -c rollup.config.mjs","postbuild":"rm -rf temp","prepublish":"npm run build"},"repository":{"type":"git","url":"git+https://github.com/konfirm/node-trap.git"},"bugs":{"url":"https://github.com/konfirm/node-trap/issues"},"keywords":["proxy","trap"],"author":{"name":"Rogier Spieker","email":"rogier@konfirm.eu"},"license":"MIT","engines":{"node":">=14"},"devDependencies":{"@rollup/plugin-commonjs":"^25.0.7","@rollup/plugin-node-resolve":"^15.2.3","@rollup/plugin-terser":"^0.4.4","@rollup/plugin-typescript":"^11.1.5","@types/tape":"^5.6.1","nyc":"^15.1.0","rollup":"^4.1.4","rollup-plugin-dts":"^6.1.0","run-script-os":"^1.1.6","tap-arc":"^1.1.0","tape":"^5.7.1","template-literal-each":"^3.0.1","ts-node":"^10.9.1","tslib":"^2.6.2","typescript":"^5.2.2"},"dependencies":{"@konfirm/descriptor":"^1.1.1","@konfirm/guard":"^2.0.2"},"_id":"@konfirm/trap@2.0.3","gitHead":"36619d86f803dbb9d5d1b734fcdf39f5a645637a","homepage":"https://github.com/konfirm/node-trap#readme","_nodeVersion":"18.18.2","_npmVersion":"9.8.1","dist":{"integrity":"sha512-RTgoE3ngBW7ErWLmF7FeUNSlax5LnhTT+h2kC3YZFP+Iyr4BSPKEm+Z7ytEt24alEmhp4enH1n+9LIYeYBZ7Rg==","shasum":"d8ff9fcf8c4ac79288f6fdb05478c99442819e38","tarball":"https://registry.npmjs.org/@konfirm/trap/-/trap-2.0.3.tgz","fileCount":28,"unpackedSize":168918,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDpbZ+/5djgTvaUx0sISZqavuIx4SnGthWlATBQ4jrI8AiBqq2R4/izwS+IzDMUqrynNvK8rdIM6aGc92KhSAup3Qw=="}]},"_npmUser":{"name":"rogier.spieker","email":"rogier+npm@konfirm.io"},"directories":{},"maintainers":[{"name":"rogier.spieker","email":"rogier+npm@konfirm.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trap_2.0.3_1698231897593_0.30123763512638835"},"_hasShrinkwrap":false}},"readme":"![tests](https://github.com/konfirm/node-trap/actions/workflows/tests.yml/badge.svg)\n![release](https://github.com/konfirm/node-trap/actions/workflows/release.yml/badge.svg)\n\n# Trap Module\n\n\nProvide traps for use as Proxy handler, allowing to keep track of changes and choose to commit or rollback changes\n\n## Installation\n\n```\n$ npm install --save @konfirm/trap\n```\n\n## Usage\nThe Trap module is designed to handle and reflect Proxy manipulations to an object [Proxy](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy), during its handler assignment you can provide a Trap-instance or parts of it.\n\n### Trap all mutations\n```ts\n//  include the Trap module\n// const { Trap } = require('@konfirm/trap');\nimport { Trap } from '@konfirm/trap';\n//  create a trap instance\nconst trap = new Trap();\n//  create the affected object\nconst affect = { foo: 'bar', bar: 'baz' };\n//  create the proxy\nconst proxy = new Proxy(affect, trap);\n\nproxy.foo = 'hello world';\n\nconsole.log(proxy.foo);       //  'hello world'\nconsole.log(affect.foo);      //  'bar'\n\ndelete proxy.bar;\n\nconsole.log('bar' in proxy);   //  false\nconsole.log('bar' in affect);  //  true\n\n//  commit all trapped changes\ntrap.commit();\n\nconsole.log(affect.foo);  //  'hello world'\nconsole.log('bar' in affect);  //  false\n```\n\n\n## API\nTrap keeps track of changes within proxied objects, and exposes two methods besides the implemented [trap functions](https://github.com/konfirm/node-trap#implementedtrapfunctions).\n\n### Exports\n\n| name                  | description                                                                                                                  |\n| --------------------- | ---------------------------------------------------------------------------------------------------------------------------- |\n| `Trap`                | The `Trap` class itself                                                                                                      |\n| `MutationInterface`   | _TypeScript_ interface describing Mutations                                                                                  |\n| `isMutationInterface` | Type Guard validating whether the input is a `MutationInterface`                                                             |\n| `MutationOptions`     | _TypeScript_ type describing the target, key and optional value members of a `MutationInterface`                             |\n| `isMutationOptions`   | Type Guard validating whether the input is `MutationOptions`                                                                 |\n| `DeletionMutation`    | Mutation describing deletion mutations, created by `deleteProperty` (`delete target.key`) operations                         |\n| `PropertyMutation`    | Mutation describing property mutations, created by `defineProperty` (`Object.defineProperty(target, key, {...})`) operations |\n| `ValueMutation`       | Mutation describing value mutations, created by `set` (`target.key = ...`) operations                                        |\n| `AbstractMutation`    | abstract implementation of a Mutation                                                                                        |\n\n### type `MutationOptions`\n\n| property | type                      | required | notes                                                                                                       |\n| -------- | ------------------------- | -------- | ----------------------------------------------------------------------------------------------------------- |\n| `target` | `Object\\|Function\\|Array` | yes      | this can be narrowed down (e.g. only objects of a specific type), but never widened (e.g. not add booleans) |\n| `key`    | `string                   | symbol`  | yes                                                                                                         | this can be narrowed doen (e.g. only strings), but not wideneded (e.g. not add numbers) |\n| `value`  | `any`                     | no       |\n\n### `Trap([trackOnlyLastMutation])`\nThe Trap constructor accepts the `trackOnlyLastMutation` argument (default `false`) indicating whether or not the mutations should be limited to one per property. If `trackOnlyLastMutation` is set to `true` value, any previous change to the trapped object is remove before applying the next value. Should the next value effectively restore the original state, no new mutations is created and the number of mutations is decreased.\n\n### `commit`\nApply collected mutations (optionally filtered by a search parameter) to the target and reset the mutation list.\n\n```ts\ntrap.commit({ target: myTarget }); // applies all collected mutations with target myTarget\ntrap.commit({ key: 'sample' });    // applies all collected mutations for key 'sample'\ntrap.commit();                     // applies all collected mutations\n```\n\n### `rollback`\nDrop mutations (optionally filtered by a search parameter) so these will never be applied to the target.\n\n```ts\ntrap.rollback({ target: myTarget }); // removes all collected mutations with target myTarget\ntrap.rollback({ key: 'sample' });    // removes all collected mutations for key 'sample'\ntrap.rollback();                     // removes all collected mutations\n```\n\n### `count`\nAs v2.0 of `Trap` removed the mutations collection from direct access, the `count` method allows for counting the number of mutations (optionally filtered by a search parameter).\n\n```ts\ntrap.count({ target: myTarget }); // counts all mutations with target myTarget\ntrap.count({ key: 'sample' });    // counts all mutations for key 'sample'\ntrap.count();                     // counts all mutations\n```\n\n### Implemented Trap functions\nTrap provides most of the Proxy handler methods which directly change object properties.\n\n  - [`defineProperty`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/defineProperty); traps `Object.defineProperty` calls\n  - [`deleteProperty`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/deleteProperty); traps property deletion\n  - [`get`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/get); traps property value getting\n  - [`getOwnPropertyDescriptor`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/getOwnPropertyDescriptor); traps `Object.getOwnPropertyDescriptor` calls\n  - [`has`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/has); traps `<key> in <Object>` calls\n  - [`ownKeys`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/ownKeys); traps `Object.keys` calls\n  - [`set`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/set); traps property value setting\n\n\n### Trap functions not implemented\nThe following functions are currently not implemented by the Trap module, if there is a need for them to be added, feel free to submit an issue or create a pull request.\n\n  - [`apply`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/apply); traps method invocations\n  - [`construct`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/construct); traps new instance creation\n  - [`getPrototypeOf`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/getPrototypeOf); traps `Object.getPrototypeOf` calls\n  - [`isExtensible`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/isExtensible); traps `Object.isExtensible` calls\n  - [`preventExtensions`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/preventExtensions); traps `Object.preventExtensions` calls\n  - [`setPrototypeOf`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/setPrototypeOf); traps `Object.setPrototypeOf` calls\n\n\n## Licence\n\nMIT License\n\nCopyright (c) 2017-2023 Rogier Spieker (Konfirm)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","maintainers":[{"name":"rogier.spieker","email":"rogier+npm@konfirm.io"}],"time":{"modified":"2023-10-25T11:04:58.088Z","created":"2017-12-03T15:34:59.555Z","1.0.0":"2017-12-03T15:34:59.555Z","1.0.1":"2017-12-04T17:22:51.955Z","1.1.0":"2017-12-04T17:55:53.473Z","1.1.1":"2017-12-05T05:46:03.514Z","1.1.2":"2017-12-06T12:03:33.756Z","1.1.3":"2017-12-22T17:00:46.417Z","1.2.0":"2018-04-17T21:15:16.156Z","1.2.1":"2018-04-27T06:36:19.875Z","1.2.2":"2018-07-08T09:39:33.163Z","1.2.3":"2019-02-08T21:42:49.389Z","1.2.4":"2019-06-05T05:40:37.581Z","1.2.5":"2019-07-15T20:24:45.509Z","1.2.6":"2019-08-26T20:54:18.599Z","1.2.7":"2020-01-16T05:37:15.140Z","2.0.0-beta.1":"2021-12-02T21:46:45.057Z","2.0.0-beta.2":"2021-12-03T07:33:11.919Z","2.0.0-beta.3":"2021-12-04T00:01:37.900Z","2.0.0-beta.4":"2021-12-04T00:05:49.999Z","2.0.0-beta.5":"2021-12-04T00:08:56.614Z","2.0.0-beta.7":"2021-12-04T12:40:04.054Z","2.0.0":"2023-03-24T07:49:48.774Z","2.0.1":"2023-03-29T11:53:44.615Z","2.0.2":"2023-03-29T12:24:52.461Z","2.0.3":"2023-10-25T11:04:57.894Z"},"keywords":["proxy","trap"],"author":{"name":"Rogier Spieker","email":"rogier@konfirm.eu"},"license":"MIT","readmeFilename":"README.md","homepage":"https://github.com/konfirm/node-trap#readme","repository":{"type":"git","url":"git+https://github.com/konfirm/node-trap.git"},"bugs":{"url":"https://github.com/konfirm/node-trap/issues"}}