add TupleKey class

This commit is contained in:
2025-01-29 16:57:00 -08:00
parent 0bd85ce305
commit 7de1fd757e

19
src/types/TupleKey.ts Normal file
View File

@@ -0,0 +1,19 @@
const separator = "|";
export class TupleKey<T extends any[]> {
public readonly tuple: T;
private readonly strKey: string;
constructor(...tuple: T) {
this.tuple = tuple;
this.strKey = tuple.join(separator);
}
toString(): string {
return this.strKey;
}
valueOf(): string {
return this.strKey;
}
}