v1.21.3 published

This commit is contained in:
Revone 2023-09-12 11:37:36 +08:00
parent 773c970667
commit 199a916d50
4 changed files with 122 additions and 200 deletions

209
package-lock.json generated
View file

@ -1,44 +1,41 @@
{
"name": "data-structure-typed",
"version": "1.21.2",
"version": "1.21.3",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "data-structure-typed",
"version": "1.21.2",
"version": "1.21.3",
"license": "MIT",
"dependencies": {
"zod": "^3.22.2"
},
"devDependencies": {
"@types/jest": "^29.5.3",
"@types/node": "^20.4.9",
"avl-tree-typed": "^1.21.2",
"binary-tree-typed": "^1.21.2",
"bst-typed": "^1.21.2",
"avl-tree-typed": "^1.21.3",
"binary-tree-typed": "^1.21.3",
"bst-typed": "^1.21.3",
"dependency-cruiser": "^13.1.2",
"deque-typed": "^1.21.2",
"directed-graph-typed": "^1.21.2",
"doubly-linked-list-typed": "^1.21.2",
"graph-typed": "^1.21.2",
"heap-typed": "^1.21.2",
"deque-typed": "^1.21.3",
"directed-graph-typed": "^1.21.3",
"doubly-linked-list-typed": "^1.21.3",
"graph-typed": "^1.21.3",
"heap-typed": "^1.21.3",
"jest": "^29.6.2",
"linked-list-typed": "^1.21.2",
"max-heap-typed": "^1.21.2",
"max-priority-queue-typed": "^1.21.2",
"min-heap-typed": "^1.21.2",
"min-priority-queue-typed": "^1.21.2",
"priority-queue-typed": "^1.21.2",
"singly-linked-list-typed": "^1.21.2",
"stack-typed": "^1.21.2",
"tree-multiset-typed": "^1.21.2",
"trie-typed": "^1.21.2",
"linked-list-typed": "^1.21.3",
"max-heap-typed": "^1.21.3",
"max-priority-queue-typed": "^1.21.3",
"min-heap-typed": "^1.21.3",
"min-priority-queue-typed": "^1.21.3",
"priority-queue-typed": "^1.21.3",
"singly-linked-list-typed": "^1.21.3",
"stack-typed": "^1.21.3",
"tree-multiset-typed": "^1.21.3",
"trie-typed": "^1.21.3",
"ts-jest": "^29.1.1",
"ts-loader": "^9.4.4",
"typedoc": "^0.24.8",
"typescript": "^4.9.5",
"undirected-graph-typed": "^1.21.2",
"undirected-graph-typed": "^1.21.3",
"webpack": "^5.88.2",
"webpack-cli": "^5.1.4"
}
@ -1908,12 +1905,12 @@
}
},
"node_modules/avl-tree-typed": {
"version": "1.21.2",
"resolved": "https://registry.npmjs.org/avl-tree-typed/-/avl-tree-typed-1.21.2.tgz",
"integrity": "sha512-GRYyEyOuMsVlgbMwzb/ZC1OAJsFbnvFv6hzSPN91JbXyrNehqhUo6QcJv/N7QbHq/VTi6lUz5STUV6UveQZHbQ==",
"version": "1.21.3",
"resolved": "https://registry.npmjs.org/avl-tree-typed/-/avl-tree-typed-1.21.3.tgz",
"integrity": "sha512-r+CyVvaTy89z7THAePFsHFU1CbqU+mW66iAcBhl+ZBkn2aHLEksy+xEi7H7Axvq9Z7WEPiIDkwjDb+9gl6lrXg==",
"dev": true,
"dependencies": {
"data-structure-typed": "^1.21.2",
"data-structure-typed": "^1.21.3",
"zod": "^3.22.2"
}
},
@ -2089,12 +2086,12 @@
"dev": true
},
"node_modules/binary-tree-typed": {
"version": "1.21.2",
"resolved": "https://registry.npmjs.org/binary-tree-typed/-/binary-tree-typed-1.21.2.tgz",
"integrity": "sha512-VrbcwMi8q2/hOy3UXrapbhWyz3STeVdgrmjZiteGA4VB+FR3qmW8MWLUI4k4bG/o9dpuLD1Y7Q2peJ30HvO8+Q==",
"version": "1.21.3",
"resolved": "https://registry.npmjs.org/binary-tree-typed/-/binary-tree-typed-1.21.3.tgz",
"integrity": "sha512-bkYpnvJ23WBOjBoZ8X7D/XKrYmIwMUa8Yqg/jPc8g+PT44aMBRk10nRrzjQjDDwHdGVyd3KOpwYOXFo/gjeH4A==",
"dev": true,
"dependencies": {
"data-structure-typed": "^1.21.2",
"data-structure-typed": "^1.21.3",
"zod": "^3.22.2"
}
},
@ -2173,12 +2170,12 @@
}
},
"node_modules/bst-typed": {
"version": "1.21.2",
"resolved": "https://registry.npmjs.org/bst-typed/-/bst-typed-1.21.2.tgz",
"integrity": "sha512-ClvDvD/B5u5LZuZI5L7KyK87PqTlFA24mtaysKDkYQd23ONzWjnnJcDjyyd959jfXT+q0oMZWBxE6Y1G9oWN3g==",
"version": "1.21.3",
"resolved": "https://registry.npmjs.org/bst-typed/-/bst-typed-1.21.3.tgz",
"integrity": "sha512-m1rIVcgzqwBAFfctlsouEElvmklHDK02i0g5QnzYMIPL94EHcFIRaqMFHwLDQAkynvo9zCLlxU0j9qzvHVRMGA==",
"dev": true,
"dependencies": {
"data-structure-typed": "^1.21.2",
"data-structure-typed": "^1.21.3",
"zod": "^3.22.2"
}
},
@ -2469,13 +2466,10 @@
}
},
"node_modules/data-structure-typed": {
"version": "1.21.2",
"resolved": "https://registry.npmjs.org/data-structure-typed/-/data-structure-typed-1.21.2.tgz",
"integrity": "sha512-MW9hr60Ubl39DGDwK+EhHed9IjJnQJ8vwLgle4fk9w3K3AJnCCSFa7H6phkDaUhy7ONg4PbEFeuEu+ixNLbKtw==",
"dev": true,
"dependencies": {
"zod": "^3.22.2"
}
"version": "1.21.3",
"resolved": "https://registry.npmjs.org/data-structure-typed/-/data-structure-typed-1.21.3.tgz",
"integrity": "sha512-1HRQH46pcgMfyIMMrucw1L1JR4MwIvSq0qKqLdeJEV3qvwbi3SN0dXjaIQzpO9lYaHDgrB42rIxNgQ+ak74scA==",
"dev": true
},
"node_modules/debug": {
"version": "4.3.4",
@ -2563,12 +2557,12 @@
}
},
"node_modules/deque-typed": {
"version": "1.21.2",
"resolved": "https://registry.npmjs.org/deque-typed/-/deque-typed-1.21.2.tgz",
"integrity": "sha512-FUP1/oTYqLRnzSL9JPTiz1xrzjWNzH+xpzc/Rrb6AUr0WqY+efhUDZvs05CytN+I+8/eTNfZircYtSOe0hSg6w==",
"version": "1.21.3",
"resolved": "https://registry.npmjs.org/deque-typed/-/deque-typed-1.21.3.tgz",
"integrity": "sha512-GE4+pM/t0VjcNa1Ei8wQE5rq1giCYWWLmsg2QYTJ6zbqRhU0axQZddAruhY9RLvlW0XXMtRhmC77LvLoYXjNxw==",
"dev": true,
"dependencies": {
"data-structure-typed": "^1.21.2",
"data-structure-typed": "^1.21.3",
"zod": "^3.22.2"
}
},
@ -2591,22 +2585,22 @@
}
},
"node_modules/directed-graph-typed": {
"version": "1.21.2",
"resolved": "https://registry.npmjs.org/directed-graph-typed/-/directed-graph-typed-1.21.2.tgz",
"integrity": "sha512-ZzyBJOUhMpdsDrSS9e9FgxGus/AKWQtyePAhC1hj12RQ3q86jkAAPPl/UAaKpNguSUuDchpvaZgaisgR9iDUOQ==",
"version": "1.21.3",
"resolved": "https://registry.npmjs.org/directed-graph-typed/-/directed-graph-typed-1.21.3.tgz",
"integrity": "sha512-MFcY1Py97Aj3r+KburlKWjHsecyZDNZxag+Buuyz2cdHFbInBGdcJ88qRIFEmJA6MGM8wBy9mSPKkEsstN9JtQ==",
"dev": true,
"dependencies": {
"data-structure-typed": "^1.21.2",
"data-structure-typed": "^1.21.3",
"zod": "^3.22.2"
}
},
"node_modules/doubly-linked-list-typed": {
"version": "1.21.2",
"resolved": "https://registry.npmjs.org/doubly-linked-list-typed/-/doubly-linked-list-typed-1.21.2.tgz",
"integrity": "sha512-o+Jy4p0W574uBzHMkix9jMoWTt3PKxehT+hH6mwjmbtooN9RKTBEnV8bYpZ3r4baVdN34hptkXdZHJOLEakMgw==",
"version": "1.21.3",
"resolved": "https://registry.npmjs.org/doubly-linked-list-typed/-/doubly-linked-list-typed-1.21.3.tgz",
"integrity": "sha512-jbeAv/VoM8/fmUx9dKhPgK9thCsuuqqvFMe3TFhTMFU/MHboRLTJ0el+1oeM+g5GoTaaaqRZUe9Lr9vNTJYJqQ==",
"dev": true,
"dependencies": {
"data-structure-typed": "^1.21.2",
"data-structure-typed": "^1.21.3",
"zod": "^3.22.2"
}
},
@ -3031,12 +3025,12 @@
"dev": true
},
"node_modules/graph-typed": {
"version": "1.21.2",
"resolved": "https://registry.npmjs.org/graph-typed/-/graph-typed-1.21.2.tgz",
"integrity": "sha512-1d5fy9b/g1h+b/Zqb306npHzEpoTr550lpMZqLA5qf3Tc3ZTGnpxNvVayenI1uKUFY0Fy7JkM442yhoL4QdqXA==",
"version": "1.21.3",
"resolved": "https://registry.npmjs.org/graph-typed/-/graph-typed-1.21.3.tgz",
"integrity": "sha512-RLSgAY4IyEgkdXKXfwh886KomgwLeLO4vgp6JHjv5kwZLNIZ3nFOsOJCEjx+tWC6sKGnxIdlXhzUrSALMjclLg==",
"dev": true,
"dependencies": {
"data-structure-typed": "^1.21.2",
"data-structure-typed": "^1.21.3",
"zod": "^3.22.2"
}
},
@ -3062,12 +3056,12 @@
}
},
"node_modules/heap-typed": {
"version": "1.21.2",
"resolved": "https://registry.npmjs.org/heap-typed/-/heap-typed-1.21.2.tgz",
"integrity": "sha512-Wxz5CA2tw/Djt+GlC5shwQ5ebsjB/kmXSl++6AhAWVOwAjLP7MnHL02WW78GYvPcFniTqEVaUXQoETBUGuINnA==",
"version": "1.21.3",
"resolved": "https://registry.npmjs.org/heap-typed/-/heap-typed-1.21.3.tgz",
"integrity": "sha512-7lqPbHfEuKxLSnPHHb9PMmVLGEf1d/ly0vZ/KLoAQef3z2cLS3A5xg2HU2J1R9wySNjT39x1qN7tOUrokYqwmg==",
"dev": true,
"dependencies": {
"data-structure-typed": "^1.21.2",
"data-structure-typed": "^1.21.3",
"zod": "^3.22.2"
}
},
@ -4795,12 +4789,12 @@
"dev": true
},
"node_modules/linked-list-typed": {
"version": "1.21.2",
"resolved": "https://registry.npmjs.org/linked-list-typed/-/linked-list-typed-1.21.2.tgz",
"integrity": "sha512-SOg10ZF3CZKa8DvDU4yteVI5NY0pOsATXOsBIyQuSUTJbm+2NcCoYRML8igDNoJahfiVvihl3jhc5c8jCzwr7A==",
"version": "1.21.3",
"resolved": "https://registry.npmjs.org/linked-list-typed/-/linked-list-typed-1.21.3.tgz",
"integrity": "sha512-cyHvhIs+rSgqIgcq3weE4ng4WRtDLE3wPm0wa21p1G6gLrtcnRfwWbnOwe68sD7z3st6CRRyiyS2128g9YDeDA==",
"dev": true,
"dependencies": {
"data-structure-typed": "^1.21.2",
"data-structure-typed": "^1.21.3",
"zod": "^3.22.2"
}
},
@ -4895,22 +4889,22 @@
}
},
"node_modules/max-heap-typed": {
"version": "1.21.2",
"resolved": "https://registry.npmjs.org/max-heap-typed/-/max-heap-typed-1.21.2.tgz",
"integrity": "sha512-4LA+4xoqZikwuQ2CyOaeII1uzRbXNgmvhL0vscH1nuKk2biFNgJDsoz7ukkD11YfBiwbnG2DVLBHs2QV9vge2g==",
"version": "1.21.3",
"resolved": "https://registry.npmjs.org/max-heap-typed/-/max-heap-typed-1.21.3.tgz",
"integrity": "sha512-F8DbeN0gaVqbIPfBBcVsA+yqvZAyR5WWb9Wjw+N1zaTyikOUsfHbZO+xUQXyAP3fG7bSlS9vr/C1Gf2BE+FcxQ==",
"dev": true,
"dependencies": {
"data-structure-typed": "^1.21.2",
"data-structure-typed": "^1.21.3",
"zod": "^3.22.2"
}
},
"node_modules/max-priority-queue-typed": {
"version": "1.21.2",
"resolved": "https://registry.npmjs.org/max-priority-queue-typed/-/max-priority-queue-typed-1.21.2.tgz",
"integrity": "sha512-2yF9MJQd2PJ28kQJLc9QbNkeIT/JIMi5wwctc9uWgiM2Izic2wjITfr0k5HaIIMc3NnRqkpBtP25A7q0KBmxdg==",
"version": "1.21.3",
"resolved": "https://registry.npmjs.org/max-priority-queue-typed/-/max-priority-queue-typed-1.21.3.tgz",
"integrity": "sha512-IOclpEFpQyUDzH2Hp3JhX2TiHaGSeIDclBcUNpZoI/XNpOenkfuqzzV1QGG+BAz3dPD2vq/9TjVRRrHypPma6A==",
"dev": true,
"dependencies": {
"data-structure-typed": "^1.21.2",
"data-structure-typed": "^1.21.3",
"zod": "^3.22.2"
}
},
@ -4964,22 +4958,22 @@
}
},
"node_modules/min-heap-typed": {
"version": "1.21.2",
"resolved": "https://registry.npmjs.org/min-heap-typed/-/min-heap-typed-1.21.2.tgz",
"integrity": "sha512-j5ptRVn4NSFCuDckbgAzuUtTbX0eMnayOc45W7LIXv8hwSHRhlVe+5X85kg6s1CRPKJ9gcm5aInYPB/68RRt4Q==",
"version": "1.21.3",
"resolved": "https://registry.npmjs.org/min-heap-typed/-/min-heap-typed-1.21.3.tgz",
"integrity": "sha512-S43A9yI3tg22Ojnu1x1Amt0dU5LrqS19SOKKDyAtXnUzS5RMkZM/b5iw2nJ5mrEP2FJwjOyj+XLapSyXw9powA==",
"dev": true,
"dependencies": {
"data-structure-typed": "^1.21.2",
"data-structure-typed": "^1.21.3",
"zod": "^3.22.2"
}
},
"node_modules/min-priority-queue-typed": {
"version": "1.21.2",
"resolved": "https://registry.npmjs.org/min-priority-queue-typed/-/min-priority-queue-typed-1.21.2.tgz",
"integrity": "sha512-tnZTE4i83JGhzdudlNkrjqy6vqm/IDaRe+rsFtidhkLF0pLLFht/V/LKFnrIRLQeV1gCDW+2e+BwSZdvi0zw/A==",
"version": "1.21.3",
"resolved": "https://registry.npmjs.org/min-priority-queue-typed/-/min-priority-queue-typed-1.21.3.tgz",
"integrity": "sha512-woyiLWvMaHJfBFziPSffy74Hk+80K23yEEG/QUDqS6hMbM+BUla7NhWFfqJOal0igMqgI9u73XMEnQAwrfR/2g==",
"dev": true,
"dependencies": {
"data-structure-typed": "^1.21.2",
"data-structure-typed": "^1.21.3",
"zod": "^3.22.2"
}
},
@ -5272,12 +5266,12 @@
}
},
"node_modules/priority-queue-typed": {
"version": "1.21.2",
"resolved": "https://registry.npmjs.org/priority-queue-typed/-/priority-queue-typed-1.21.2.tgz",
"integrity": "sha512-hdOIhnqns6djfC8gRGUFWMRWVJANxqxkw+jHCGrCXVWFGUDYoAIYmbat5adc4ekAz0ZPCHXyNxDW4h44aYR98w==",
"version": "1.21.3",
"resolved": "https://registry.npmjs.org/priority-queue-typed/-/priority-queue-typed-1.21.3.tgz",
"integrity": "sha512-YJSppKblM25t6L3kn/9MsgHsQi6Z3vvuoX6xWsA4Np69SMsAqMfsKrCO7oSYfEDZzW9LxeL/rZzjn0GeygraaQ==",
"dev": true,
"dependencies": {
"data-structure-typed": "^1.21.2",
"data-structure-typed": "^1.21.3",
"zod": "^3.22.2"
}
},
@ -5610,12 +5604,12 @@
}
},
"node_modules/singly-linked-list-typed": {
"version": "1.21.2",
"resolved": "https://registry.npmjs.org/singly-linked-list-typed/-/singly-linked-list-typed-1.21.2.tgz",
"integrity": "sha512-0rrTSEEprCRk0ClvIsK+3FtcxTgK4GVO8ywjS4AaozEP3LQKS6i/hKWtQJMQOxPLuwbrsNTMfMWBrHpU8Ec+KA==",
"version": "1.21.3",
"resolved": "https://registry.npmjs.org/singly-linked-list-typed/-/singly-linked-list-typed-1.21.3.tgz",
"integrity": "sha512-gcCqO7Lc164qkiQXSs04fcDsSAc3aPsA+Hcz9zEFVbGHHaYEZW04wPwU67XnSHpVtSU8FnMlWVkPxJq7Xf2h6g==",
"dev": true,
"dependencies": {
"data-structure-typed": "^1.21.2",
"data-structure-typed": "^1.21.3",
"zod": "^3.22.2"
}
},
@ -5660,12 +5654,12 @@
"dev": true
},
"node_modules/stack-typed": {
"version": "1.21.2",
"resolved": "https://registry.npmjs.org/stack-typed/-/stack-typed-1.21.2.tgz",
"integrity": "sha512-vvjVjRca+QwkECmLLAtw5qd2aQuQX4H6crFZ+5VibrFVUKJFMbq+pF0OIrDhivnOHccemHyd0O8Ch6qj71TUkw==",
"version": "1.21.3",
"resolved": "https://registry.npmjs.org/stack-typed/-/stack-typed-1.21.3.tgz",
"integrity": "sha512-wLqkd6jg7RuOsrs8LFvoFh1zAHLB2H2NLfxpB1tfpx46gm2eJHPFFY9gpk3DATDaOHDV87dpEXrM40tVT6ALrg==",
"dev": true,
"dependencies": {
"data-structure-typed": "^1.21.2",
"data-structure-typed": "^1.21.3",
"zod": "^3.22.2"
}
},
@ -6070,22 +6064,22 @@
}
},
"node_modules/tree-multiset-typed": {
"version": "1.21.2",
"resolved": "https://registry.npmjs.org/tree-multiset-typed/-/tree-multiset-typed-1.21.2.tgz",
"integrity": "sha512-hKuwAtcoEUO7BTjwLQ/wvmQ6AY52SvsPOhmqS3sEd4c1OoB4saMmnhwKTgh3FT3b3/dBqR1cpDmRvaLaC+qaUQ==",
"version": "1.21.3",
"resolved": "https://registry.npmjs.org/tree-multiset-typed/-/tree-multiset-typed-1.21.3.tgz",
"integrity": "sha512-iawtJsC3lj3w6CprTHA/V2XCDC6xUd39wJ1+A+tZb9zsiIGBSwvHVaFGGjU8+IXGsH0LOt3tUTrOgifWX5dEzA==",
"dev": true,
"dependencies": {
"data-structure-typed": "^1.21.2",
"data-structure-typed": "^1.21.3",
"zod": "^3.22.2"
}
},
"node_modules/trie-typed": {
"version": "1.21.2",
"resolved": "https://registry.npmjs.org/trie-typed/-/trie-typed-1.21.2.tgz",
"integrity": "sha512-RXOwwQR4h28LHkJ4ajF/ybSec07tvymZowvBsXVO/4NcNH9tw78cXZ7bmNL/jsrzgjx6Te16x7OX1V96JTKX0w==",
"version": "1.21.3",
"resolved": "https://registry.npmjs.org/trie-typed/-/trie-typed-1.21.3.tgz",
"integrity": "sha512-4ia0nlFhYmOromnrbGn4isLoyAYHftA7d0UAq77bC7ujro4Z5TWLEr7dEZ07m/vwvz55QeC+bzVKJyl04/QNrw==",
"dev": true,
"dependencies": {
"data-structure-typed": "^1.21.2",
"data-structure-typed": "^1.21.3",
"zod": "^3.22.2"
}
},
@ -6342,12 +6336,12 @@
}
},
"node_modules/undirected-graph-typed": {
"version": "1.21.2",
"resolved": "https://registry.npmjs.org/undirected-graph-typed/-/undirected-graph-typed-1.21.2.tgz",
"integrity": "sha512-oi6AUyvpQ8B1zYRdfo1GwTfcYOvqgHlCpWgPcsQwPaGAM/LpVRMAatJ66A86CizNCX59D9bDFlOKVr9nGzzeqQ==",
"version": "1.21.3",
"resolved": "https://registry.npmjs.org/undirected-graph-typed/-/undirected-graph-typed-1.21.3.tgz",
"integrity": "sha512-tU02rCmLp68fTHLy3H7KSb0xzxxDkDDSwMiNavOxCiovv5mcgc026U/pRtHvAFaNtRFKcCA6ABtbUZqtrgErEA==",
"dev": true,
"dependencies": {
"data-structure-typed": "^1.21.2",
"data-structure-typed": "^1.21.3",
"zod": "^3.22.2"
}
},
@ -6845,6 +6839,7 @@
"version": "3.22.2",
"resolved": "https://registry.npmjs.org/zod/-/zod-3.22.2.tgz",
"integrity": "sha512-wvWkphh5WQsJbVk1tbx1l1Ly4yg+XecD+Mq280uBGt9wa5BKSWf4Mhp6GmrkPixhMxmabYY7RbzlwVP32pbGCg==",
"dev": true,
"funding": {
"url": "https://github.com/sponsors/colinhacks"
}

