tree-set-typed 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (273) hide show
  1. package/.eslintrc.js +61 -0
  2. package/.prettierignore +6 -0
  3. package/.prettierrc.js +16 -0
  4. package/LICENSE +21 -0
  5. package/README.md +482 -0
  6. package/coverage/clover.xml +13 -0
  7. package/coverage/coverage-final.json +96 -0
  8. package/coverage/coverage-summary.json +60 -0
  9. package/coverage/lcov-report/base.css +403 -0
  10. package/coverage/lcov-report/block-navigation.js +87 -0
  11. package/coverage/lcov-report/favicon.png +0 -0
  12. package/coverage/lcov-report/index.html +119 -0
  13. package/coverage/lcov-report/index.ts.html +109 -0
  14. package/coverage/lcov-report/prettify.css +1 -0
  15. package/coverage/lcov-report/prettify.js +2 -0
  16. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  17. package/coverage/lcov-report/sorter.js +206 -0
  18. package/coverage/lcov.info +14 -0
  19. package/dist/cjs/index.cjs +12 -0
  20. package/dist/cjs/index.cjs.map +1 -0
  21. package/dist/cjs-legacy/index.cjs +12 -0
  22. package/dist/cjs-legacy/index.cjs.map +1 -0
  23. package/dist/esm/index.mjs +3 -0
  24. package/dist/esm/index.mjs.map +1 -0
  25. package/dist/esm-legacy/index.mjs +3 -0
  26. package/dist/esm-legacy/index.mjs.map +1 -0
  27. package/dist/types/common/index.d.ts +12 -0
  28. package/dist/types/constants/index.d.ts +4 -0
  29. package/dist/types/data-structures/base/index.d.ts +2 -0
  30. package/dist/types/data-structures/base/iterable-element-base.d.ts +219 -0
  31. package/dist/types/data-structures/base/iterable-entry-base.d.ts +150 -0
  32. package/dist/types/data-structures/base/linear-base.d.ts +335 -0
  33. package/dist/types/data-structures/binary-tree/avl-tree-counter.d.ts +236 -0
  34. package/dist/types/data-structures/binary-tree/avl-tree-multi-map.d.ts +197 -0
  35. package/dist/types/data-structures/binary-tree/avl-tree.d.ts +440 -0
  36. package/dist/types/data-structures/binary-tree/binary-indexed-tree.d.ts +174 -0
  37. package/dist/types/data-structures/binary-tree/binary-tree.d.ts +807 -0
  38. package/dist/types/data-structures/binary-tree/bst.d.ts +645 -0
  39. package/dist/types/data-structures/binary-tree/index.d.ts +10 -0
  40. package/dist/types/data-structures/binary-tree/red-black-tree.d.ts +312 -0
  41. package/dist/types/data-structures/binary-tree/segment-tree.d.ts +160 -0
  42. package/dist/types/data-structures/binary-tree/tree-counter.d.ts +243 -0
  43. package/dist/types/data-structures/binary-tree/tree-multi-map.d.ts +333 -0
  44. package/dist/types/data-structures/graph/abstract-graph.d.ts +340 -0
  45. package/dist/types/data-structures/graph/directed-graph.d.ts +332 -0
  46. package/dist/types/data-structures/graph/index.d.ts +4 -0
  47. package/dist/types/data-structures/graph/map-graph.d.ts +78 -0
  48. package/dist/types/data-structures/graph/undirected-graph.d.ts +347 -0
  49. package/dist/types/data-structures/hash/hash-map.d.ts +428 -0
  50. package/dist/types/data-structures/hash/index.d.ts +1 -0
  51. package/dist/types/data-structures/heap/heap.d.ts +552 -0
  52. package/dist/types/data-structures/heap/index.d.ts +3 -0
  53. package/dist/types/data-structures/heap/max-heap.d.ts +32 -0
  54. package/dist/types/data-structures/heap/min-heap.d.ts +33 -0
  55. package/dist/types/data-structures/index.d.ts +12 -0
  56. package/dist/types/data-structures/linked-list/doubly-linked-list.d.ts +437 -0
  57. package/dist/types/data-structures/linked-list/index.d.ts +3 -0
  58. package/dist/types/data-structures/linked-list/singly-linked-list.d.ts +567 -0
  59. package/dist/types/data-structures/linked-list/skip-linked-list.d.ts +27 -0
  60. package/dist/types/data-structures/matrix/index.d.ts +2 -0
  61. package/dist/types/data-structures/matrix/matrix.d.ts +168 -0
  62. package/dist/types/data-structures/matrix/navigator.d.ts +55 -0
  63. package/dist/types/data-structures/priority-queue/index.d.ts +3 -0
  64. package/dist/types/data-structures/priority-queue/max-priority-queue.d.ts +27 -0
  65. package/dist/types/data-structures/priority-queue/min-priority-queue.d.ts +26 -0
  66. package/dist/types/data-structures/priority-queue/priority-queue.d.ts +15 -0
  67. package/dist/types/data-structures/queue/deque.d.ts +459 -0
  68. package/dist/types/data-structures/queue/index.d.ts +2 -0
  69. package/dist/types/data-structures/queue/queue.d.ts +364 -0
  70. package/dist/types/data-structures/stack/index.d.ts +1 -0
  71. package/dist/types/data-structures/stack/stack.d.ts +324 -0
  72. package/dist/types/data-structures/tree/index.d.ts +1 -0
  73. package/dist/types/data-structures/tree/tree.d.ts +62 -0
  74. package/dist/types/data-structures/trie/index.d.ts +1 -0
  75. package/dist/types/data-structures/trie/trie.d.ts +412 -0
  76. package/dist/types/index.d.ts +23 -0
  77. package/dist/types/interfaces/binary-tree.d.ts +60 -0
  78. package/dist/types/interfaces/doubly-linked-list.d.ts +1 -0
  79. package/dist/types/interfaces/graph.d.ts +21 -0
  80. package/dist/types/interfaces/heap.d.ts +1 -0
  81. package/dist/types/interfaces/index.d.ts +8 -0
  82. package/dist/types/interfaces/navigator.d.ts +1 -0
  83. package/dist/types/interfaces/priority-queue.d.ts +1 -0
  84. package/dist/types/interfaces/segment-tree.d.ts +1 -0
  85. package/dist/types/interfaces/singly-linked-list.d.ts +1 -0
  86. package/dist/types/types/common.d.ts +15 -0
  87. package/dist/types/types/data-structures/base/base.d.ts +13 -0
  88. package/dist/types/types/data-structures/base/index.d.ts +1 -0
  89. package/dist/types/types/data-structures/binary-tree/avl-tree-counter.d.ts +2 -0
  90. package/dist/types/types/data-structures/binary-tree/avl-tree-multi-map.d.ts +2 -0
  91. package/dist/types/types/data-structures/binary-tree/avl-tree.d.ts +2 -0
  92. package/dist/types/types/data-structures/binary-tree/binary-indexed-tree.d.ts +1 -0
  93. package/dist/types/types/data-structures/binary-tree/binary-tree.d.ts +29 -0
  94. package/dist/types/types/data-structures/binary-tree/bst.d.ts +12 -0
  95. package/dist/types/types/data-structures/binary-tree/index.d.ts +9 -0
  96. package/dist/types/types/data-structures/binary-tree/red-black-tree.d.ts +3 -0
  97. package/dist/types/types/data-structures/binary-tree/segment-tree.d.ts +1 -0
  98. package/dist/types/types/data-structures/binary-tree/tree-counter.d.ts +2 -0
  99. package/dist/types/types/data-structures/binary-tree/tree-multi-map.d.ts +2 -0
  100. package/dist/types/types/data-structures/graph/abstract-graph.d.ts +14 -0
  101. package/dist/types/types/data-structures/graph/directed-graph.d.ts +1 -0
  102. package/dist/types/types/data-structures/graph/index.d.ts +3 -0
  103. package/dist/types/types/data-structures/graph/map-graph.d.ts +1 -0
  104. package/dist/types/types/data-structures/graph/undirected-graph.d.ts +1 -0
  105. package/dist/types/types/data-structures/hash/hash-map.d.ts +19 -0
  106. package/dist/types/types/data-structures/hash/index.d.ts +2 -0
  107. package/dist/types/types/data-structures/heap/heap.d.ts +5 -0
  108. package/dist/types/types/data-structures/heap/index.d.ts +1 -0
  109. package/dist/types/types/data-structures/heap/max-heap.d.ts +1 -0
  110. package/dist/types/types/data-structures/heap/min-heap.d.ts +1 -0
  111. package/dist/types/types/data-structures/index.d.ts +12 -0
  112. package/dist/types/types/data-structures/linked-list/doubly-linked-list.d.ts +2 -0
  113. package/dist/types/types/data-structures/linked-list/index.d.ts +3 -0
  114. package/dist/types/types/data-structures/linked-list/singly-linked-list.d.ts +2 -0
  115. package/dist/types/types/data-structures/linked-list/skip-linked-list.d.ts +4 -0
  116. package/dist/types/types/data-structures/matrix/index.d.ts +2 -0
  117. package/dist/types/types/data-structures/matrix/matrix.d.ts +7 -0
  118. package/dist/types/types/data-structures/matrix/navigator.d.ts +14 -0
  119. package/dist/types/types/data-structures/priority-queue/index.d.ts +3 -0
  120. package/dist/types/types/data-structures/priority-queue/max-priority-queue.d.ts +1 -0
  121. package/dist/types/types/data-structures/priority-queue/min-priority-queue.d.ts +1 -0
  122. package/dist/types/types/data-structures/priority-queue/priority-queue.d.ts +2 -0
  123. package/dist/types/types/data-structures/queue/deque.d.ts +4 -0
  124. package/dist/types/types/data-structures/queue/index.d.ts +2 -0
  125. package/dist/types/types/data-structures/queue/queue.d.ts +4 -0
  126. package/dist/types/types/data-structures/stack/index.d.ts +1 -0
  127. package/dist/types/types/data-structures/stack/stack.d.ts +2 -0
  128. package/dist/types/types/data-structures/tree/index.d.ts +1 -0
  129. package/dist/types/types/data-structures/tree/tree.d.ts +1 -0
  130. package/dist/types/types/data-structures/trie/index.d.ts +1 -0
  131. package/dist/types/types/data-structures/trie/trie.d.ts +4 -0
  132. package/dist/types/types/index.d.ts +3 -0
  133. package/dist/types/types/utils/index.d.ts +2 -0
  134. package/dist/types/types/utils/utils.d.ts +22 -0
  135. package/dist/types/types/utils/validate-type.d.ts +19 -0
  136. package/dist/types/utils/index.d.ts +2 -0
  137. package/dist/types/utils/number.d.ts +14 -0
  138. package/dist/types/utils/utils.d.ts +209 -0
  139. package/dist/umd/red-black-tree-typed.js +14578 -0
  140. package/dist/umd/red-black-tree-typed.js.map +1 -0
  141. package/dist/umd/red-black-tree-typed.min.js +44 -0
  142. package/dist/umd/red-black-tree-typed.min.js.map +1 -0
  143. package/docs/.nojekyll +1 -0
  144. package/docs/assets/highlight.css +92 -0
  145. package/docs/assets/main.js +59 -0
  146. package/docs/assets/navigation.js +1 -0
  147. package/docs/assets/search.js +1 -0
  148. package/docs/assets/style.css +1383 -0
  149. package/docs/classes/AVLTree.html +2046 -0
  150. package/docs/classes/AVLTreeNode.html +263 -0
  151. package/docs/index.html +523 -0
  152. package/docs/modules.html +45 -0
  153. package/jest.config.js +8 -0
  154. package/package.json +113 -0
  155. package/src/common/index.ts +23 -0
  156. package/src/constants/index.ts +4 -0
  157. package/src/data-structures/base/index.ts +2 -0
  158. package/src/data-structures/base/iterable-element-base.ts +352 -0
  159. package/src/data-structures/base/iterable-entry-base.ts +246 -0
  160. package/src/data-structures/base/linear-base.ts +643 -0
  161. package/src/data-structures/binary-tree/avl-tree-counter.ts +539 -0
  162. package/src/data-structures/binary-tree/avl-tree-multi-map.ts +438 -0
  163. package/src/data-structures/binary-tree/avl-tree.ts +840 -0
  164. package/src/data-structures/binary-tree/binary-indexed-tree.ts +331 -0
  165. package/src/data-structures/binary-tree/binary-tree.ts +2492 -0
  166. package/src/data-structures/binary-tree/bst.ts +2024 -0
  167. package/src/data-structures/binary-tree/index.ts +10 -0
  168. package/src/data-structures/binary-tree/red-black-tree.ts +767 -0
  169. package/src/data-structures/binary-tree/segment-tree.ts +324 -0
  170. package/src/data-structures/binary-tree/tree-counter.ts +575 -0
  171. package/src/data-structures/binary-tree/tree-multi-map.ts +549 -0
  172. package/src/data-structures/graph/abstract-graph.ts +1081 -0
  173. package/src/data-structures/graph/directed-graph.ts +715 -0
  174. package/src/data-structures/graph/index.ts +4 -0
  175. package/src/data-structures/graph/map-graph.ts +132 -0
  176. package/src/data-structures/graph/undirected-graph.ts +626 -0
  177. package/src/data-structures/hash/hash-map.ts +813 -0
  178. package/src/data-structures/hash/index.ts +1 -0
  179. package/src/data-structures/heap/heap.ts +1020 -0
  180. package/src/data-structures/heap/index.ts +3 -0
  181. package/src/data-structures/heap/max-heap.ts +47 -0
  182. package/src/data-structures/heap/min-heap.ts +36 -0
  183. package/src/data-structures/index.ts +12 -0
  184. package/src/data-structures/linked-list/doubly-linked-list.ts +876 -0
  185. package/src/data-structures/linked-list/index.ts +3 -0
  186. package/src/data-structures/linked-list/singly-linked-list.ts +1050 -0
  187. package/src/data-structures/linked-list/skip-linked-list.ts +173 -0
  188. package/src/data-structures/matrix/index.ts +2 -0
  189. package/src/data-structures/matrix/matrix.ts +491 -0
  190. package/src/data-structures/matrix/navigator.ts +124 -0
  191. package/src/data-structures/priority-queue/index.ts +3 -0
  192. package/src/data-structures/priority-queue/max-priority-queue.ts +42 -0
  193. package/src/data-structures/priority-queue/min-priority-queue.ts +29 -0
  194. package/src/data-structures/priority-queue/priority-queue.ts +19 -0
  195. package/src/data-structures/queue/deque.ts +1001 -0
  196. package/src/data-structures/queue/index.ts +2 -0
  197. package/src/data-structures/queue/queue.ts +592 -0
  198. package/src/data-structures/stack/index.ts +1 -0
  199. package/src/data-structures/stack/stack.ts +469 -0
  200. package/src/data-structures/tree/index.ts +1 -0
  201. package/src/data-structures/tree/tree.ts +115 -0
  202. package/src/data-structures/trie/index.ts +1 -0
  203. package/src/data-structures/trie/trie.ts +756 -0
  204. package/src/index.ts +24 -0
  205. package/src/interfaces/binary-tree.ts +252 -0
  206. package/src/interfaces/doubly-linked-list.ts +1 -0
  207. package/src/interfaces/graph.ts +44 -0
  208. package/src/interfaces/heap.ts +1 -0
  209. package/src/interfaces/index.ts +8 -0
  210. package/src/interfaces/navigator.ts +1 -0
  211. package/src/interfaces/priority-queue.ts +1 -0
  212. package/src/interfaces/segment-tree.ts +1 -0
  213. package/src/interfaces/singly-linked-list.ts +1 -0
  214. package/src/types/common.ts +25 -0
  215. package/src/types/data-structures/base/base.ts +34 -0
  216. package/src/types/data-structures/base/index.ts +1 -0
  217. package/src/types/data-structures/binary-tree/avl-tree-counter.ts +3 -0
  218. package/src/types/data-structures/binary-tree/avl-tree-multi-map.ts +3 -0
  219. package/src/types/data-structures/binary-tree/avl-tree.ts +3 -0
  220. package/src/types/data-structures/binary-tree/binary-indexed-tree.ts +1 -0
  221. package/src/types/data-structures/binary-tree/binary-tree.ts +31 -0
  222. package/src/types/data-structures/binary-tree/bst.ts +19 -0
  223. package/src/types/data-structures/binary-tree/index.ts +9 -0
  224. package/src/types/data-structures/binary-tree/red-black-tree.ts +5 -0
  225. package/src/types/data-structures/binary-tree/segment-tree.ts +1 -0
  226. package/src/types/data-structures/binary-tree/tree-counter.ts +3 -0
  227. package/src/types/data-structures/binary-tree/tree-multi-map.ts +3 -0
  228. package/src/types/data-structures/graph/abstract-graph.ts +18 -0
  229. package/src/types/data-structures/graph/directed-graph.ts +2 -0
  230. package/src/types/data-structures/graph/index.ts +3 -0
  231. package/src/types/data-structures/graph/map-graph.ts +1 -0
  232. package/src/types/data-structures/graph/undirected-graph.ts +1 -0
  233. package/src/types/data-structures/hash/hash-map.ts +19 -0
  234. package/src/types/data-structures/hash/index.ts +3 -0
  235. package/src/types/data-structures/heap/heap.ts +6 -0
  236. package/src/types/data-structures/heap/index.ts +1 -0
  237. package/src/types/data-structures/heap/max-heap.ts +1 -0
  238. package/src/types/data-structures/heap/min-heap.ts +1 -0
  239. package/src/types/data-structures/index.ts +12 -0
  240. package/src/types/data-structures/linked-list/doubly-linked-list.ts +3 -0
  241. package/src/types/data-structures/linked-list/index.ts +3 -0
  242. package/src/types/data-structures/linked-list/singly-linked-list.ts +3 -0
  243. package/src/types/data-structures/linked-list/skip-linked-list.ts +1 -0
  244. package/src/types/data-structures/matrix/index.ts +2 -0
  245. package/src/types/data-structures/matrix/matrix.ts +7 -0
  246. package/src/types/data-structures/matrix/navigator.ts +14 -0
  247. package/src/types/data-structures/priority-queue/index.ts +3 -0
  248. package/src/types/data-structures/priority-queue/max-priority-queue.ts +1 -0
  249. package/src/types/data-structures/priority-queue/min-priority-queue.ts +1 -0
  250. package/src/types/data-structures/priority-queue/priority-queue.ts +3 -0
  251. package/src/types/data-structures/queue/deque.ts +5 -0
  252. package/src/types/data-structures/queue/index.ts +2 -0
  253. package/src/types/data-structures/queue/queue.ts +5 -0
  254. package/src/types/data-structures/stack/index.ts +1 -0
  255. package/src/types/data-structures/stack/stack.ts +3 -0
  256. package/src/types/data-structures/tree/index.ts +1 -0
  257. package/src/types/data-structures/tree/tree.ts +1 -0
  258. package/src/types/data-structures/trie/index.ts +1 -0
  259. package/src/types/data-structures/trie/trie.ts +3 -0
  260. package/src/types/index.ts +3 -0
  261. package/src/types/utils/index.ts +2 -0
  262. package/src/types/utils/utils.ts +33 -0
  263. package/src/types/utils/validate-type.ts +35 -0
  264. package/src/utils/index.ts +2 -0
  265. package/src/utils/number.ts +22 -0
  266. package/src/utils/utils.ts +350 -0
  267. package/test/index.test.ts +111 -0
  268. package/tsconfig.base.json +23 -0
  269. package/tsconfig.json +12 -0
  270. package/tsconfig.test.json +8 -0
  271. package/tsconfig.types.json +15 -0
  272. package/tsup.config.js +28 -0
  273. package/tsup.node.config.js +71 -0
