{"_id":"@delightfuldocs/ia-tree","_rev":"5-d6e9a236b651322d58ed672431cbb6f9","name":"@delightfuldocs/ia-tree","dist-tags":{"latest":"0.3.0"},"versions":{"1.0.0":{"name":"@delightfuldocs/ia-tree","type":"module","source":"src/index.ts","exports":{"require":"./dist/iatree.cjs","default":"./dist/iatree.modern.js"},"main":"./dist/iatree.cjs","module":"./dist/iatree.module.js","unpkg":"./dist/iatree.umd.js","scripts":{"build":"microbundle --target node","dev":"microbundle --target node watch"},"version":"1.0.0","license":"MIT","dependencies":{"unist-builder":"^3.0.0","unist-util-parents":"^2.0.0","unist-util-visit":"^4.1.0","unist-util-visit-parents":"^5.1.0","zod":"^3.11.6"},"devDependencies":{"@types/unist":"^2.0.6","microbundle":"^0.14.2","ts-node":"^10.4.0","typescript":"^4.5.5"},"publishConfig":{"access":"public"},"description":"<!-- IDEA: Rename to @delightfuldocs/ia? -->","_id":"@delightfuldocs/ia-tree@1.0.0","dist":{"shasum":"c98573fcd8706d34a036a97180d1270154f0ba91","integrity":"sha512-3lH+oUnLoyOou0lUy/sukvJIrFkdVFlQxh35gVcb1RjOCMrsQIGgi90YbYkkR/RwBv0OJ8zwVjk6dBM56iClxQ==","tarball":"https://registry.npmjs.org/@delightfuldocs/ia-tree/-/ia-tree-1.0.0.tgz","fileCount":22,"unpackedSize":58568,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiEvQWACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpQGA//XA9ifwbY5GKbd4vZPx65T+INBrxihXatli67fpogwuls2zq9\r\nqeMH+XwzKI9lyxrcOMwByz4VN7P6KQ/rh0chKBndg17ehc/NGrukMPxsfxz0\r\nFJb6nCvziAU2vm0gqPyQhBn4mC4kRzZn80+2bd5g3pmXH0mvA18U+4qvsLeO\r\nesbZv9GeZ1uhRx00UHIeZy0pJERuEGyDC6wMSnzSbAfjWYvglN3D3Mb9BqkJ\r\nTqeU1v6p9y7hLE6Cj+t34FcRrgfvDv1sB4s38LdM/GUnqxE9Wmgv9Jj7glTf\r\nrQzR3HoElBx4Sz6b7mUDI6/Y4bE+ZRcxfTxLrKf48+zfLQ6ZMCCodiW1ZFry\r\npkYwrXN142Hv+M/+iMFqU6JXTXfQbOkpmRrCdkCRTO5AaL9QnXEqjFVpCAbe\r\no4w2ejDw8Fm6fHJ0Jc757wTR5zEQa73BSe+sm2H8TDuY/Q5iGD+d2xNWR5CI\r\nlxd/0/SQD9d2goUxG63KqVjz2NoHMYLXfChTMz4v0yaBPfufZOBuR1PKHv96\r\n2ZSVQArXihpLtcwBVJEL/nrk+fNYuOCoxkeFqnguEqNu9HoW4BiJfW1jh+v9\r\nCzVOBAmCjs8eyawoNmor7qRK5XiUz7GqTtYKpsJPdF7Mj+eyci5hZg2EPkM1\r\n3oZOzeEiPZNKk0uLkPQBQFcS5PljLFTxw9M=\r\n=whhR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEZNunz7n1LjtoCDL46CpdYXIlrJrmLIQLI9yIvbI1HvAiBsY9sigKtj+1uMgXYHR620//aN39og2E2KLWfTh4Ediw=="}]},"_npmUser":{"name":"delightfuldocs","email":"delightfuldocs@gmail.com"},"directories":{},"maintainers":[{"name":"delightfuldocs","email":"delightfuldocs@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ia-tree_1.0.0_1645409301972_0.06262443502155013"},"_hasShrinkwrap":false},"2.0.0":{"name":"@delightfuldocs/ia-tree","type":"module","source":"src/index.ts","exports":{"require":"./dist/iatree.cjs","default":"./dist/iatree.modern.js"},"main":"./dist/iatree.cjs","module":"./dist/iatree.module.js","unpkg":"./dist/iatree.umd.js","scripts":{"build":"microbundle --target node","dev":"microbundle --target node watch"},"version":"2.0.0","license":"MIT","dependencies":{"unist-builder":"^3.0.0","unist-util-parents":"^2.0.0","unist-util-visit":"^4.1.0","unist-util-visit-parents":"^5.1.0","zod":"^3.11.6"},"devDependencies":{"@types/unist":"^2.0.6","microbundle":"^0.14.2","ts-node":"^10.4.0","typescript":"^4.5.5"},"publishConfig":{"access":"public"},"description":"<!-- IDEA: Rename to @delightfuldocs/ia? -->","_id":"@delightfuldocs/ia-tree@2.0.0","dist":{"shasum":"fbafaba1de64b82c79a9c073c6ff3ccd5ff23e86","integrity":"sha512-RZYpdSQdmKG/EaNSWJb8dh+HN58cwB56YvJS2VLGarjDAfja+CCUGNARsYfnDsk75//LQYUvELZrTFczxFvkJg==","tarball":"https://registry.npmjs.org/@delightfuldocs/ia-tree/-/ia-tree-2.0.0.tgz","fileCount":22,"unpackedSize":58568,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiEvSAACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp2+g//d4WbfSXCIaCrC5C5/jQuKiCKujWLRUi8Jah6EH0ALoDvdYUb\r\npoWdYfn5lVCJ8s2BqPpT8ODEdP7u637kdzC8Q7ZuYXB3UOp9t/PDmMZqnV7j\r\n7fcS8hlZA+G/9YpwvA+u931t0/UMq+eXhVVYWYn9HvSUu/9L26ccoAaldtbm\r\nGiPDdWoIYzH0klyyhDsU0BrUJp3uwdw2jq64LQfoHAFmn+m6CZIzKVvwE1L/\r\nDc4H5OAXjVYcmulGae9Yf6rUI59/ZQYaXROIqQf0KPtseItv9vzO67b3sd1m\r\nKBLISGfWPBWQlRdjpvXEM5jeB4It6i1GfFbZgXKSShn7S0WPsp9wZtpGJ6Sc\r\nJtBPkvTSANP7UZGOjoXNWlr9iRRoWiycxECYdEg8UemcgfST3E79F0BAdT1n\r\nA9ZI/jt2drISExsl6FL+X4d8OpMQE+/SE9GujQpua7O2n0kiamgz4PtcWitY\r\ntTOZngPPrChLcUlKQ6h+i4wz9dv5Xr3FjKch5h0t+qYsuT7T/2/YlDIzQscs\r\nnqU/F2SqustNIlXAbgW/oQtZVNxIT8eKopXK9gfRXrmd7EZY7C8UIHFD4Oxk\r\nJheDkMgcGnGCQRQbOO0p8xxrlTi90jHOuEHIMRp/Tgv5Qxz33XsWTqylQbw0\r\nX+DRq+QEEFQ+m0Rir9ea3NxioJTFuYVCDKk=\r\n=iJEO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDatxM2HIHAOAj2rUQMOcTeOM3XLBkrKMabnwIXG6lwYwIhAJgbB0vaiXhLk8pMGBgirV1X0ZJIhkAvXpOxZJauGlu2"}]},"_npmUser":{"name":"delightfuldocs","email":"delightfuldocs@gmail.com"},"directories":{},"maintainers":[{"name":"delightfuldocs","email":"delightfuldocs@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ia-tree_2.0.0_1645409408443_0.895848006889082"},"_hasShrinkwrap":false},"0.1.0":{"name":"@delightfuldocs/ia-tree","type":"module","source":"src/index.ts","types":"./dist/index.d.ts","exports":{"require":"./dist/iatree.cjs","default":"./dist/iatree.modern.js"},"main":"./dist/iatree.cjs","module":"./dist/iatree.module.js","unpkg":"./dist/iatree.umd.js","scripts":{"build":"microbundle --target node","dev":"microbundle --target node watch"},"version":"0.1.0","license":"MIT","dependencies":{"unist-builder":"^3.0.0","unist-util-parents":"^2.0.0","unist-util-visit":"^4.1.0","unist-util-visit-parents":"^5.1.0","zod":"^3.11.6"},"devDependencies":{"@types/unist":"^2.0.6","microbundle":"^0.14.2","ts-node":"^10.4.0","typescript":"^4.5.5"},"publishConfig":{"access":"public"},"description":"<!-- IDEA: Rename to @delightfuldocs/ia? -->","_id":"@delightfuldocs/ia-tree@0.1.0","dist":{"shasum":"9f64e51bf3da7aeeb031b3bb1b465b8097f76921","integrity":"sha512-EmazckAdEbNcj07veXHV4UOHOVfD+OGobglJzuDMLbXd+JHoBE6udBtTFqr1mRfc1dot+4GHT9l82DHQBUPsow==","tarball":"https://registry.npmjs.org/@delightfuldocs/ia-tree/-/ia-tree-0.1.0.tgz","fileCount":22,"unpackedSize":58600,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiEvWdACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoMbQ//cCWXtmQsbEz2Wu63ig+6C0u8TmRJHlcMpvqCxTb/0UuOrSx0\r\nh2V+4SYcm/rBZpQeOpPIhwDKPRBcF5TT3xqPHdLEjhCwpDi1ZP3+184gMHzl\r\n+csGesdRy5rFSxgrgWthGj2f+YESQI7PqEW9Rz56SA75X3i49Tf6VTN83Z+d\r\nOVZfUkUnRkaxfu5IfZnsiod6vrCpraaEMT5+Kdy8vdqokBuJQWZfCw/susbL\r\n/UZCtLZjBnmFlCLafGeNZnwTtIhUrN0UxFuk0D+ISnMpH8xGGAvndvKq7xxZ\r\nEU8YuFPIQd7yIn+RfZWrKMuGcy+1qPbOSueCCY6AZZYvNxyWFHcYAvqCcZWJ\r\nyAd631zHIi8XMPA3SOxqRl26bzdMKqFIl/ZUieX3d3sH15tdh878ZHpWvIOW\r\njV1kNp7d2ZxxOJ/aAgscJrPPEhiDoNsrVzYdfMjOMw0FUU8tZ0QfyROHKJig\r\nKeOBiYxBNTbQnLvOR4Wel0qHq608JZPD7bA+xW6kQ+Rqat16uDQOErXDzFcx\r\nCyqpI2ZZE80wxyS0bg4s1WM5pVU8hbyu/teXtHqHLw2IUBAfEiUtw6otS4rT\r\nBUBGc7ybvjqELZIcypiTMUNoy2CV2VN1MyPKx4zSgPdYyfPvjnDnDjR4pTbp\r\nT4orLJrsByujqv1umUN0WKYHlJQGuV6HdpQ=\r\n=OyVf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGKIeZh+Rgp3lJRsQw4d92xI2NDZKCYHDEb2TCrkG5w/AiBx0WOifopCQt/5+kr967NpnJZWTldXhpsRjx1r24jvdg=="}]},"_npmUser":{"name":"delightfuldocs","email":"delightfuldocs@gmail.com"},"directories":{},"maintainers":[{"name":"delightfuldocs","email":"delightfuldocs@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ia-tree_0.1.0_1645409693165_0.792917663473637"},"_hasShrinkwrap":false},"0.2.0":{"name":"@delightfuldocs/ia-tree","type":"module","source":"src/index.ts","types":"./dist/index.d.ts","exports":{"require":"./dist/iatree.cjs","default":"./dist/iatree.modern.js"},"main":"./dist/iatree.cjs","module":"./dist/iatree.module.js","unpkg":"./dist/iatree.umd.js","scripts":{"build":"microbundle --target node","dev":"microbundle --target node watch"},"version":"0.2.0","license":"MIT","dependencies":{"unist-builder":"^3.0.0","unist-util-parents":"^2.0.0","unist-util-visit":"^4.1.0","unist-util-visit-parents":"^5.1.0","zod":"^3.11.6"},"devDependencies":{"@types/unist":"^2.0.6","microbundle":"^0.14.2","ts-node":"^10.4.0","typescript":"^4.5.5"},"publishConfig":{"access":"public"},"description":"<!-- IDEA: Rename to @delightfuldocs/ia? -->","_id":"@delightfuldocs/ia-tree@0.2.0","dist":{"shasum":"6a85fc73b8d47641501766a28d697f9f5b809069","integrity":"sha512-a3XOdw/h1PDflykDX0I5TTPWV26SrJhEfFadvOSeKiZ/ORS/LIO3/pCfk91J/EC6laqyjhk0KK5073aPiw47OA==","tarball":"https://registry.npmjs.org/@delightfuldocs/ia-tree/-/ia-tree-0.2.0.tgz","fileCount":22,"unpackedSize":76793,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiEvZfACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpdwg/9Ew4EEUbCEaNNdgbAWqqC5gv43/q2HgjImGjVBfD1ZSrF5J7c\r\n2ry7cLO1ucf8ReCqGefU7FKYkan1lZ4p77RS7haju1Ljk1wFmtZ9iCO6fUIM\r\n84rYyCh1UwDlGjfWQd5Kok6QnuVbkwiBYfQNnQrhdCqrV4EFqwbcQbeyZY3w\r\nQs9s419bEBKpkvQ29B5tSczrpCZReqigte0rlns4XXx+fL6+kG4l2BDRCGSr\r\ntlGwEBDgbUpcVrdQLJuF31FOl9Qoupg3w8rctuAuPboza2HFxzzrIVB3W8mq\r\nTtEhjpEQ9DP04AlWQpO8cap70kbYexC+Qu0is5L0iHVecbQvZqUajcRT7j+g\r\nynriolZmK0FXlpKu0ZnsbKxOLHpihJ3sTAVrTXXhfbzGwQeasN4wdf64D+7Z\r\nczjqOEEwrRr3ttyjrnXKsdIzDdBHQrVKG/2Oh2CO2eHUInBuvDr0gl7VqgoW\r\n+Ul0tR3PwWDblGmJVtvFZAQRfkpFWjl7SIIGu3OaQCmxOn7kWxbSVX4Btu/v\r\nTvCbq+QU8Qpgl16Cp3w2q/fRQ3ZgLltcRqM9BV8ilPD1QOCLu/uXT1fc48xd\r\nM/XUXcsks+3q9krIk0p1oz43wE4+AWcD7nPaU/bG0T1c3AholFWHlQ82pZg+\r\nxvJIdVOkE/E427PESIE7f7DdSfwPo9nHvw8=\r\n=QNrh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDjBblH1/opfVX7BJMVlEiLmVTVCGzrYsm2fU2QhybRcgIgX8kQIQHg3hf/MdV7FgPiAHhuKYjAjV4+eKDSx5RZTUc="}]},"_npmUser":{"name":"delightfuldocs","email":"delightfuldocs@gmail.com"},"directories":{},"maintainers":[{"name":"delightfuldocs","email":"delightfuldocs@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ia-tree_0.2.0_1645409887570_0.36362621455186495"},"_hasShrinkwrap":false},"0.3.0":{"name":"@delightfuldocs/ia-tree","type":"module","source":"src/index.ts","types":"./dist/index.d.ts","exports":{"require":"./dist/iatree.cjs","default":"./dist/iatree.modern.js"},"main":"./dist/iatree.cjs","module":"./dist/iatree.module.js","unpkg":"./dist/iatree.umd.js","scripts":{"build":"microbundle --target node","dev":"microbundle --target node watch"},"version":"0.3.0","license":"MIT","dependencies":{"unist-builder":"^3.0.0","unist-util-parents":"^2.0.0","unist-util-visit":"^4.1.0","unist-util-visit-parents":"^5.1.0","zod":"^3.11.6"},"devDependencies":{"@types/unist":"^2.0.6","microbundle":"^0.14.2","ts-node":"^10.4.0","typescript":"^4.5.5"},"publishConfig":{"access":"public"},"description":"<!-- IDEA: Rename to @delightfuldocs/ia? -->","_id":"@delightfuldocs/ia-tree@0.3.0","dist":{"shasum":"50adec2874294bc9c5ae92f5fdd5a61e782f431a","integrity":"sha512-nGReK6jzaLCOBQ1ezeXV90hF42e1B24TtgFwz33MBMAqaT/6ebORZmDeNkY/PQEluJZBhQYRvRMJhOvOP7ZlBA==","tarball":"https://registry.npmjs.org/@delightfuldocs/ia-tree/-/ia-tree-0.3.0.tgz","fileCount":22,"unpackedSize":78574,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiEwQ7ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpIQw//TpraIP3h7G7QU0y8W2cPA/0uLKPMnoPi+oHgWqaoMKTHaDeb\r\n7HE8isvmMnlQr/h0jpP9upBWw/Tz/Vr7l4ggqBSS3XgLYtMC3/zfKLeHjTlq\r\n0xg9zygZvXVEfKVUeNoqVrgiaLTAqR5myRuOqIWM3eZRbxRMauFGST8291r+\r\neH9X8yoAIduulpqa8UKpBEvwg1TtSzcviPJdLYK+EYeWPH96CjG5rDJmh2/Q\r\nt3brtnMEBJjXJSM/d26h/C0sg52qUoyqHanztXeq8sQfwOjjXnUQ8e5ershC\r\nsJQPB4iZoeZvJcCg18PCfCl07p4fECebhvStoZS6c83D/JhhaIGjWNBTH22a\r\nMdpo3UgscYSC7kuauGpCLmMLNNYECd/CBRWlMYoIy8ILjd/3wXMFNSgsaHm0\r\nLfb0diZ4+2kGzbkBbo4OYlGqZ4PDz19nBNgE8uqiuAt6r6rTfJSnBe0BjgpR\r\n9VMYHMSODAvqrAxinEr+In9hbGceeaFhrB/e/X/V1WmWIbLGwpDeag5Veb66\r\n9wAyRmAuAEfRsr2hw+ud8x8vFN/Wk3uvXxhaVbU2i2Vq1hlbzYqXC+glw6JH\r\nq6hzYjlhu0mtrhkOCiD2Ebz9p7phZnwMkF7csq6pqGwIX2sXUtAVuDDnFMs8\r\n/K4T8uhow2bQV5EbtmMJl1OS5aPq5Up9I/w=\r\n=xiuu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD86VhcNda8q0DhLpSlJlWuK2NVjabTUbxxjrzmMZvVgwIhANZQso/FwbyRmCljedBcuYkTQiiRuPk8w/mPc07Gg1EU"}]},"_npmUser":{"name":"delightfuldocs","email":"delightfuldocs@gmail.com"},"directories":{},"maintainers":[{"name":"delightfuldocs","email":"delightfuldocs@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ia-tree_0.3.0_1645413435395_0.17127528346472487"},"_hasShrinkwrap":false}},"time":{"created":"2022-02-21T02:08:21.917Z","1.0.0":"2022-02-21T02:08:22.152Z","modified":"2022-04-05T03:40:47.938Z","2.0.0":"2022-02-21T02:10:08.606Z","0.1.0":"2022-02-21T02:14:53.355Z","0.2.0":"2022-02-21T02:18:07.711Z","0.3.0":"2022-02-21T03:17:15.634Z"},"maintainers":[{"name":"delightfuldocs","email":"delightfuldocs@gmail.com"}],"description":"<!-- IDEA: Rename to @delightfuldocs/ia? -->","license":"MIT","readme":"# ia-tree\n\n<!-- IDEA: Rename to @delightfuldocs/ia? -->\n\n`ia-tree` is a specification for representing the information architecture of a website as an abstract syntax tree. It implements the [unist](#) spec.\n\n## Motivation\n\nI've seen a lot of projects come up with data structures for representing the structure of websites and then creating components and utilities to work with those structures.\n\n<!-- TODO: Share some examples (e.g. Tailwind, etc) -->\n\nIt's a lot of redundant work!\n\nIf a standard data structure can represent the structure of any website, a common set of components and utilities can be used to render and manipulate that structure.\n\nFor example, I should be able to pass the same data into different React components — say, a `Sidebar` component and a `Breadcrumbs` component — and have both render with sensible defaults.\n\n![](assets/diagram.png)\n\n<!-- TODO: Move ia-tree-builder into separate package -->\n<!-- TODO: ia-tree-navigation-utils -->\n<!-- TODO: Move type guards into `ia-tree-node-is` package -->\n\n## Install\n\n```bash\nnpm install @delightfuldocs/ia-tree\n# yarn add @delightfuldocs/ia-tree\n```\n\n## Usage\n\n1. Import the package:\n\n   ```typescript\n   // ESM\n   import { root, group, page } from \"@delightfuldocs/ia-tree\";\n\n   // CJS\n   const { root, group, page } = require(\"@delightfuldocs/ia-tree\");\n   ```\n\n2. Create a tree:\n\n   ```typescript\n   const tree = root([\n     group(\"Getting started\", [\n       page(\"overview\", \"Overview\"),\n       page(\"quick-start\", \"Quick start\"),\n       page(\"changelog\", \"Changelog\"),\n     ]),\n   ]);\n   ```\n\n3. Use [unist utilities](#) to interact with the tree:\n\n   ```typescript\n   import { root, group, page } from \"@delightfuldocs/ia-tree\";\n   import { visit } from \"unist-util-visit\";\n\n   const tree = root([\n     group(\"Getting started\", [\n       page(\"overview\", \"Overview\"),\n       page(\"quick-start\", \"Quick start\"),\n       page(\"changelog\", \"Changelog\"),\n     ]),\n   ]);\n\n   visit(tree, (node) => {\n     console.log(node);\n   });\n   ```\n\n## API reference\n\n### Builders\n\nHelper functions for creating a valid tree.\n\n#### `group(label: string, children: Child[]) => Group`\n\nCreates a `Group` node.\n\n##### Parameters\n\n- `label` - A human readable label for the group.\n- `children` - The nodes that exist within the group.\n\n##### Returns\n\n`Group`\n\n#### `root(children: Child[]) => Root`\n\nCreates a `Root` node.\n\n### Type guards\n\nFunctions for checking if something is a node (or a certain type of node). These are particularly useful if you're using unist utilities, such as `unist-util-visit` to navigate a tree and only want to manipulate certain nodes.\n\n#### `isChild(data: any) => boolean`\n\nReturns `true` if `data` is a `Child` node.\n\n#### `isGroup(data: any) => boolean`\n\nReturns `true` if `data` is a `Group` node.\n\n### Types\n\nThe type definitions of the nodes that can exist within a tree.\n\n#### `Child`\n\n```typescript\ntype Child = Group | Link | Page | Section;\n```\n\nRepresents any node that can be a child of a `Parent` node. The only node that can't be a child is the `Root` node.\n\n#### `Group`\n\n```typescript\ntype Group = {\n  type: \"group\";\n  label: string;\n  children: Child[];\n};\n```\n\nRepresents a group of nodes. The `Group` node itself is _not_ associated with a web page. It's simply a collection of nodes assigned a label.\n\nFor example, in the Stripe documentation, sidebar labels like _Online payments_, _Invoicing_, _Get started_, and _Working with invoices_ are equivalent to groups:\n\n![](assets/stripe-groups.png)\n\n#### `Link`\n\n```typescript\ntype Link = {\n  type: \"link\";\n  url: string;\n  label: string;\n};\n```\n\nRepresents a link to an external web page.\n\n#### `Page`\n\n```typescript\ntype Page = {\n  type: \"page\";\n  id: string;\n  label: string;\n  children?: Child[];\n};\n```\n\nRepresents a page of content that exists within the information architecture. The page can optionally have sub-pages via the `children` property.\n\n#### `Parent`\n\n```typescript\ntype Parent = Group | Page | Root | Section;\n```\n\nRepresents any node that can have children. The only nodes that can't have children are `Link` nodes. It's not required for `Page` nodes to have children.\n\n#### `Root`\n\n```typescript\ntype Root = {\n  type: \"root\";\n  children: Child[];\n};\n```\n\nRepresents the root node of an information architecture. It can only be used at the root node of a tree. All other nodes can be a descendant of a `Root` node.\n\n#### `Section`\n\n```typescript\ntype Section = {\n  type: \"section\";\n  id: string;\n  label: string;\n  children: Child[];\n};\n```\n\nRepresents a distinct section within an information architecture. The `Section` node itself _is_ associated with a page in the information architecture.\n\nWhen users view a section's page, or a page that exists within a section, the intent is for the primary navigation to only contain pages belonging to that section.\n\nFor example, in Stripe's documentation, the _Payments_ or _Business operations_ pages each have their own sidebars. These could be represented as sections.\n\n## Utilities\n\n- `ia-tree-get-breadcrumbs`\n- `ia-tree-get-section`\n","readmeFilename":"README.md"}