View file

@ -1,6 +1,6 @@
{
"name": "data-structure-typed",
"version": "1.21.2",
"version": "1.21.3",
"description": "Javascript & TypeScript Data Structure Library, meticulously crafted to empower developers with a versatile set of essential data structures. Our library includes a wide range of data structures, such as Binary Tree, AVL Tree, Binary Search Tree (BST), Tree Multiset, Segment Tree, Binary Indexed Tree, Graph, Directed Graph, Undirected Graph, Singly Linked List, Hash, CoordinateSet, CoordinateMap, Heap, Doubly Linked List, Priority Queue, Max Priority Queue, Min Priority Queue, Queue, ObjectDeque, ArrayDeque, Stack, and Trie. Each data structure is thoughtfully designed and implemented using TypeScript to provide efficient, reliable, and easy-to-use solutions for your programming needs. Whether you're optimizing algorithms, managing data, or enhancing performance, our TypeScript Data Structure Library is your go-to resource. Elevate your coding experience with these fundamental building blocks for software development.",
"main": "dist/index.js",
"module": "dist/index.js",
@ -61,35 +61,32 @@
"devDependencies": {
"@types/jest": "^29.5.3",
"@types/node": "^20.4.9",
"avl-tree-typed": "^1.21.2",
"binary-tree-typed": "^1.21.2",
"bst-typed": "^1.21.2",
"avl-tree-typed": "^1.21.3",
"binary-tree-typed": "^1.21.3",
"bst-typed": "^1.21.3",
"dependency-cruiser": "^13.1.2",
"deque-typed": "^1.21.2",
"directed-graph-typed": "^1.21.2",
"doubly-linked-list-typed": "^1.21.2",
"graph-typed": "^1.21.2",
"heap-typed": "^1.21.2",
"deque-typed": "^1.21.3",
"directed-graph-typed": "^1.21.3",
"doubly-linked-list-typed": "^1.21.3",
"graph-typed": "^1.21.3",
"heap-typed": "^1.21.3",
"jest": "^29.6.2",
"linked-list-typed": "^1.21.2",
"max-heap-typed": "^1.21.2",
"max-priority-queue-typed": "^1.21.2",
"min-heap-typed": "^1.21.2",
"min-priority-queue-typed": "^1.21.2",
"priority-queue-typed": "^1.21.2",
"singly-linked-list-typed": "^1.21.2",
"stack-typed": "^1.21.2",
"tree-multiset-typed": "^1.21.2",
"trie-typed": "^1.21.2",
"linked-list-typed": "^1.21.3",
"max-heap-typed": "^1.21.3",
"max-priority-queue-typed": "^1.21.3",
"min-heap-typed": "^1.21.3",
"min-priority-queue-typed": "^1.21.3",
"priority-queue-typed": "^1.21.3",
"singly-linked-list-typed": "^1.21.3",
"stack-typed": "^1.21.3",
"tree-multiset-typed": "^1.21.3",
"trie-typed": "^1.21.3",
"ts-jest": "^29.1.1",
"ts-loader": "^9.4.4",
"typedoc": "^0.24.8",
"typescript": "^4.9.5",
"undirected-graph-typed": "^1.21.2",
"undirected-graph-typed": "^1.21.3",
"webpack": "^5.88.2",
"webpack-cli": "^5.1.4"
},
"dependencies": {
"zod": "^3.22.2"
}
}

