diff --git a/README.md b/README.md
index 3eedb83..e8df0d6 100644
--- a/README.md
+++ b/README.md
@@ -46,7 +46,7 @@ wide range of data structures
Tree Multiset |
|
|
-TreeMultiSet |
+TreeMultiset |
|
diff --git a/package-lock.json b/package-lock.json
index e08f5a2..07a9d0f 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,13 +1,16 @@
{
"name": "data-structure-typed",
- "version": "1.18.7",
+ "version": "1.18.8",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "data-structure-typed",
- "version": "1.18.7",
+ "version": "1.18.8",
"license": "MIT",
+ "dependencies": {
+ "zod": "^3.22.2"
+ },
"devDependencies": {
"@types/jest": "^29.5.3",
"@types/node": "^20.4.9",
@@ -5768,6 +5771,14 @@
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
+ },
+ "node_modules/zod": {
+ "version": "3.22.2",
+ "resolved": "https://registry.npmjs.org/zod/-/zod-3.22.2.tgz",
+ "integrity": "sha512-wvWkphh5WQsJbVk1tbx1l1Ly4yg+XecD+Mq280uBGt9wa5BKSWf4Mhp6GmrkPixhMxmabYY7RbzlwVP32pbGCg==",
+ "funding": {
+ "url": "https://github.com/sponsors/colinhacks"
+ }
}
}
}
diff --git a/package.json b/package.json
index e0ad0e5..447fd46 100644
--- a/package.json
+++ b/package.json
@@ -63,5 +63,8 @@
"ts-jest": "^29.1.1",
"typedoc": "^0.24.8",
"typescript": "^4.9.5"
+ },
+ "dependencies": {
+ "zod": "^3.22.2"
}
}
diff --git a/src/data-structures/binary-tree/tree-multiset.ts b/src/data-structures/binary-tree/tree-multiset.ts
index e454055..7fceb64 100644
--- a/src/data-structures/binary-tree/tree-multiset.ts
+++ b/src/data-structures/binary-tree/tree-multiset.ts
@@ -5,11 +5,11 @@
* @copyright Copyright (c) 2022 Tyler Zeng
* @license MIT License
*/
-import type {BinaryTreeNodeId, TreeMultiSetNodeNested, TreeMultiSetOptions} from '../types';
-import {ITreeMultiSet, ITreeMultiSetNode} from '../interfaces';
+import type {BinaryTreeNodeId, TreeMultisetNodeNested, TreeMultisetOptions} from '../types';
+import {ITreeMultiset, ITreeMultisetNode} from '../interfaces';
import {AVLTree, AVLTreeNode} from './avl-tree';
-export class TreeMultiSetNode = TreeMultiSetNodeNested> extends AVLTreeNode implements ITreeMultiSetNode {
+export class TreeMultisetNode = TreeMultisetNodeNested> extends AVLTreeNode implements ITreeMultisetNode {
/**
* The function creates a new node in a binary tree with an optional value and count.
* @param {BinaryTreeNodeId} id - The `id` parameter is the identifier for the binary tree node. It is used to uniquely
@@ -18,18 +18,18 @@ export class TreeMultiSetNode = TreeMultiSetNode> extends AVLTree implements ITreeMultiSet {
- constructor(options?: TreeMultiSetOptions) {
+export class TreeMultiset = TreeMultisetNode> extends AVLTree implements ITreeMultiset {
+ constructor(options?: TreeMultisetOptions) {
super({...options, isMergeDuplicatedVal: true});
}
@@ -43,6 +43,6 @@ export class TreeMultiSet = TreeMultiSet
* @returns A new instance of the BSTNode class with the specified id, value, and count (if provided).
*/
override createNode(id: BinaryTreeNodeId, val?: N['val'], count?: number): N {
- return new TreeMultiSetNode(id, val, count) as N;
+ return new TreeMultisetNode(id, val, count) as N;
}
}
diff --git a/src/data-structures/interfaces/tree-multiset.ts b/src/data-structures/interfaces/tree-multiset.ts
index 72d9c3e..32fe4dd 100644
--- a/src/data-structures/interfaces/tree-multiset.ts
+++ b/src/data-structures/interfaces/tree-multiset.ts
@@ -1,12 +1,12 @@
-import {TreeMultiSetNode} from '../binary-tree';
+import {TreeMultisetNode} from '../binary-tree';
import {IBSTNode} from './bst';
import {IAVLTree} from './avl-tree';
-export interface ITreeMultiSetNode> extends IBSTNode {
+export interface ITreeMultisetNode> extends IBSTNode {
}
-export interface ITreeMultiSet> extends IAVLTree {
+export interface ITreeMultiset> extends IAVLTree {
}
\ No newline at end of file
diff --git a/src/data-structures/types/tree-multiset.ts b/src/data-structures/types/tree-multiset.ts
index b65f64f..89e994d 100644
--- a/src/data-structures/types/tree-multiset.ts
+++ b/src/data-structures/types/tree-multiset.ts
@@ -1,8 +1,8 @@
-import {TreeMultiSetNode} from '../binary-tree';
+import {TreeMultisetNode} from '../binary-tree';
import {AVLTreeOptions} from './avl-tree';
-export type TreeMultiSetNodeNested = TreeMultiSetNode>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+export type TreeMultisetNodeNested = TreeMultisetNode>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-export type TreeMultiSetOptions = Omit & {
+export type TreeMultisetOptions = Omit & {
isMergeDuplicatedVal: true,
}
diff --git a/src/utils/index.ts b/src/utils/index.ts
index be7aaf8..7e60a97 100644
--- a/src/utils/index.ts
+++ b/src/utils/index.ts
@@ -1,2 +1,3 @@
export * from './utils';
-export * from './types';
\ No newline at end of file
+export * from './types';
+export * from './validate-type';
\ No newline at end of file
diff --git a/src/utils/types/index.ts b/src/utils/types/index.ts
index 038522d..4ecd603 100644
--- a/src/utils/types/index.ts
+++ b/src/utils/types/index.ts
@@ -1 +1,2 @@
-export * from './utils';
\ No newline at end of file
+export * from './utils';
+export * from './validate-type';
\ No newline at end of file
diff --git a/src/utils/types/utils.ts b/src/utils/types/utils.ts
index 78403d6..dc1f129 100644
--- a/src/utils/types/utils.ts
+++ b/src/utils/types/utils.ts
@@ -4,30 +4,3 @@ export type TrlFn = (...args: any[]) => any;
export type TrlAsyncFn = (...args: any[]) => any;
export type SpecifyOptional = Omit & Partial>;
-
-export type KeyValueObject = { [key: string]: any };
-
-export type KeyValueObjectWithId = { [key: string]: any, id: string | number | symbol };
-
-export type NonNumberNonObjectButDefined = string | boolean | symbol | null;
-
-// export type ObjectWithoutId = Omit