mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-09 04:57:04 +03:00
getUserInfo
- add info property to User - add insertWarning, Ban - add insertTitle, TitleVote, Thumbnail, ThumbnailVote - simplified insertSegments with destructuring
This commit is contained in:
@@ -5,6 +5,7 @@ import { getHash } from "../../src/utils/getHash";
|
||||
export interface User {
|
||||
privID: UserID,
|
||||
pubID: HashedUserID
|
||||
info: Record<string, any>
|
||||
}
|
||||
export type userArray = Record<string, User>
|
||||
|
||||
@@ -16,7 +17,7 @@ export type usernameUserArray = Record<string, UsernameUser>
|
||||
export const genUser = (fnname: string, testcase: string): User => {
|
||||
const privID = `${fnname}-${testcase}-${genRandom(2)}` as UserID;
|
||||
const pubID = getHash(privID);
|
||||
return { privID, pubID };
|
||||
return { privID, pubID, info: {} };
|
||||
};
|
||||
|
||||
export const genUsers = (fnname: string, testcase: string[]): userArray => {
|
||||
|
||||
Reference in New Issue
Block a user