View file

@ -1,2 +1 @@
export * from './utils';
export * from './validate-type';

View file

@ -1,69 +0,0 @@
import {z} from 'zod';
import {NonNumberNonObjectButDefined, ObjectWithNonNumberId, ObjectWithNumberId, ObjectWithoutId} from '../types/utils';
export const nonNumberNonObjectButDefinedSchema = z.union([z.string(),
z.boolean(), z.any()])
.nullable()
export const keyValueObjectSchema = z.record(z.unknown())
export const objectWithoutIdSchema = keyValueObjectSchema.refine(obj => !('id' in obj), {
message: 'Object cannot contain the \'id\' field',
});
export const keyValueObjectWithIdSchema = z.record(z.any()).and(
z.object({
id: z.union([z.string(), z.number(), z.any()])
})
)
export const objectWithNonNumberIdSchema = z.record(z.any()).and(
z.object({
id: z
.union([z.string(), z.boolean(), z.any(), z.any(), z.undefined()])
.nullable()
})
)
export const objectWithNumberIdSchema = z.record(z.any()).and(
z.object({
id: z.number()
})
)
export const binaryTreeNodeValWithId = z.union([
nonNumberNonObjectButDefinedSchema,
objectWithoutIdSchema,
objectWithNonNumberIdSchema,
objectWithNumberIdSchema
])
export function parseBySchema(schema: z.Schema, val: any) {
try {
schema.parse(val);
return true;
} catch (error) {
return false;
}
}
export function isNonNumberNonObjectButDefined(val: any): val is NonNumberNonObjectButDefined {
return parseBySchema(nonNumberNonObjectButDefinedSchema, val);
}
export function isObjectWithoutId(val: any): val is ObjectWithoutId {
return parseBySchema(objectWithoutIdSchema, val);
}
export function isObjectWithNonNumberId(val: any): val is ObjectWithNonNumberId {
return parseBySchema(objectWithNonNumberIdSchema, val);
}
export function isObjectWithNumberId(val: any): val is ObjectWithNumberId {
return parseBySchema(objectWithNonNumberIdSchema, val);
}
export function isNumber(val: any): val is number {
return typeof val === 'number';
}