Skip to content

Commit 4ea83bc

Browse files
authored
Switched the any type to unknown (#15)
1 parent 98ec4c1 commit 4ea83bc

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@microcode/pathtree",
3-
"version": "0.2.3",
3+
"version": "0.3.0",
44
"description": "Fast search tree for arbitrary paths",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",

src/IPathNode.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ export interface IPathNode {
1313

1414
attachToParent(parent: IPathNode): void;
1515

16-
data: any | null;
16+
data?: unknown;
1717
}

src/PathNode.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export class PathNode implements IPathNode {
1111
private _isWildcard = false;
1212
private _isLeaf = false;
1313

14-
private _data: any | null = null;
14+
private _data?: unknown = undefined;
1515

1616
constructor(key: string) {
1717
this._key = key;
@@ -45,11 +45,11 @@ export class PathNode implements IPathNode {
4545
this._isLeaf = v;
4646
}
4747

48-
get data(): any {
48+
get data(): unknown | undefined {
4949
return this._data;
5050
}
5151

52-
set data(data: any) {
52+
set data(data: unknown | undefined) {
5353
if (!this.isLeaf) {
5454
throw new Error("Cannot store data in non-leaf node");
5555
}

0 commit comments

Comments
 (0)