{"_id":"n-ary-tree","_rev":"6-1a46c28a8c15ff1639dc756153b9b670","name":"n-ary-tree","dist-tags":{"latest":"0.4.0"},"versions":{"0.1.0":{"name":"n-ary-tree","version":"0.1.0","license":"MIT","author":{"name":"Liu Bowen","email":"asyncmode@outlook.com"},"module":"dist/n-ary-tree.esm.js","main":"dist/index.js","typings":"dist/index.d.ts","engines":{"node":">=10"},"scripts":{"start":"tsdx watch","build":"tsdx build","test":"tsdx test","lint":"tsdx lint","prepare":"tsdx build","size":"size-limit","analyze":"size-limit --why"},"repository":{"type":"git","url":"git+https://github.com/lbwa/n-ary.git"},"keywords":["n-ary","k-ary","m-ary","data-structures","tree"],"bugs":{"url":"https://github.com/lbwa/n-ary/issues"},"homepage":"https://github.com/lbwa/n-ary#readme","publicConfig":{"registry":"https://registry.npmjs.org/"},"devDependencies":{"@size-limit/preset-small-lib":"^4.6.0","husky":"^4.3.0","size-limit":"^4.6.0","tsdx":"^0.14.1","tslib":"^2.0.3","typescript":"^4.0.3"},"dependencies":{},"peerDependencies":{},"husky":{"hooks":{"pre-commit":"tsdx lint"}},"prettier":{"printWidth":80,"semi":false,"singleQuote":true,"trailingComma":"none","endOfLine":"crlf","tabWidth":2,"useTabs":false},"size-limit":[{"path":"dist/n-ary.cjs.production.min.js","limit":"10 KB"},{"path":"dist/n-ary.esm.js","limit":"10 KB"}],"gitHead":"b3a980498648efccd029abacca602f5ef76a5400","description":"<h1 align=\"center\">N ary tree</h1>","_id":"n-ary-tree@0.1.0","_nodeVersion":"14.4.0","_npmVersion":"6.14.5","dist":{"integrity":"sha512-RbvI31xrha68erZAy9TBzE1v62MCItnFxF8NtqWM0tqmnvPBu8/o8g2ceYisVUuPYwmsWub+QVu3s6drRTqyDw==","shasum":"b70babfd9eff005aa716d95c8842dbf340bda794","tarball":"https://registry.npmjs.org/n-ary-tree/-/n-ary-tree-0.1.0.tgz","fileCount":13,"unpackedSize":15237,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfiG/zCRA9TVsSAnZWagAAt+QQAJ9qfHKI2FZprPdZ2/Vd\nDVfbyneiKz7uJb52WtAZkyh5mXP4UzRp1rrydfToly4dD7r2MuZ4o9hTfl/Y\nIUYuzv/68OWnMIFZSBPi+EH9kGgFu0/9bbz9R3SoLKOZ58B/26udYCavPrBf\nUDWmFoL7IHZK/GREjmb7AhTV7PP2/0F5JUT/xSQw9IEaWOIz71nEDDRZPjCJ\n1n0XTpHFMwVVrV+E1TOn4rQojFnkfUwqhtvVytbwrN1YTOZRpL6yBbMgTbuH\n3EA0p9zYUKvlF+HdW8mVWk4s/aFbiMr7kHICIi+tLRZi9U6E+qaXsRTqenNf\n1zzh6X+DKyJmgof3os7CbbS9nk/z8zZJwgLKRUQtWt1/hnWDvfwDkoe4bwGk\nVENAglAcaFr3aDzSgN3VzgdnXbmNwOMGkJFSWmCCVjxXg4WTzb3OzTEWtXWI\nV1Ti7SKn2a0exIAtVeurIL+xD+u8w0zS+vXS4QZBf1PLPVqKJLXThX6sTHsl\nipmx+bD+A37zeQ7MYeXVBBDgxXqUgmAS+qfAdkmyxaw0C2TKhougP/JuweH3\nPfn97xE3M9wOtcFSdcufG3AfBKB8l/C5iQ62KlzUOrxDASqySSLkX1AFEvu+\nmWmu/jFCsMAdOtjGh8laqvDJyF4nYPHeEFFntxKHjE/UAmrNhZ041R1tJ+Hv\ntcLS\r\n=4PY5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFLgrA6OHIkkwbXtjSuYW7IZOmEbToa/JUw+fRl7emWfAiATk8i2kkDpPaaqfUHLXUL6gXieJlTTLprE7j4xG2Nw7Q=="}]},"maintainers":[{"name":"lbwa","email":"mr_lbw@outlook.com"}],"_npmUser":{"name":"lbwa","email":"mr_lbw@outlook.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/n-ary-tree_0.1.0_1602777075476_0.7011420850171945"},"_hasShrinkwrap":false},"0.2.0":{"name":"n-ary-tree","version":"0.2.0","license":"MIT","author":{"name":"Liu Bowen","email":"asyncmode@outlook.com"},"module":"dist/n-ary-tree.esm.js","main":"dist/index.js","typings":"dist/index.d.ts","engines":{"node":">=10"},"scripts":{"start":"tsdx watch","build":"tsdx build","test":"tsdx test","lint":"tsdx lint src --fix","prepare":"tsdx build","size":"size-limit","analyze":"size-limit --why","format":"prettier --write \"**/*.{js,jsx,ts,tsx,json,md}\""},"repository":{"type":"git","url":"git+https://github.com/lbwa/n-ary.git"},"keywords":["n-ary","k-ary","m-ary","data-structures","tree"],"bugs":{"url":"https://github.com/lbwa/n-ary/issues"},"homepage":"https://github.com/lbwa/n-ary#readme","publicConfig":{"registry":"https://registry.npmjs.org/"},"devDependencies":{"@size-limit/preset-small-lib":"^4.6.0","husky":"^4.3.0","lint-staged":"^10.4.2","size-limit":"^4.6.0","tsdx":"^0.14.1","tslib":"^2.0.3","typescript":"^4.0.3"},"dependencies":{"tslang-utils":"^0.1.0"},"peerDependencies":{},"husky":{"hooks":{"pre-commit":"lint-staged","pre-push":"tsdx lint src"}},"lint-staged":{"src/**/*.{js,jsx,ts,tsx,json,md}":["prettier --write"]},"prettier":{"printWidth":80,"semi":false,"singleQuote":true,"trailingComma":"none","endOfLine":"crlf","tabWidth":2,"useTabs":false},"size-limit":[{"path":"dist/n-ary-tree.cjs.production.min.js","limit":"10 KB"},{"path":"dist/n-ary-tree.esm.js","limit":"10 KB"}],"description":"[n-ary tree](https://en.wikipedia.org/wiki/M-ary_tree)(also known as `k-ary` or `k-way` tree) implementation in `JavaScript(TypeScript)`.","licenseText":"MIT License\n\nCopyright (c) 2020 lbwa\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.","_id":"n-ary-tree@0.2.0","dist":{"shasum":"b994686075f87405929eb95ce209da244641c308","integrity":"sha512-OA3LPpjfiZ1jD0oYuXfiQJbHArtgDgeAK2YgUzwbYq2B+kY0qP+ZjXeb3E4V3HGXsAQYsK8UCXQ1FWtMxRGEuA==","tarball":"https://registry.npmjs.org/n-ary-tree/-/n-ary-tree-0.2.0.tgz","fileCount":24,"unpackedSize":40446,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfitGhCRA9TVsSAnZWagAA79oP/3AjZAjIMB/wGKgNG2NH\nG1bfQr/WyW/4jbyhgk5QZGxxoRcTnRFuF+ESLC3OKDaoSN5xaRiVQtoja+Df\nDZ4NzQD5VCo0PHepXsUpg/M0gx6k/Yq+5/RWo0V91/uyLhbRpRy8RvXXrXeG\nIJT212xYPMsFSo/x/rPRVV1n4WxiCk6eI9txB1Vp+RkbZHmB21cA/sVnkkS2\ns5woPOrb6ZZXdPnY6F4RAW/WbgvShTj//ahMQGDb7YP5WWX4fYCe8lceyURO\noNG1VVLPXCvBXwID43ugmclaJyNq9Md8vydLoUy/ZjheXG6bJxWTEh6y1uqh\nJ0ax5B4eRqcf3LmpMgOBDOMHQROnwFY7CCMO2NAdps2v4HitZoPeLAfpz82U\nZHzVjuuHIRaGKss0M/kPINdRPP9b5kjQueRT+RYU6bpRyJ2oO7GpkrDYBMfr\nELl1yG5XxHwPbvJg5gr4vvAP2dzmRWyVPJGODllF39lUv7G/4TQ78MUThPvc\nKXBqtA+n733vO9ELtikuYkDp9g0yg22wIN9IOLuziZnz6MAYqGpC024xKUeT\ncGU9z7u+/OGkT3KrE9WwmsHLoTo97XUGAqNuU5fiMAuOGUP7yiRxbb8EijYc\nWuxPYvjpHZxDhnnIQrPWIBbJIW3J9OZBtzDGznWSMG38zf35WyOUKVazK8ul\nfPbA\r\n=e0KO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAFsYtmgeHvGuZxlMbsFqsAlglMvTZtC1iuEXREGBqAcAiAV9DLSRt4QvpAZw3MxT5oWupeWgjMx0vLZEuU4vH9mVw=="}]},"maintainers":[{"name":"lbwa","email":"mr_lbw@outlook.com"}],"_npmUser":{"name":"lbwa","email":"mr_lbw@outlook.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/n-ary-tree_0.2.0_1602933152824_0.9349036697907549"},"_hasShrinkwrap":false},"0.2.1":{"name":"n-ary-tree","version":"0.2.1","description":"n-ary tree implementation in JavaScript(TypeScript).","license":"MIT","author":{"name":"Liu Bowen","email":"asyncmode@outlook.com"},"module":"dist/n-ary-tree.esm.js","main":"dist/index.js","typings":"dist/index.d.ts","engines":{"node":">=10"},"scripts":{"start":"tsdx watch","build":"tsdx build","test":"tsdx test","lint":"tsdx lint src --fix","prepare":"tsdx build","size":"size-limit","analyze":"size-limit --why","format":"prettier --write \"**/*.{js,jsx,ts,tsx,json,md}\""},"repository":{"type":"git","url":"git+https://github.com/lbwa/n-ary.git"},"keywords":["n-ary","k-ary","m-ary","data-structures","tree","preorder","postorder","levelorder"],"bugs":{"url":"https://github.com/lbwa/n-ary/issues"},"homepage":"https://github.com/lbwa/n-ary#readme","publicConfig":{"registry":"https://registry.npmjs.org/"},"devDependencies":{"@size-limit/preset-small-lib":"^4.6.0","husky":"^4.3.0","lint-staged":"^10.4.2","size-limit":"^4.6.0","tsdx":"^0.14.1","tslib":"^2.0.3","typescript":"^4.0.3"},"dependencies":{"tslang-utils":"^0.1.0"},"peerDependencies":{},"husky":{"hooks":{"pre-commit":"lint-staged","pre-push":"tsdx lint src"}},"lint-staged":{"src/**/*.{js,jsx,ts,tsx,json,md}":["prettier --write"]},"prettier":{"printWidth":80,"semi":false,"singleQuote":true,"trailingComma":"none","endOfLine":"crlf","tabWidth":2,"useTabs":false},"size-limit":[{"path":"dist/n-ary-tree.cjs.production.min.js","limit":"10 KB"},{"path":"dist/n-ary-tree.esm.js","limit":"10 KB"}],"licenseText":"MIT License\n\nCopyright (c) 2020 lbwa\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.","_id":"n-ary-tree@0.2.1","dist":{"shasum":"9c47eb227f9622343d934d2fa6b88e8f4ef0e55d","integrity":"sha512-dvcT5XIDjolkVn7+g4MxFegzn9kZjBaA1Wkx8ETXBNOZ3MeNCf1WS2mS8095ql790cmB72SzlQ7ygkodOORflw==","tarball":"https://registry.npmjs.org/n-ary-tree/-/n-ary-tree-0.2.1.tgz","fileCount":24,"unpackedSize":40788,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfitTKCRA9TVsSAnZWagAAGEwP/i8kZ+xGoN0NUPialUZg\nu+Sl7oaRtbsT98n5panDB7YMFyx/5uXM2fTp6aWQ3DAkmfZvwGps++Jujr8L\nu0+2cqp4heobgM69IIp1+wwhk+5Jgbbo0N9ajlF4IL8NUNqV5o1ofZwN/t6G\nEKtGaQrEal/Y6tutJepsW4jXrHny7xhzq63xk489SM0YrMZUNZmQWB6jmVcD\n/awxY/rAfilh7X1fNI4MBz/r2Pk/NXL0STPSY6+/M7GCfXk/a9tqrSpgDoOD\nBZuHq7hNYl66SWASaEbGAnEhrmwqiNdVCWx5lIIvyL8bmrYOkeunOOvxcTg6\n3YfGmSxqvvzVMPg9cEZjGWu0H2eg8Iu+3J6pwZIWrrfcrxSzNiKAKrAjc7c5\n61k8O+K0QHJLPMFHbOvCDAXb15PIM9SHTYH2FLNmzJA3G5DUr9u59vL6/w9b\nUniEEdenzuMCLRysw0xwOsyl+geyxAefYxyYQVOUfv6iI2Kp1OpbD7pSla0g\ntUK7M6Stky3l2wXgBkohqbeXhyiMVjy1pZvxNvGJcfYgkeL04IERMIDH7wKN\ntAeqkiMRNyDtAYyxBYHWyUFdwfb/zYQQChPZW9XRgxYQThtVIZehfaxb/F8G\n91NKLw4xZKoHgpPqvEd9blyBoHKT7qolwPDCCrj9ib+m9RthepDA65C5gJkf\ny40A\r\n=nbkL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCgTXkhOO6862tl6oYU+CC1jM2FJL1J7pSnjt4FBgQ8iQIhANZBYETPw1T3LWmTCDr/n6do/Ob7ylskJJQP6g3YefBR"}]},"maintainers":[{"name":"lbwa","email":"mr_lbw@outlook.com"}],"_npmUser":{"name":"lbwa","email":"mr_lbw@outlook.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/n-ary-tree_0.2.1_1602933961847_0.7539494936345303"},"_hasShrinkwrap":false},"0.2.2":{"name":"n-ary-tree","version":"0.2.2","description":"n-ary tree implementation in JavaScript(TypeScript).","license":"MIT","author":{"name":"Liu Bowen","email":"asyncmode@outlook.com"},"module":"dist/n-ary-tree.esm.js","main":"dist/index.js","typings":"dist/index.d.ts","engines":{"node":">=10"},"scripts":{"start":"tsdx watch","build":"tsdx build","test":"tsdx test","lint":"tsdx lint src --fix","prepare":"tsdx build","size":"size-limit","analyze":"size-limit --why","format":"prettier --write \"**/*.{js,jsx,ts,tsx,json,md}\""},"repository":{"type":"git","url":"git+https://github.com/lbwa/n-ary.git"},"keywords":["n-ary","k-ary","m-ary","data-structures","tree","preorder","postorder","levelorder"],"bugs":{"url":"https://github.com/lbwa/n-ary/issues"},"homepage":"https://github.com/lbwa/n-ary#readme","publicConfig":{"registry":"https://registry.npmjs.org/"},"devDependencies":{"@size-limit/preset-small-lib":"^4.6.0","husky":"^4.3.0","lint-staged":"^10.4.2","size-limit":"^4.6.0","tsdx":"^0.14.1","tslib":"^2.0.3","typescript":"^4.0.3"},"dependencies":{"tslang-utils":"^0.1.0"},"peerDependencies":{},"husky":{"hooks":{"pre-commit":"lint-staged","pre-push":"tsdx lint src"}},"lint-staged":{"src/**/*.{js,jsx,ts,tsx,json,md}":["prettier --write"]},"prettier":{"printWidth":80,"semi":false,"singleQuote":true,"trailingComma":"none","endOfLine":"crlf","tabWidth":2,"useTabs":false},"size-limit":[{"path":"dist/n-ary-tree.cjs.production.min.js","limit":"10 KB"},{"path":"dist/n-ary-tree.esm.js","limit":"10 KB"}],"licenseText":"MIT License\n\nCopyright (c) 2020 lbwa\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.","_id":"n-ary-tree@0.2.2","dist":{"shasum":"641c096afa230d61252afad6b2de80ea968b47ec","integrity":"sha512-b9uIdamgEU3SYuRScnRRYW0UUQwJJh4csBWwwYQKAZvwZM8hfo+GGO6ShPxFKI+HMrTLyFipxex+i7uvAQMiMw==","tarball":"https://registry.npmjs.org/n-ary-tree/-/n-ary-tree-0.2.2.tgz","fileCount":24,"unpackedSize":40785,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfjbBaCRA9TVsSAnZWagAAFZYP/RrlKJPSFOnwX+kiKYFc\nFU6Fg2ronuY1SUn0kvYXc41zVPWOkqgxFESzI/1TJfZk2H0VL6efhaiSJHr7\n0yu2vmjySlrDJmfs4zKPW0wLRiL/nDqJi6gGDadVU8RIlRatBE+4+hG889Pr\n8vwKfnnBUZVMht9aVrLzf61BiYF+kvB/7a99VAWnSHoGCj5YVmS/b+8dcC3i\n3PcYWsA1PpXh3rkwFd1jWqoSpmSv3R5gtsUVRqz326A8Bb8dYvHFcz6ySg9N\n3XRgcoei59PyfzwlSCir0VBjUeXry9sImSqkjH9xqLEhqNiWAt3TMyW40wOe\nmODeNpjaE6jqx4AOqT02FlI6wQM0Uzcy/OZgQpE9+xYLqq2iBENTfiRY113R\nUZrJ79UwHSxYeqv3f1Fk2m0eAssFSljV7Om2Nqjoo9rxK2rV02+4MkVvO4yf\nGSGSS8xfwkLlSetRrFD5ysVxpu98dLi1zc7wjTGFGLDaFwQqviCsXHz5tsmO\nK32EpgNykikJwjlfHyTlBsWN/r7A/YwM9tFbiDjuSMb/F6snSzWAyqU6vZO1\nhfhGc1zpuERN3XRjC+/HYMTFst8Rzxs9w380lacUkDn48/hYi474kTfWzMov\n4hTg0BDMvwl2GIUOY8Dq4+DwaqhO5QojAkb84JAFFI/F1OjXjsOWYi7qUd6S\ntpJt\r\n=Uf8d\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDWH/2S1ChkxLMuShfPPCoH/YZr4eXE8Tt4Ko08FA5DkgIgJnvzvLUGKW3aFwUtvuLna16TqT1Ke4sv82reIjijkzs="}]},"maintainers":[{"name":"lbwa","email":"mr_lbw@outlook.com"}],"_npmUser":{"name":"lbwa","email":"mr_lbw@outlook.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/n-ary-tree_0.2.2_1603121242407_0.23963377609190184"},"_hasShrinkwrap":false},"0.3.0":{"name":"n-ary-tree","version":"0.3.0","description":"n-ary tree implementation in JavaScript(TypeScript).","license":"MIT","author":{"name":"Liu Bowen","email":"asyncmode@outlook.com"},"module":"dist/n-ary-tree.esm.js","main":"dist/index.js","typings":"dist/index.d.ts","engines":{"node":">=10"},"scripts":{"start":"tsdx watch","build":"tsdx build","test":"tsdx test","lint":"tsdx lint src --fix","prepare":"tsdx build","size":"size-limit","analyze":"size-limit --why","format":"prettier --write \"**/*.{js,jsx,ts,tsx,json,md}\"","preperf":"tsdx build","perf":"node ./perf/index.js"},"repository":{"type":"git","url":"git+https://github.com/lbwa/n-ary.git"},"keywords":["n-ary","k-ary","m-ary","data-structures","tree","preorder","postorder","levelorder"],"bugs":{"url":"https://github.com/lbwa/n-ary/issues"},"homepage":"https://github.com/lbwa/n-ary#readme","publicConfig":{"registry":"https://registry.npmjs.org/"},"devDependencies":{"@size-limit/preset-small-lib":"^4.6.0","benchmark":"^2.1.4","husky":"^4.3.0","lint-staged":"^10.4.2","size-limit":"^4.6.0","tsdx":"^0.14.1","tslib":"^2.0.3","typescript":"^4.0.3"},"dependencies":{"tslang-utils":"^0.1.0"},"peerDependencies":{},"husky":{"hooks":{"pre-commit":"lint-staged","pre-push":"tsdx lint src"}},"lint-staged":{"src/**/*.{js,jsx,ts,tsx,json,md}":["prettier --write"]},"prettier":{"printWidth":80,"semi":false,"singleQuote":true,"trailingComma":"none","endOfLine":"crlf","tabWidth":2,"useTabs":false},"size-limit":[{"path":"dist/n-ary-tree.cjs.production.min.js","limit":"10 KB"},{"path":"dist/n-ary-tree.esm.js","limit":"10 KB"}],"licenseText":"MIT License\n\nCopyright (c) 2020 lbwa\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.","_id":"n-ary-tree@0.3.0","dist":{"shasum":"bd445069e1c8edb883a56276ea877a5e95631825","integrity":"sha512-2UEGrc8p8/Qp9LsPxP+c6Seo6DS932rpkOaVOGXuBeGddBg1Z7/IAUFQx1TDnXb0odEKTl2mX3N5Rc9DgBxMhA==","tarball":"https://registry.npmjs.org/n-ary-tree/-/n-ary-tree-0.3.0.tgz","fileCount":24,"unpackedSize":51085,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfjwrnCRA9TVsSAnZWagAAZQEP/2nGPs5PSgwFl9uXlAJx\niLfkL2QVFqRaJkUinQqn0PHMiDWz447zU+nBiyPyRe8xgVxgaHAQXvM/UlT4\nQPn3f/yPCxZytMFdua5LoC1Fo7WQQHSrt+/Fncwsr3b3d48fguvrzaCSDyip\nKYk1mpD9h4iVcLmEDPw/w018PaNVeFBbk5nVidNu8EP9GbgVad5fiuHryPHq\n16+YY65KjDPl/SDJqBps6LOw2ZOPBkFHichYa7WTh3HlbG4PXfPYlE7BgvbX\ncR4f3v9h28hBIjglD9dQWZ4dbEx2BSoZs2hJLJAl1jyUKqbf1PjrRKX7M5w0\nH1OXatiuhIN7a9oKKfstlsPPSfLi3hjhL5VS1bURwe9Q7dWlDEQSfOqtPU4a\nJuu+HPesbdgLz27geRYFCQtYQbjzaJAPJ/pEX4jvzpSH3ITshfo7sh+JwWG5\nBu4dfWWSHjjJskUx4KxfXDxpRvgyX7AbXraryf18RMFaCpaxBJdhTcmVcXve\nFBQqtO3Gbmd3grm2ikRonJHzSPv9gkVI8MphMCaBN7JahiixDziDQLEkNjkz\n3/UHOfDtkw3qmg5mf9smH406ALGVZgKodnAmfZAoSz7xVAyHkEBg0T4+mMZ8\nmY1HcEq0Bl/bk+uPgzFbB8NA0EDIZaEMMKxuPAAg1ajvmoq/+EtI1VUJo5K1\nQdSL\r\n=2G4B\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDwx4skx7O5hJECw3dakJwtzlJyNf/uzGPH34cxH4S4GQIgaMu8rjQb2+snihdgLi2rc/g/GhOWYB95K5zAnjOGs2c="}]},"maintainers":[{"name":"lbwa","email":"mr_lbw@outlook.com"}],"_npmUser":{"name":"lbwa","email":"mr_lbw@outlook.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/n-ary-tree_0.3.0_1603209958688_0.6311534048351171"},"_hasShrinkwrap":false},"0.4.0":{"name":"n-ary-tree","version":"0.4.0","description":"n-ary tree implementation in JavaScript(TypeScript).","license":"MIT","author":{"name":"Liu Bowen","email":"asyncmode@outlook.com"},"module":"dist/n-ary-tree.esm.js","main":"dist/index.js","typings":"dist/index.d.ts","engines":{"node":">=10"},"scripts":{"start":"tsdx watch","build":"tsdx build","test":"tsdx test","lint":"tsdx lint src --fix","prepare":"tsdx build","size":"size-limit","analyze":"size-limit --why","format":"prettier --write \"**/*.{js,jsx,ts,tsx,json,md}\"","preperf":"tsdx build","perf":"node ./perf/index.js"},"repository":{"type":"git","url":"git+https://github.com/lbwa/n-ary.git"},"keywords":["n-ary","k-ary","m-ary","data-structures","tree","preorder","postorder","levelorder"],"bugs":{"url":"https://github.com/lbwa/n-ary/issues"},"homepage":"https://github.com/lbwa/n-ary#readme","publicConfig":{"registry":"https://registry.npmjs.org/"},"devDependencies":{"@size-limit/preset-small-lib":"^4.6.0","benchmark":"^2.1.4","husky":"^4.3.0","lint-staged":"^10.4.2","size-limit":"^4.6.0","tsdx":"^0.14.1","tslib":"^2.0.3","typescript":"^4.0.3"},"dependencies":{"tslang-utils":"^0.1.0"},"peerDependencies":{},"husky":{"hooks":{"pre-commit":"lint-staged","pre-push":"tsdx lint src"}},"lint-staged":{"src/**/*.{js,jsx,ts,tsx,json,md}":["prettier --write"]},"prettier":{"printWidth":80,"semi":false,"singleQuote":true,"trailingComma":"none","endOfLine":"crlf","tabWidth":2,"useTabs":false},"size-limit":[{"path":"dist/n-ary-tree.cjs.production.min.js","limit":"10 KB"},{"path":"dist/n-ary-tree.esm.js","limit":"10 KB"}],"licenseText":"MIT License\n\nCopyright (c) 2020 lbwa\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.","_id":"n-ary-tree@0.4.0","dist":{"shasum":"6905f7934a05d2ce6dc765cfb3e5a959cf5e38df","integrity":"sha512-RrEPDPma14owpE5/9gQpAky1ahfKWKyuZE8hkRvnArsnqXwW8WgGUf0qf7cd+sC0+njFCjCpy7XO8cv79d2HrQ==","tarball":"https://registry.npmjs.org/n-ary-tree/-/n-ary-tree-0.4.0.tgz","fileCount":24,"unpackedSize":38914,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfr5spCRA9TVsSAnZWagAAAEsQAJmEjDk1LjsRNBvcuIzs\ny/uO8urxNfMfMG3x235KxXtI7Vc2RLRBREbCV6A5xOn7B4bkPoiH2xylAe//\nEx1Eg6+5hDnGOprNH3uNIP3RST6X5nj9OCSWmHBA0+X1qsC1x4IjFVWwDytt\nYbP/9sOpQO9/dXAOAI6ZvJkTeodZrbhHBno6Omb+wuZFWbQ1c6/MsTcgsDEV\nRHMhfcvEaDlb/MJowCW1A1OcbbdLkhNcm8FwlG6YV6EyXRhACQ9ArMdI9nXM\n9jjj7RjTe2qDXWyUX9Jm1VMf64SOjAE0gWXzHh89v/d7Do9ij0fm2O12xAmM\nWXDvGeoSgOeCRS899u6QOf7ZheuI3TiJahWXnCCJE7SmevwZUTSLrLjc4GfY\nCx03J5AFxdeOcNLwphkqzxF6eCFFZ3MJWBRYPr5LuPC+doL0j66itYHC5UGr\n4EkYfMW7sXLg3FAq8ePv2Lh4XGtr7sB/nzc9enHX1O4avpJdqLBd7XrfO1NN\nt/L1UgPLQzZXUSM8QPC48PhkGLxlvEgM6jCU4tBlZv0+M7V9kjh4Ybl6G4uZ\nGOKaajqQi1ETHV90ltkLf0TeVNz18YX5yYCHy9rEGoUr9rp7O2G2WItCxKAN\n03bvU0qlq8ZTpTbyW40MrkwkuCXpHVhRxzZyQNEMHZS4/dq2kULv+KxT8hKb\nj09a\r\n=EM2t\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDomvtTY6RAvZ1w8OwROdpzm46xR84yFFUC4jXtdhtNCgIhANxszpCzCQYn0/ATuVOAaecKKtzpKvu6mEGZtklY5Bd3"}]},"_npmUser":{"name":"lbwa","email":"mr_lbw@outlook.com"},"directories":{},"maintainers":[{"name":"lbwa","email":"mr_lbw@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/n-ary-tree_0.4.0_1605344041372_0.3607471583486701"},"_hasShrinkwrap":false}},"time":{"created":"2020-10-15T15:51:15.475Z","0.1.0":"2020-10-15T15:51:15.568Z","modified":"2022-05-10T08:00:20.524Z","0.2.0":"2020-10-17T11:12:32.970Z","0.2.1":"2020-10-17T11:26:02.004Z","0.2.2":"2020-10-19T15:27:22.573Z","0.3.0":"2020-10-20T16:05:58.839Z","0.4.0":"2020-11-14T08:54:01.523Z"},"maintainers":[{"name":"lbwa","email":"mr_lbw@outlook.com"}],"description":"n-ary tree implementation in JavaScript(TypeScript).","homepage":"https://github.com/lbwa/n-ary#readme","keywords":["n-ary","k-ary","m-ary","data-structures","tree","preorder","postorder","levelorder"],"repository":{"type":"git","url":"git+https://github.com/lbwa/n-ary.git"},"author":{"name":"Liu Bowen","email":"asyncmode@outlook.com"},"bugs":{"url":"https://github.com/lbwa/n-ary/issues"},"license":"MIT","readme":"# N ary tree\n\n[n-ary tree](https://en.wikipedia.org/wiki/M-ary_tree)(also known as `k-ary` or `k-way` tree) implementation in `JavaScript(TypeScript)`.\n\n![Pipeline](https://github.com/lbwa/n-ary/workflows/Pipeline/badge.svg) <img alt=\"npm (tag)\" src=\"https://img.shields.io/npm/v/n-ary-tree/latest?style=flat-square\"> <img alt=\"npm bundle size\" src=\"https://img.shields.io/bundlephobia/minzip/n-ary-tree?style=flat-square\">\n\n<!-- TOC -->\n\n- [N ary tree](#n-ary-tree)\n  - [Installation](#installation)\n  - [Tree node structures](#tree-node-structures)\n    - [Default structure fields](#default-structure-fields)\n    - [Examples](#examples)\n  - [APIs](#apis)\n    - [findNodes](#findnodes)\n    - [findPathNodes](#findpathnodes)\n    - [findPath](#findpath)\n    - [findAllPaths](#findallpaths)\n    - [Traversal](#traversal)\n      - [levelorder](#levelorder)\n      - [preorder](#preorder)\n      - [postorder](#postorder)\n  - [License](#license)\n\n<!-- /TOC -->\n\n## Installation\n\n- Using npm\n\n```bash\n$ npm i n-ary-tree\n```\n\n- Using yarn\n\n```bash\n$ yarn add n-ary-tree\n```\n\n## Tree node structures\n\nUser-defined tree node fields have supported by all available methods. Just keep the last parameter is a structure like:\n\n```ts\ntype TreeNodeFields<N> = Partial<{\n  value: keyof N\n  children: keyof N\n}>\n```\n\n### Default structure fields\n\n```ts\n{\n  value: 'value',\n  children: 'children'\n}\n```\n\nBy default, we will use `value` field as the value of tree node, `children` field as the children of tree node.\n\n### Examples\n\n```ts\n{\n  value: 'val', // or other field string in the tree node\n  children: 'descendants' // or other field string in the tree node\n}\n```\n\n`val` field will be regarded as node actual value, `descendants` field in the tree node will be regraded as node children field.\n\n## APIs\n\n### findNodes\n\nGet all matched nodes.\n\n```ts\nexport function findNodes<N extends Record<string, any>, V = any>(\n  root: N,\n  targets: V[],\n  fields?: TreeNodeFields<N>\n): FindNodesResult<N, V>\n```\n\n```ts\nimport { findNodes } from 'n-ary-tree'\n\ninterface DefaultTreeNode {\n  value: number\n  children?: DefaultTreeNode[]\n}\n\nconst tree: DefaultTreeNode = {\n  value: 1,\n  children: [\n    {\n      value: 11,\n      children: [\n        {\n          value: 111\n        }\n      ]\n    },\n    {\n      value: 12,\n      children: [\n        {\n          value: 121\n        }\n      ]\n    }\n  ]\n}\n\nfindNodes(tree, [111])\n// -> {\n//      nodes: [{ value: 111 }],\n//      values: [111]\n//    }\nfindNodes(tree, [111], { value: 'value', children: 'children' })\n// Equivalent to findNodes(tree, [111]), { value: 'value', children: 'children' }\n// is default preset.\n```\n\n### findPathNodes\n\nGet nodes sequences if tree path exist.\n\n```ts\nimport { findPathNodes } from 'n-ary-tree'\n\nfindPathNodes(tree, [1, 11, 111])\n/**\n * [\n *   { value: 1, children: ... },\n *   { value: 11, children: ... },\n *   { value: 111, children: ...}\n * ]\n */\n\nfindPathNodes(tree, [1, 9])\n/**\n * [\n *   { value: 1, children: ... }\n * ]\n */\n```\n\n### findPath\n\nFind the latest matched path.\n\n```ts\nimport { findPath } from 'n-ary-tree'\n\nfindPath(tree, [121])\n/**\n * [\n *   { value: 1, children: ... },\n *   { value: 12, children: ... },\n *   { value: 121, children: ...}\n * ]\n */\nfindPath(tree, [22]) // []\n```\n\n### findAllPaths\n\nFind all matched paths.\n\n```ts\nimport { findAllPaths } from 'n-ary-tree'\n\nconst tree = {\n  value: 1,\n  children: [\n    {\n      value: 111\n    },\n    {\n      value: 11,\n      children: [\n        {\n          value: 111\n        }\n      ]\n    },\n    {\n      value: 12,\n      children: [\n        {\n          value: 121\n        }\n      ]\n    }\n  ]\n}\n\nfindAllPaths(tree, [111])\n/**\n * [\n *    [\n *      { value: 1, children: ... },\n *      { value: 111, children: ... },\n *    ],\n *    [\n *      { value: 1, children: ... },\n *      { value: 11, children: ... },\n *      { value: 111, children: ...}\n *    ]\n * ]\n */\n```\n\n### Traversal\n\nWe have support 3 kinds of common tree traversal methods: [level-order(BFS)](https://en.wikipedia.org/wiki/Tree_traversal#Breadth-first_search_/_level_order), [pre-order(DFS)](<https://en.wikipedia.org/wiki/Tree_traversal#Pre-order_(NLR)>), [post-order(DFS)](<https://en.wikipedia.org/wiki/Tree_traversal#Post-order_(LRN)>).\n\n#### levelorder\n\n```ts\nconst tree = {\n  val: 1,\n  children: [\n    {\n      val: 2\n    }\n  ]\n}\nlevelorder(tree, { value: 'val' })\n// [[1], [2]]\n```\n\n#### preorder\n\n```ts\nconst tree = {\n  value: 1,\n  descendants: [\n    {\n      value: 2\n    }\n  ]\n}\npreorder(tree, { children: 'descendants' })\n// [1, 2]\n```\n\n#### postorder\n\n```ts\nconst tree = {\n  val: 1,\n  descendants: [\n    {\n      val: 2\n    }\n  ]\n}\npostorder(tree, { value: 'val', children: 'descendants' })\n// [2, 1]\n```\n\n## License\n\n[MIT](./LICENSE) © [Liu Bowen](https://github.com/lbwa)\n","readmeFilename":"README.md"}