@@ -0,0 +1,3 @@
1
+ import { HeapOptions } from '../heap';
2
+
3
+ export type PriorityQueueOptions<E, R> = HeapOptions<E, R> & {};
@@ -0,0 +1,5 @@
1
+ import { LinearBaseOptions } from '../base';
2
+
3
+ export type DequeOptions<E, R> = {
4
+ bucketSize?: number;
5
+ } & LinearBaseOptions<E, R>;
@@ -0,0 +1,2 @@
1
+ export * from './queue';
2
+ export * from './deque';
@@ -0,0 +1,5 @@
1
+ import { LinearBaseOptions } from '../base';
2
+
3
+ export type QueueOptions<E, R> = LinearBaseOptions<E, R> & {
4
+ autoCompactRatio?: number;
5
+ };
@@ -0,0 +1 @@
1
+ export * from './stack';
@@ -0,0 +1,3 @@
1
+ import { IterableElementBaseOptions } from '../base';
2
+
3
+ export type StackOptions<E, R> = IterableElementBaseOptions<E, R> & {};
@@ -0,0 +1 @@
1
+ export * from './tree';
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export * from './trie';
@@ -0,0 +1,3 @@
1
+ import { IterableElementBaseOptions } from '../base';
2
+
3
+ export type TrieOptions<R> = { caseSensitive?: boolean } & IterableElementBaseOptions<string, R>;
@@ -0,0 +1,3 @@
1
+ export * from './data-structures';
2
+ export * from './common';
3
+ export * from './utils';
@@ -0,0 +1,2 @@
1
+ export * from './utils';
2
+ export * from './validate-type';
@@ -0,0 +1,33 @@
1
+ export type SpecifyOptional<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
2
+
3
+ export type Any = string | number | bigint | boolean | symbol | undefined | object;
4
+
5
+ export type Arithmetic = number | bigint;
6
+
7
+ export type ElemOf<T> = T extends (infer U)[] ? U : never;
8
+
9
+ export type ComparablePrimitive = number | bigint | string | boolean;
10
+
11
+ export interface BaseComparableObject {
12
+ [key: string]: unknown;
13
+ }
14
+
15
+ export interface ValueComparableObject extends BaseComparableObject {
16
+ valueOf: () => ComparablePrimitive | ValueComparableObject;
17
+ toString?: () => string;
18
+ }
19
+
20
+ export interface StringComparableObject extends BaseComparableObject {
21
+ toString: () => string;
22
+ }
23
+
24
+ export type ComparableObject = ValueComparableObject | StringComparableObject;
25
+
26
+ export type Comparable = ComparablePrimitive | Date | ComparableObject;
27
+
28
+ export type TrampolineThunk<T> = {
29
+ readonly isThunk: true;
30
+ readonly fn: () => Trampoline<T>;
31
+ };
32
+
33
+ export type Trampoline<T> = T | TrampolineThunk<T>;
@@ -0,0 +1,35 @@
1
+ export type KeyValueObject = { [key: string]: any };
2
+
3
+ export type KeyValueObjectWithKey = { [key: string]: any; key: string | number | symbol };
4
+
5
+ export type NonNumberNonObjectButDefined = string | boolean | symbol | null;
6
+
7
+ export type ObjectWithoutKey = Omit<KeyValueObject, 'key'>;
8
+
9
+ export type ObjectWithNonNumberKey = {
10
+ [key: string]: any;
11
+ key: string | boolean | symbol | null | object | undefined;
12
+ };
13
+
14
+ export type ObjectWithNumberKey = {
15
+ [key: string]: any;
16
+ key: number;
17
+ };
18
+
19
+ export type RestrictValByKey =
20
+ | NonNumberNonObjectButDefined
21
+ | ObjectWithoutKey
22
+ | ObjectWithNonNumberKey
23
+ | ObjectWithNumberKey;
24
+
25
+ export type DummyAny =
26
+ | string
27
+ | number
28
+ | boolean
29
+ | null
30
+ | undefined
31
+ | object
32
+ | symbol
33
+ | void
34
+ | ((...args: []) => any)
35
+ | never;
@@ -0,0 +1,2 @@
1
+ export * from './utils';
2
+ export * from './number';
@@ -0,0 +1,22 @@
1
+ /**
2
+ * The function `toBinaryString` converts a number to a binary string representation with a specified
3
+ * number of digits.
4
+ * @param {number} num - The `num` parameter in the `toBinaryString` function represents the number
5
+ * that you want to convert to a binary string.
6
+ * @param [digit=32] - The `digit` parameter in the `toBinaryString` function represents the number of
7
+ * digits the binary string should have. By default, it is set to 32, meaning that the binary string
8
+ * will be padded with zeros at the beginning to ensure it is 32 bits long. You can provide a
9
+ * @returns The function `toBinaryString` takes a number as input and converts it to a binary string
10
+ * representation with a specified number of digits (default is 32). The binary string is padded with
11
+ * zeros at the beginning to ensure it has the specified number of digits. The function returns the
12
+ * binary string representation of the input number.
13
+ */
14
+ export function toBinaryString(num: number, digit = 32) {
15
+ // Convert number to binary string
16
+ let binaryString = (num >>> 0).toString(2); // Use the unsigned right shift operator to ensure you get a binary representation of a 32-bit unsigned integer
17
+
18
+ // Use pad Start to ensure the string length is 32 bits
19
+ binaryString = binaryString.padStart(digit, '0');
20
+
21
+ return binaryString;
22
+ }
@@ -0,0 +1,350 @@
1
+ /**
2
+ * data-structure-typed
3
+ *
4
+ * @author Pablo Zeng
5
+ * @copyright Copyright (c) 2022 Pablo Zeng <zrwusa@gmail.com>
6
+ * @license MIT License
7
+ */
8
+ import type { Comparable, ComparablePrimitive, Trampoline, TrampolineThunk } from '../types';
9
+
10
+ /**
11
+ * The function generates a random UUID (Universally Unique Identifier) in TypeScript.
12
+ * @returns A randomly generated UUID (Universally Unique Identifier) in the format
13
+ * 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' where each 'x' is replaced with a random hexadecimal
14
+ * character.
15
+ */
16
+ export const uuidV4 = function () {
17
+ return 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'.replace(/[x]/g, function (c) {
18
+ const r = (Math.random() * 16) | 0,
19
+ v = c == 'x' ? r : (r & 0x3) | 0x8;
20
+ return v.toString(16);
21
+ });
22
+ };
23
+
24
+ /**
25
+ * The `arrayRemove` function removes elements from an array based on a specified predicate function
26
+ * and returns the removed elements.
27
+ * @param {T[]} array - An array of elements that you want to filter based on the provided predicate
28
+ * function.
29
+ * @param predicate - The `predicate` parameter is a function that takes three arguments:
30
+ * @returns The `arrayRemove` function returns an array containing the elements that satisfy the given
31
+ * `predicate` function.
32
+ */
33
+ export const arrayRemove = function <T>(array: T[], predicate: (item: T, index: number, array: T[]) => boolean): T[] {
34
+ let i = -1,
35
+ len = array ? array.length : 0;
36
+ const result = [];
37
+
38
+ while (++i < len) {
39
+ const value = array[i];
40
+ if (predicate(value, i, array)) {
41
+ result.push(value);
42
+ Array.prototype.splice.call(array, i--, 1);
43
+ len--;
44
+ }
45
+ }
46
+
47
+ return result;
48
+ };
49
+
50
+ /**
51
+ * The function `getMSB` returns the most significant bit of a given number.
52
+ * @param {number} value - The `value` parameter is a number for which we want to find the position of
53
+ * the Most Significant Bit (MSB). The function `getMSB` takes this number as input and calculates the
54
+ * position of the MSB in its binary representation.
55
+ * @returns The function `getMSB` returns the most significant bit (MSB) of the input `value`. If the
56
+ * input value is less than or equal to 0, it returns 0. Otherwise, it calculates the position of the
57
+ * MSB using the `Math.clz32` function and bitwise left shifts 1 to that position.
58
+ */
59
+ export const getMSB = (value: number): number => {
60
+ if (value <= 0) {
61
+ return 0;
62
+ }
63
+ return 1 << (31 - Math.clz32(value));
64
+ };
65
+
66
+ /**
67
+ * The `rangeCheck` function in TypeScript is used to validate if an index is within a specified range
68
+ * and throws a `RangeError` with a custom message if it is out of bounds.
69
+ * @param {number} index - The `index` parameter represents the value that you want to check if it
70
+ * falls within a specified range.
71
+ * @param {number} min - The `min` parameter represents the minimum value that the `index` should be
72
+ * compared against in the `rangeCheck` function.
73
+ * @param {number} max - The `max` parameter in the `rangeCheck` function represents the maximum value
74
+ * that the `index` parameter is allowed to have. If the `index` is greater than this `max` value, a
75
+ * `RangeError` will be thrown.
76
+ * @param [message=Index out of bounds.] - The `message` parameter is a string that represents the
77
+ * error message to be thrown if the index is out of bounds. By default, if no message is provided when
78
+ * calling the `rangeCheck` function, the message "Index out of bounds." will be used.
79
+ */
80
+ export const rangeCheck = (index: number, min: number, max: number, message = 'Index out of bounds.'): void => {
81
+ if (index < min || index > max) throw new RangeError(message);
82
+ };
83
+
84
+ /**
85
+ * The function `throwRangeError` throws a RangeError with a custom message if called.
86
+ * @param [message=The value is off-limits.] - The `message` parameter is a string that represents the
87
+ * error message to be displayed when a `RangeError` is thrown. If no message is provided, the default
88
+ * message is 'The value is off-limits.'.
89
+ */
90
+ export const throwRangeError = (message = 'The value is off-limits.'): void => {
91
+ throw new RangeError(message);
92
+ };
93
+
94
+ /**
95
+ * The function `isWeakKey` checks if the input is an object or a function in TypeScript.
96
+ * @param {unknown} input - The `input` parameter in the `isWeakKey` function is of type `unknown`,
97
+ * which means it can be any type. The function checks if the `input` is an object (excluding `null`)
98
+ * or a function, and returns a boolean indicating whether the `input` is a weak
99
+ * @returns The function `isWeakKey` returns a boolean value indicating whether the input is an object
100
+ * or a function.
101
+ */
102
+ export const isWeakKey = (input: unknown): input is object => {
103
+ const inputType = typeof input;
104
+ return (inputType === 'object' && input !== null) || inputType === 'function';
105
+ };
106
+
107
+ /**
108
+ * The function `calcMinUnitsRequired` calculates the minimum number of units required to accommodate a
109
+ * given total quantity based on a specified unit size.
110
+ * @param {number} totalQuantity - The `totalQuantity` parameter represents the total quantity of items
111
+ * that need to be processed or handled.
112
+ * @param {number} unitSize - The `unitSize` parameter represents the size of each unit or package. It
113
+ * is used in the `calcMinUnitsRequired` function to calculate the minimum number of units required to
114
+ * accommodate a total quantity of items.
115
+ */
116
+ export const calcMinUnitsRequired = (totalQuantity: number, unitSize: number) =>
117
+ Math.floor((totalQuantity + unitSize - 1) / unitSize);
118
+
119
+ /**
120
+ * The `roundFixed` function in TypeScript rounds a number to a specified number of decimal places.
121
+ * @param {number} num - The `num` parameter is a number that you want to round to a certain number of
122
+ * decimal places.
123
+ * @param {number} [digit=10] - The `digit` parameter in the `roundFixed` function specifies the number
124
+ * of decimal places to round the number to. By default, it is set to 10 if not provided explicitly.
125
+ * @returns The function `roundFixed` returns a number that is rounded to the specified number of
126
+ * decimal places (default is 10 decimal places).
127
+ */
128
+ export const roundFixed = (num: number, digit: number = 10) => {
129
+ const multiplier = Math.pow(10, digit);
130
+ return Math.round(num * multiplier) / multiplier;
131
+ };
132
+
133
+ /**
134
+ * The function `isPrimitiveComparable` checks if a value is a primitive type that can be compared.
135
+ * @param {unknown} value - The `value` parameter in the `isPrimitiveComparable` function is of type
136
+ * `unknown`, which means it can be any type. The function checks if the `value` is a primitive type
137
+ * that can be compared, such as number, bigint, string, or boolean.
138
+ * @returns The function `isPrimitiveComparable` returns a boolean value indicating whether the input
139
+ * `value` is a primitive value that can be compared using standard comparison operators (<, >, <=,
140
+ * >=).
141
+ */
142
+ function isPrimitiveComparable(value: unknown): value is ComparablePrimitive {
143
+ const valueType = typeof value;
144
+ if (valueType === 'number') return true;
145
+ // if (valueType === 'number') return !Number.isNaN(value);
146
+ return valueType === 'bigint' || valueType === 'string' || valueType === 'boolean';
147
+ }
148
+
149
+ /**
150
+ * The function `tryObjectToPrimitive` attempts to convert an object to a comparable primitive value by
151
+ * first checking the `valueOf` method and then the `toString` method.
152
+ * @param {object} obj - The `obj` parameter in the `tryObjectToPrimitive` function is an object that
153
+ * you want to convert to a primitive value. The function attempts to convert the object to a primitive
154
+ * value by first checking if the object has a `valueOf` method. If the `valueOf` method exists, it
155
+ * @returns The function `tryObjectToPrimitive` returns a value of type `ComparablePrimitive` if a
156
+ * primitive comparable value is found within the object, or a string value if the object has a custom
157
+ * `toString` method that does not return `'[object Object]'`. If neither condition is met, the
158
+ * function returns `null`.
159
+ */
160
+ function tryObjectToPrimitive(obj: object): ComparablePrimitive | null {
161
+ if (typeof obj.valueOf === 'function') {
162
+ const valueOfResult = obj.valueOf();
163
+ if (valueOfResult !== obj) {
164
+ if (isPrimitiveComparable(valueOfResult)) return valueOfResult;
165
+ if (typeof valueOfResult === 'object' && valueOfResult !== null) return tryObjectToPrimitive(valueOfResult);
166
+ }
167
+ }
168
+ if (typeof obj.toString === 'function') {
169
+ const stringResult = obj.toString();
170
+ if (stringResult !== '[object Object]') return stringResult;
171
+ }
172
+ return null;
173
+ }
174
+
175
+ /**
176
+ * The function `isComparable` in TypeScript checks if a value is comparable, handling primitive values
177
+ * and objects with optional force comparison.
178
+ * @param {unknown} value - The `value` parameter in the `isComparable` function represents the value
179
+ * that you want to check if it is comparable. It can be of any type (`unknown`), and the function will
180
+ * determine if it is comparable based on certain conditions.
181
+ * @param [isForceObjectComparable=false] - The `isForceObjectComparable` parameter in the
182
+ * `isComparable` function is a boolean flag that determines whether to treat non-primitive values as
183
+ * comparable objects. When set to `true`, it forces the function to consider non-primitive values as
184
+ * comparable objects, regardless of their type.
185
+ * @returns The function `isComparable` returns a boolean value indicating whether the `value` is
186
+ * considered comparable or not.
187
+ */
188
+ export function isComparable(value: unknown, isForceObjectComparable = false): value is Comparable {
189
+ if (value === null || value === undefined) return false;
190
+ if (isPrimitiveComparable(value)) return true;
191
+
192
+ if (typeof value !== 'object') return false;
193
+ if (value instanceof Date) return true;
194
+ // if (value instanceof Date) return !Number.isNaN(value.getTime());
195
+ if (isForceObjectComparable) return true;
196
+ const comparableValue = tryObjectToPrimitive(value);
197
+ if (comparableValue === null || comparableValue === undefined) return false;
198
+ return isPrimitiveComparable(comparableValue);
199
+ }
200
+
201
+ /**
202
+ * Creates a trampoline thunk object.
203
+ *
204
+ * A "thunk" is a deferred computation — instead of performing a recursive call immediately,
205
+ * it wraps the next step of the computation in a function. This allows recursive processes
206
+ * to be executed iteratively, preventing stack overflows.
207
+ *
208
+ * @template T - The type of the final computation result.
209
+ * @param computation - A function that, when executed, returns the next trampoline step.
210
+ * @returns A TrampolineThunk object containing the deferred computation.
211
+ */
212
+ export const makeTrampolineThunk = <T>(computation: () => Trampoline<T>): TrampolineThunk<T> => ({
213
+ isThunk: true, // Marker indicating this is a thunk
214
+ fn: computation // The deferred computation function
215
+ });
216
+
217
+ /**
218
+ * Type guard to check whether a given value is a TrampolineThunk.
219
+ *
220
+ * This function is used to distinguish between a final computation result (value)
221
+ * and a deferred computation (thunk).
222
+ *
223
+ * @template T - The type of the value being checked.
224
+ * @param value - The value to test.
225
+ * @returns True if the value is a valid TrampolineThunk, false otherwise.
226
+ */
227
+ export const isTrampolineThunk = <T>(value: Trampoline<T>): value is TrampolineThunk<T> =>
228
+ typeof value === 'object' && // Must be an object
229
+ value !== null && // Must not be null
230
+ 'isThunk' in value && // Must have the 'isThunk' property
231
+ value.isThunk; // The flag must be true
232
+
233
+ /**
234
+ * Executes a trampoline computation until a final (non-thunk) result is obtained.
235
+ *
236
+ * The trampoline function repeatedly invokes the deferred computations (thunks)
237
+ * in an iterative loop. This avoids deep recursive calls and prevents stack overflow,
238
+ * which is particularly useful for implementing recursion in a stack-safe manner.
239
+ *
240
+ * @template T - The type of the final result.
241
+ * @param initial - The initial Trampoline value or thunk to start execution from.
242
+ * @returns The final result of the computation (a non-thunk value).
243
+ */
244
+ export function trampoline<T>(initial: Trampoline<T>): T {
245
+ let current = initial; // Start with the initial trampoline value
246
+ while (isTrampolineThunk(current)) {
247
+ // Keep unwrapping while we have thunks
248
+ current = current.fn(); // Execute the deferred function to get the next step
249
+ }
250
+ return current; // Once no thunks remain, return the final result
251
+ }
252
+
253
+ /**
254
+ * Wraps a recursive function inside a trampoline executor.
255
+ *
256
+ * This function transforms a potentially recursive function (that returns a Trampoline<Result>)
257
+ * into a *stack-safe* function that executes iteratively using the `trampoline` runner.
258
+ *
259
+ * In other words, it allows you to write functions that look recursive,
260
+ * but actually run in constant stack space.
261
+ *
262
+ * @template Args - The tuple type representing the argument list of the original function.
263
+ * @template Result - The final return type after all trampoline steps are resolved.
264
+ *
265
+ * @param fn - A function that performs a single step of computation
266
+ * and returns a Trampoline (either a final value or a deferred thunk).
267
+ *
268
+ * @returns A new function with the same arguments, but which automatically
269
+ * runs the trampoline process and returns the *final result* instead
270
+ * of a Trampoline.
271
+ *
272
+ * @example
273
+ * // Example: Computing factorial in a stack-safe way
274
+ * const factorial = makeTrampoline(function fact(n: number, acc: number = 1): Trampoline<number> {
275
+ * return n === 0
276
+ * ? acc
277
+ * : makeTrampolineThunk(() => fact(n - 1, acc * n));
278
+ * });
279
+ *
280
+ * console.log(factorial(100000)); // Works without stack overflow
281
+ */
282
+ export function makeTrampoline<Args extends any[], Result>(
283
+ fn: (...args: Args) => Trampoline<Result> // A function that returns a trampoline step
284
+ ): (...args: Args) => Result {
285
+ // Return a wrapped function that automatically runs the trampoline execution loop
286
+ return (...args: Args) => trampoline(fn(...args));
287
+ }
288
+
289
+ /**
290
+ * Executes an asynchronous trampoline computation until a final (non-thunk) result is obtained.
291
+ *
292
+ * This function repeatedly invokes asynchronous deferred computations (thunks)
293
+ * in an iterative loop. Each thunk may return either a Trampoline<T> or a Promise<Trampoline<T>>.
294
+ *
295
+ * It ensures that asynchronous recursive functions can run without growing the call stack,
296
+ * making it suitable for stack-safe async recursion.
297
+ *
298
+ * @template T - The type of the final result.
299
+ * @param initial - The initial Trampoline or Promise of Trampoline to start execution from.
300
+ * @returns A Promise that resolves to the final result (a non-thunk value).
301
+ */
302
+ export async function asyncTrampoline<T>(initial: Trampoline<T> | Promise<Trampoline<T>>): Promise<T> {
303
+ let current = await initial; // Wait for the initial step to resolve if it's a Promise
304
+
305
+ // Keep executing thunks until we reach a non-thunk (final) value
306
+ while (isTrampolineThunk(current)) {
307
+ current = await current.fn(); // Execute the thunk function (may be async)
308
+ }
309
+
310
+ // Once the final value is reached, return it
311
+ return current;
312
+ }
313
+
314
+ /**
315
+ * Wraps an asynchronous recursive function inside an async trampoline executor.
316
+ *
317
+ * This helper transforms a recursive async function that returns a Trampoline<Result>
318
+ * (or Promise<Trampoline<Result>>) into a *stack-safe* async function that executes
319
+ * iteratively via the `asyncTrampoline` runner.
320
+ *
321
+ * @template Args - The tuple type representing the argument list of the original function.
322
+ * @template Result - The final return type after all async trampoline steps are resolved.
323
+ *
324
+ * @param fn - An async or sync function that performs a single step of computation
325
+ * and returns a Trampoline (either a final value or a deferred thunk).
326
+ *
327
+ * @returns An async function with the same arguments, but which automatically
328
+ * runs the trampoline process and resolves to the *final result*.
329
+ *
330
+ * @example
331
+ * // Example: Async factorial using trampoline
332
+ * const asyncFactorial = makeAsyncTrampoline(async function fact(
333
+ * n: number,
334
+ * acc: number = 1
335
+ * ): Promise<Trampoline<number>> {
336
+ * return n === 0
337
+ * ? acc
338
+ * : makeTrampolineThunk(() => fact(n - 1, acc * n));
339
+ * });
340
+ *
341
+ * asyncFactorial(100000).then(console.log); // Works without stack overflow
342
+ */
343
+ export function makeAsyncTrampoline<Args extends any[], Result>(
344
+ fn: (...args: Args) => Trampoline<Result> | Promise<Trampoline<Result>>
345
+ ): (...args: Args) => Promise<Result> {
346
+ // Return a wrapped async function that runs through the async trampoline loop
347
+ return async (...args: Args): Promise<Result> => {
348
+ return asyncTrampoline(fn(...args));
349
+ };
350
+ }
@@ -0,0 +1,111 @@
1
+ import {RedBlackTree} from '../src';
2
+
3
+ describe('Red Black Tree Test', () => {
4
+ it('should perform various operations on a Red Black Tree', () => {
5
+
6
+ const arr = [11, 3, 15, 1, 8, 13, 16, 2, 6, 9, 12, 14, 4, 7, 10, 5];
7
+ const tree = new RedBlackTree();
8
+
9
+ for (const i of arr) tree.add(i, i);
10
+
11
+ const node6 = tree.get(6);
12
+
13
+ expect(node6 && tree.getHeight(node6)).toBe(3);
14
+ expect(node6 && tree.getDepth(node6)).toBe(1);
15
+
16
+ const getNodeById = tree.get(10, 'id');
17
+ expect(getNodeById?.id).toBe(10);
18
+
19
+
20
+ const getMinNodeByRoot = tree.getLeftMost();
21
+ expect(getMinNodeByRoot?.id).toBe(1);
22
+
23
+ const node15 = tree.get(15);
24
+ const getMinNodeBySpecificNode = node15 && tree.getLeftMost(node15);
25
+ expect(getMinNodeBySpecificNode?.id).toBe(12);
26
+
27
+ const subTreeSum = node15 && tree.subTreeSum(node15);
28
+ expect(subTreeSum).toBe(70);
29
+
30
+ const lesserSum = tree.lesserSum(10);
31
+ expect(lesserSum).toBe(45);
32
+
33
+
34
+ // node15 has type problem. After the uniform design, the generics of containers (DirectedGraph, BST) are based on the type of value. However, this design has a drawback: when I attempt to inherit from the Vertex or BSTNode classes, the types of the results obtained by all methods are those of the parent class.
35
+ expect(node15?.val).toBe(15);
36
+
37
+ const dfs = tree.DFS('in', 'node');
38
+ expect(dfs[0].id).toBe(1);
39
+ expect(dfs[dfs.length - 1].id).toBe(16);
40
+
41
+ tree.perfectlyBalance();
42
+ const bfs = tree.BFS('node');
43
+ expect(tree.isPerfectlyBalanced()).toBe(true);
44
+ expect(bfs[0].id).toBe(8);
45
+ expect(bfs[bfs.length - 1].id).toBe(16);
46
+
47
+ expect(tree.remove(11)[0].deleted?.id).toBe(11);
48
+ expect(tree.isAVLBalanced()).toBe(true);
49
+ expect(node15 && tree.getHeight(node15)).toBe(2);
50
+
51
+ expect(tree.remove(1)[0].deleted?.id).toBe(1);
52
+ expect(tree.isAVLBalanced()).toBe(true);
53
+ expect(tree.getHeight()).toBe(4);
54
+
55
+ expect(tree.remove(4)[0].deleted?.id).toBe(4);
56
+ expect(tree.isAVLBalanced()).toBe(true);
57
+ expect(tree.getHeight()).toBe(4);
58
+
59
+ expect(tree.remove(10)[0].deleted?.id).toBe(10);
60
+ expect(tree.isAVLBalanced()).toBe(true);
61
+ expect(tree.getHeight()).toBe(3);
62
+
63
+ expect(tree.remove(15)[0].deleted?.id).toBe(15);
64
+ expect(tree.isAVLBalanced()).toBe(true);
65
+
66
+ expect(tree.getHeight()).toBe(3);
67
+
68
+ expect(tree.remove(5)[0].deleted?.id).toBe(5);
69
+ expect(tree.isAVLBalanced()).toBe(true);
70
+ expect(tree.getHeight()).toBe(3);
71
+
72
+ expect(tree.remove(13)[0].deleted?.id).toBe(13);
73
+ expect(tree.isAVLBalanced()).toBe(true);
74
+ expect(tree.getHeight()).toBe(3);
75
+
76
+ expect(tree.remove(3)[0].deleted?.id).toBe(3);
77
+ expect(tree.isAVLBalanced()).toBe(true);
78
+ expect(tree.getHeight()).toBe(3);
79
+
80
+ expect(tree.remove(8)[0].deleted?.id).toBe(8);
81
+ expect(tree.isAVLBalanced()).toBe(true);
82
+ expect(tree.getHeight()).toBe(3);
83
+
84
+ expect(tree.remove(6)[0].deleted?.id).toBe(6);
85
+ expect(tree.remove(6).length).toBe(0);
86
+ expect(tree.isAVLBalanced()).toBe(true);
87
+ expect(tree.getHeight()).toBe(2);
88
+
89
+ expect(tree.remove(7)[0].deleted?.id).toBe(7);
90
+ expect(tree.isAVLBalanced()).toBe(true);
91
+ expect(tree.getHeight()).toBe(2);
92
+
93
+ expect(tree.remove(9)[0].deleted?.id).toBe(9);
94
+ expect(tree.isAVLBalanced()).toBe(true);
95
+ expect(tree.getHeight()).toBe(2);
96
+ expect(tree.remove(14)[0].deleted?.id).toBe(14);
97
+ expect(tree.isAVLBalanced()).toBe(true);
98
+ expect(tree.getHeight()).toBe(1);
99
+
100
+ expect(tree.isAVLBalanced()).toBe(true);
101
+ const lastBFSIds = tree.BFS();
102
+ expect(lastBFSIds[0]).toBe(12);
103
+ expect(lastBFSIds[1]).toBe(2);
104
+ expect(lastBFSIds[2]).toBe(16);
105
+
106
+ const lastBFSNodes = tree.BFS('node');
107
+ expect(lastBFSNodes[0].id).toBe(12);
108
+ expect(lastBFSNodes[1].id).toBe(2);
109
+ expect(lastBFSNodes[2].id).toBe(16);
110
+ });
111
+ });
@@ -0,0 +1,23 @@
1
+ {
2
+ "compilerOptions": {
3
+ "allowJs": true,
4
+ "allowSyntheticDefaultImports": true,
5
+ "baseUrl": "./",
6
+ "declaration": true,
7
+ "esModuleInterop": true,
8
+ "inlineSourceMap": false,
9
+ "lib": ["esnext"],
10
+ "listEmittedFiles": false,
11
+ "listFiles": false,
12
+ "noFallthroughCasesInSwitch": true,
13
+ "pretty": true,
14
+ "resolveJsonModule": true,
15
+ "skipLibCheck": true,
16
+ "strict": true,
17
+ "traceResolution": false,
18
+ "noImplicitOverride": true,
19
+ "types": ["node"]
20
+ },
21
+ "compileOnSave": false,
22
+ "exclude": ["node_modules", "dist"]
23
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,12 @@
1
+ {
2
+ "extends": "./tsconfig.base.json",
3
+ "compilerOptions": {
4
+ "rootDir": "./",
5
+ "outDir": "dist/dev",
6
+ "module": "NodeNext",
7
+ "target": "ESNext",
8
+ "moduleResolution": "NodeNext",
9
+ "sourceMap": true
10
+ },
11
+ "include": ["./src/**/*.ts"]
12
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "extends": "./tsconfig.json",
3
+ "compilerOptions": {
4
+ "noEmit": true,
5
+ "types": ["node", "jest"]
6
+ },
7
+ "include": ["./test/**/*.ts"]
8
+ }