{"_id":"zip-text-nodes","_rev":"5-f49eb8d05120de75f4f38577ca8c5273","name":"zip-text-nodes","dist-tags":{"next":"1.0.0-1","latest":"1.0.0"},"versions":{"1.0.0-0":{"name":"zip-text-nodes","description":"Merge the DOM of 2 elements with the same textContent","version":"1.0.0-0","repository":{"type":"git","url":"git+https://github.com/bfred-it/zip-text-nodes.git"},"license":"MIT","keywords":["merge","dom","assign","element","textnode","browser"],"devDependencies":{"@babel/core":"^7.4.5","@babel/plugin-transform-react-jsx":"^7.3.0","@sindresorhus/tsconfig":"^0.3.0","@typescript-eslint/eslint-plugin":"^1.9.0","ava":"^1.4.1","babelify":"^10.0.0","browserify":"^16.2.3","dom-chef":"^3.6.0","eslint-config-xo-typescript":"^0.12.0","npm-run-all":"^4.1.5","tape":"^4.10.1","tape-run":"^6.0.0","typescript":"^3.4.5","xo":"*"},"scripts":{"test":"npm-run-all --silent prepare --parallel test:*","test:lint":"xo","test:blink":"browserify -t [ babelify --plugins [ @babel/plugin-transform-react-jsx ] ] test.js | tape-run","test:gecko":"if [ $CI ]; then browserify test.js | tape-run --browser firefox; fi","prepare":"tsc","build":"tsc","watch":"tsc --watch"},"xo":{"extensions":["ts"],"envs":["browser"],"rules":{"no-unused-vars":["error",{"varsIgnorePattern":"^React$"}]},"overrides":[{"files":"**/*.ts","extends":"xo-typescript"}]},"gitHead":"1ed61eb5f5ea2ff1826b3f6623af5edbd14de8f7","bugs":{"url":"https://github.com/bfred-it/zip-text-nodes/issues"},"homepage":"https://github.com/bfred-it/zip-text-nodes#readme","_id":"zip-text-nodes@1.0.0-0","_nodeVersion":"11.6.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-O6nVq2IAu7mB4rQLIYi4268UEpWlN10Vo/zMRllnOwoF3wJCh4Do5v+N9Vr5J6fTowPx4Rt5Ult/Z9PB2MRv6Q==","shasum":"1e97c1017b4881250a8580b2bce44c261796e2df","tarball":"https://registry.npmjs.org/zip-text-nodes/-/zip-text-nodes-1.0.0-0.tgz","fileCount":5,"unpackedSize":6861,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc5s39CRA9TVsSAnZWagAAEQEP/AjvH3rN3Xnpjj83H1fJ\nNgQSDeF3kZzyvvWGQR5tT/YnuVnst9QgrxQFFoICeWPs/AhXeqOD9MEWZZ8V\n02UoVkMMOzx1cl0KNMnQJ9Q8orfYJljTLiusQRogsOupTxxwvzdEgLw8fJIP\nExHL2/ScckFbZyDWkPU1gqSLVl+uDKbqocSA5VkFgpayTsXSlEamgWN+bsyA\nlV+DDgyduH7/rPQBKSIEOYZsRccbH1yDwxiqoVtzPTbKwA3JO6fUHVdW8e85\nu9Y+wqbEXfDSCaPr/G5oFetqV3GQYWWH5AX6wkwuL5mmjMZFWZHHOHdHhich\n0UHR03qPbzgnbzESgL21gDL9mqxZJH4gehiIcrmwWllq62YW4l8GKFNZwl68\np+W0kPrZnIguii/sG2YR5nFIGPmJ+eqCn1uwTdLhIVkxlnyHeZ1+Ohb/YF1Q\nFiOtjc9vjKM4WBiApRDZRXy8JE/wKZeevABLpMfZyj2uCR3nv6fCLSPeU9yj\nTFRG/MDUsyQzYCYWOvU4uDFW8E8a9RkBArlunve7jwbrwKJawd3n7TwKpcYM\nX++5VwEzH1WVJKOuh1YkK3SpPol3HSQ6K0mdtlLG7bkohSPw/LIPCLSGZS8m\nSlJ17gVGz8MBe1x8twe+7dSDmiY0O79OYKFt5Ucx9wwvjFoU8rk57SteYZet\nSM4i\r\n=MiPn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAa9Fw4R9nb+gVrv46uFJ5UXQ2DIMs86sNDTF/1v/9DhAiBAitlExFuu8JRYyDsVA+dd/EZAtXURWGoJrEVEEIncJw=="}]},"maintainers":[{"name":"bfred-it","email":"npm@bfred.it"}],"_npmUser":{"name":"bfred-it","email":"npm@bfred.it"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/zip-text-nodes_1.0.0-0_1558629885209_0.3106245729614734"},"_hasShrinkwrap":false},"1.0.0-1":{"name":"zip-text-nodes","description":"Merge the DOM of 2 elements with the same textContent","version":"1.0.0-1","repository":{"type":"git","url":"git+https://github.com/bfred-it/zip-text-nodes.git"},"license":"MIT","keywords":["merge","dom","assign","element","textnode","browser"],"devDependencies":{"@babel/core":"^7.4.5","@babel/plugin-transform-react-jsx":"^7.3.0","@sindresorhus/tsconfig":"^0.3.0","@typescript-eslint/eslint-plugin":"^1.9.0","ava":"^1.4.1","babelify":"^10.0.0","browserify":"^16.2.3","dom-chef":"^3.6.0","eslint-config-xo-typescript":"^0.12.0","npm-run-all":"^4.1.5","tape":"^4.10.1","tape-run":"^6.0.0","typescript":"^3.4.5","xo":"*"},"scripts":{"test":"npm-run-all --silent prepare build-test --parallel test:*","test:lint":"xo","build-test":"browserify -t [ babelify --plugins [ @babel/plugin-transform-react-jsx ] ] test.js > .test.js","test:blink":"cat .test.js | tape-run","test:gecko":"if [ $CI ]; then cat .test.js | tape-run --browser firefox; fi","prepare":"tsc","build":"tsc","watch":"tsc --watch"},"xo":{"extensions":["ts"],"envs":["browser"],"rules":{"no-unused-vars":["error",{"varsIgnorePattern":"^React$"}]},"overrides":[{"files":"**/*.ts","extends":"xo-typescript"}]},"readme":"# zip-text-nodes [![Build Status](https://api.travis-ci.com/bfred-it/zip-text-nodes.svg?branch=master)](https://travis-ci.com/bfred-it/zip-text-nodes)\n\n> Merge the DOM of 2 elements with the same textContent.\n\nGiven 2 elements:\n\n```html\nHello, <strong>world!</strong>\n```\n\nand:\n\n```html\n<em>Hello</em>, world!\n```\n\nthey are merged into:\n\n```html\n<em>Hello</em>, <strong>world!</strong>\n```\n\nThis can be useful when running some transformations on the content of an element and successively merging the results or restoring the original markup.\n\n```js\nconst base = <>I live in <a href=\"it\">Italy</a></>;\nconst grammar = highlightVerb(base);\n// <>I <em>live</em> in Italy</> // e.g. the link was lost\n\nzipTextNodes(base, grammar);\n// <>I <em>live</em> in <a href=\"it\">Italy</a></>\n// The new `em` is copied from `grammar` to `base`\n```\n\nSupports overlapping and nested elements.\n\n\n## Install\n\n```\nnpm install zip-text-nodes\n```\n\n\n## Setup\n\n```js\nconst zipTextNodes = require('zip-text-nodes');\n```\n\n```js\nimport zipTextNodes from 'zip-text-nodes';\n```\n\n\n## API\n\n### zipTextNodes(target, source)\n\n#### target\n\nType: `Element` `DocumentFragment`\n\nThe element into which the new children are copied. This element is modified.\n\n#### source\n\nType: `Element` `DocumentFragment`\n\nThe element from which the new children are copied.\n\n# Related\n\n- [insert-text-textarea](https://github.com/bfred-it/insert-text-textarea) - Insert text in a textarea (supports Firefox and Undo).\n- [fit-textarea](https://github.com/bfred-it/fit-textarea) - Automatically expand a `<textarea>` to fit its content, in a few bytes.\n- [delegate-it](https://github.com/bfred-it/delegate-it) - DOM event delegation, in <1KB.\n","readmeFilename":"readme.md","gitHead":"60e2a5bfd0278d5529afaffc28ae7b60de7cab23","bugs":{"url":"https://github.com/bfred-it/zip-text-nodes/issues"},"homepage":"https://github.com/bfred-it/zip-text-nodes#readme","_id":"zip-text-nodes@1.0.0-1","_nodeVersion":"11.6.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-tXNpmVHaRhRwT3vxRGwOsSi7B008rZAo1TbSu84oKTNC1UbBmDwnuE6PiWXd131ULt85mADIcuclX+Lv+5e/VQ==","shasum":"5d5862ffddf4632aee958906f7a24cba7292a8f1","tarball":"https://registry.npmjs.org/zip-text-nodes/-/zip-text-nodes-1.0.0-1.tgz","fileCount":5,"unpackedSize":6750,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc5uKfCRA9TVsSAnZWagAAwTwP/A0TvhsCKSBiWG9J5Xst\nFv80un0sPTFwlW9zuwQRxa1unRxbjIWSsTa7Awkj3ug/vU10ESST51uobtVO\nkHwhUxi+NZC8xK6fZasv1DZdDgDORjQJ4xg32Y1GlOMkgs7Ki+lM0Zp9C3Jo\n2PGy5GRzE/pwNJ35N3hGW/QaF1z9hUAJ6QsxXxqa7TveIeEbr2oAYULrUnhm\nlGUcyXx5HIM5+qanQ9x3BvSoYPnLtWTiJONUCQvLlVo9+RIuNEgOoAAu2uzW\nz6tWalyz5EFaN0i2f/EfVb4mwAdlziYfMM2wZTgv8p71X54eC8N6h60fsYPy\njxfsryHe4AkiZRrLZdoX7/zB4WabnKd+syRgqbg2R2OpAfw+eogOfAywo4fJ\nE3a8HhGwte0JKclleDAVdhXZmS1oE49FEb88BmixxTY5Xu0nW9lO+EWOAN5R\n+3XTIsynHsj+Nzh4JRSWQakfQ4iUsK3sh40WH9/n5fOnYwWmbdwGNwFO1hFU\n843O5tuMQ3FYw03WPkTmJrNWGwPucqID14yYciIImNSK8J0sKhtbG1T2Kswq\nktxW7rJEEBFYieOlM9oLCku+LfjY4ExIA5VfTotEy2gYCmiwYvyN+ZfDd5j7\njqi4RMSbTNGGiqaylhF/AE/mvL0v/sf7hv/kNEH3pzCYh3jV1P0v762mVbqH\nIdo/\r\n=+GOw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC2usSqF5xLSTv2XWIcg1QKgIuXH/45msdzZtTqOgVu+QIhAOU8F+7fuRPGOB6Jh2qGQ3JbN5faupIpsY7dxbQ+V3SS"}]},"maintainers":[{"name":"bfred-it","email":"npm@bfred.it"}],"_npmUser":{"name":"bfred-it","email":"npm@bfred.it"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/zip-text-nodes_1.0.0-1_1558635166486_0.6388448238168145"},"_hasShrinkwrap":false},"1.0.0":{"name":"zip-text-nodes","version":"1.0.0","description":"Merge the DOM of 2 elements with the same textContent","keywords":["assign","browser","dom","element","merge","textnode"],"repository":{"type":"git","url":"git+https://github.com/fregante/zip-text-nodes.git"},"license":"MIT","scripts":{"build":"tsc","build-test":"browserify -t [ babelify --plugins [ @babel/plugin-transform-react-jsx ] ] test.js > .test.js","prepare":"tsc","test":"npm-run-all --silent prepare build-test --parallel test:*","test:blink":"cat .test.js | tape-run","test:gecko":"if [ $CI ]; then cat .test.js | tape-run --browser firefox; fi","test:lint":"xo","watch":"tsc --watch"},"xo":{"envs":["browser"],"extensions":["ts"],"overrides":[{"files":"**/*.ts","extends":"xo-typescript"}],"rules":{"no-unused-vars":["error",{"varsIgnorePattern":"^React$"}]}},"devDependencies":{"@babel/core":"^7.4.5","@babel/plugin-transform-react-jsx":"^7.3.0","@sindresorhus/tsconfig":"^0.3.0","@typescript-eslint/eslint-plugin":"^1.9.0","@typescript-eslint/parser":"^1.13.0","ava":"^1.4.1","babelify":"^10.0.0","browserify":"^16.2.3","dom-chef":"^3.6.0","eslint-config-xo-typescript":"^0.12.0","npm-run-all":"^4.1.5","tape":"^4.10.1","tape-run":"^6.0.0","typescript":"^3.4.5","xo":"*"},"gitHead":"1f8a193ae0e00f7940586a4fc9d8d4b9908042b3","bugs":{"url":"https://github.com/fregante/zip-text-nodes/issues"},"homepage":"https://github.com/fregante/zip-text-nodes#readme","_id":"zip-text-nodes@1.0.0","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-WSYwaIrslDHXBL4XdsBtRob/rG+xWbRydYFlZY7zOohptkmySklLGnFiHmzJQG3elnnKnLT5T+Uf/ePA09QtaQ==","shasum":"f58d1f2b7f319dfde765e1b8773f2184d337cac6","tarball":"https://registry.npmjs.org/zip-text-nodes/-/zip-text-nodes-1.0.0.tgz","fileCount":5,"unpackedSize":6787,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdTDHFCRA9TVsSAnZWagAAtIMP/A7TxkEmE4P2uBK/SkBn\nd+bWgQJ+STBTIvN+IvGqLqBuwxZKLJfy8D3ozth3qNjckdkRLnRZtUuUNePp\nEhvi5TP0yuQtdemhvjRu1Bx0Wav/s8Uu6hyb+/80hs18bURY1iAj8vovMdl4\nt9lpTLey//DYu9v7ZVb00CUnJXjzHR6pJGiwb7qIZHpziwD7JDN13H8zAjyH\npBuJQyjvq9Aw8Z6+vmyxLpv7AXk9Sh77zVmmGHS97eyF6Az+/7bxGArsW3FA\nkauJHiCuGyyLqOr/8GcTZAPhGJxIgjUDVUR+Nuk30mKM/NAimt45UXPjmn0d\nJoUc8oK+yAtz/ZH5bYaCE6EEpS0xClt8fFH+NevXpDtHNP7PBEgLSwblY0Pr\njaf5NVR8N9KKFRIVnJknY7jrmozFnDUaCMhNtvP/tNjG5b9PeFUahG4K02UV\n986FBwQ/XCNnmOg889/fxpM6CLB4O3uXsgfu7v7RfCpjf1sTWkDQtAB0oDfY\nriz/RJS1mE/O4HP94KMcXxG4Ws8IsXqMsXfhB7zdCB5VujfzOdA/Q1OUZqJS\nqgMzMPIL8tWVVsc2/tqPHZ4RvoX5EtLoK8emzd64G+HbK1kAFnkjaYdh5KDw\nzWYIzx4IzCgsKhvRX3nlDUPeoFjYIlJAr0zn6v32gM9/yw2ezRD+W0c2nrVq\nAPdd\r\n=w7BT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGAwbVAOaR9YPQBxD3IjUK6PdPkXztX/zsknkikHuc8IAiAltUqf/RRK2/rBEqnwnShtmAoFfgzVgxEbntKXCdMrZQ=="}]},"maintainers":[{"name":"bfred-it","email":"npm@bfred.it"}],"_npmUser":{"name":"bfred-it","email":"npm@bfred.it"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/zip-text-nodes_1.0.0_1565274565080_0.6852086667708106"},"_hasShrinkwrap":false}},"time":{"created":"2019-05-23T16:44:45.209Z","1.0.0-0":"2019-05-23T16:44:45.317Z","modified":"2022-05-25T14:23:58.219Z","1.0.0-1":"2019-05-23T18:12:46.645Z","1.0.0":"2019-08-08T14:29:25.191Z"},"maintainers":[{"email":"opensource@bfred.it","name":"fregante"}],"description":"Merge the DOM of 2 elements with the same textContent","homepage":"https://github.com/fregante/zip-text-nodes#readme","keywords":["assign","browser","dom","element","merge","textnode"],"repository":{"type":"git","url":"git+https://github.com/fregante/zip-text-nodes.git"},"bugs":{"url":"https://github.com/fregante/zip-text-nodes/issues"},"license":"MIT","readme":"# zip-text-nodes [![Build Status](https://api.travis-ci.com/fregante/zip-text-nodes.svg?branch=master)](https://travis-ci.com/fregante/zip-text-nodes)\n\n> Merge the DOM of 2 elements with the same textContent.\n\nGiven 2 elements:\n\n```html\nHello, <strong>world!</strong>\n```\n\nand:\n\n```html\n<em>Hello</em>, world!\n```\n\nthey are merged into:\n\n```html\n<em>Hello</em>, <strong>world!</strong>\n```\n\nThis can be useful when running some transformations on the content of an element and successively merging the results or restoring the original markup.\n\n```js\nconst base = <>I live in <a href=\"it\">Italy</a></>;\nconst grammar = highlightVerb(base);\n// <>I <em>live</em> in Italy</> // e.g. the link was lost\n\nzipTextNodes(base, grammar);\n// <>I <em>live</em> in <a href=\"it\">Italy</a></>\n// The new `em` is copied from `grammar` to `base`\n```\n\nSupports overlapping and nested elements.\n\n\n## Install\n\n```\nnpm install zip-text-nodes\n```\n\n\n## Setup\n\n```js\nconst zipTextNodes = require('zip-text-nodes');\n```\n\n```js\nimport zipTextNodes from 'zip-text-nodes';\n```\n\n\n## API\n\n### zipTextNodes(target, source)\n\n#### target\n\nType: `Element` `DocumentFragment`\n\nThe element into which the new children are copied. This element is modified.\n\n#### source\n\nType: `Element` `DocumentFragment`\n\nThe element from which the new children are copied.\n\n# Related\n\n- [insert-text-textarea](https://github.com/fregante/insert-text-textarea) - Insert text in a textarea (supports Firefox and Undo).\n- [fit-textarea](https://github.com/fregante/fit-textarea) - Automatically expand a `<textarea>` to fit its content, in a few bytes.\n- [delegate-it](https://github.com/fregante/delegate-it) - DOM event delegation, in <1KB.\n","readmeFilename":"readme.md"}