INNER CODE UNIT · TypeScript
Profile
jonasstrehle/supercookie · server/main.ts:190
class Profile {
public static list: Set<Profile> = new Set<Profile>();
public static get(uid: string): Profile {
return this.has(uid) ?
Array.from(this.list).filter((profile: Profile) => profile.uid === uid)?.pop():
null;
}
public static has(uid: string): boolean {
return Array.from(this.list).some((profile: Profile) => profile.uid === uid);
}
public static from(uid: string, identifier?: number): Profile {
return !this.has(uid) ? new Profile(uid, identifier): null;
}
private _uid: string;
private _vector: Array<string>;
private _identifier: number = null;
private _visitedRoutes: Set<string> = new Set<string>();