Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions app/lib/lib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,21 @@ export function calculateKoreanInitials(word: string): string{
*/
export function count(a: string, target: string): number{
return (a.match(new RegExp(target, "gi")) || []).length
}

/**
* 미션 문자 마스크 생성 함수
*
* @param chars 문자 배열
* @returns 미션 문자 마스크
*/
export function misssionCharMask(chars: string[]): number {
Copy link

Copilot AI Dec 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The function name contains a typo: "misssionCharMask" should be "missionCharMask" (three 's' instead of two). This typo is also present in the import statement in SupabaseClientManager.ts and will need to be corrected consistently across all files where this function is imported or called.

Copilot uses AI. Check for mistakes.
let base = 0;
const missionChars = ['가','나','다','라','마','바','사','아','자','차','카','타','파','하'];
for (const c of chars) {
if (missionChars.includes(c)) {
base = base | (1 << missionChars.indexOf(c));
}
}
return base;
}
6 changes: 4 additions & 2 deletions app/lib/supabase/ISupabaseClientManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ type wait_word_themes = Database['public']['Tables']['wait_word_themes']['Row'];
type notification = Database['public']['Tables']['notification']['Row'];
type word_first_letter_counts = Database['public']['Tables']['word_first_letter_counts']['Row'];
type word_last_letter_counts = Database['public']['Tables']['word_last_letter_counts']['Row'];
type okWord = Omit<word, 'mission_mark'> & { mission_mark?: number; };

type delete_word_themes_bulk = Database['public']['Functions']['delete_word_themes_bulk']['Returns'];

Expand Down Expand Up @@ -55,7 +56,7 @@ export interface IGetManager{
docsStarCount(id: number): Promise<{ data: number; error: PostgrestError | null;}>
docsLogs(id:number): Promise<PostgrestSingleResponse<(docs_log & {users: user | null})[]>>
docsStar(id: number): Promise<PostgrestSingleResponse<{user_id: string;}[]>>;
docsWords({ name, duem, typez }: { name: string; duem: boolean; typez: "letter" | "theme";} | {name: number; duem: boolean; typez: "ect";}): Promise<{data: null, error: PostgrestError} | {data: {words: word[], waitWords: ({ word: string; request_type: "add" | "delete"; requested_by: string | null; })[]}, error: null}>
docsWords({ name, duem, typez }: { name: string; duem: boolean; typez: "letter" | "theme";} | {name: number; duem: boolean; typez: "ect";}): Promise<{data: null, error: PostgrestError} | {data: {words: okWord[], waitWords: ({ word: string; request_type: "add" | "delete"; requested_by: string | null; })[]}, error: null}>
allWaitWords(c?:"add" | "delete"): Promise<PostgrestSingleResponse<(wait_word & {words: word | null; users: user | null})[]>>;
wordsThemes(wordIds: number[]): Promise<PostgrestSingleResponse<{ theme_id: number; word_id: number; words: word; themes: theme}[]>>
allWords({ includeAddReq, includeDeleteReq, includeInjung, includeNoInjung, onlyWordChain, lenf }: { includeAddReq?: boolean; includeDeleteReq?: boolean; includeInjung?: boolean; includeNoInjung?: boolean; onlyWordChain?: boolean; lenf?: boolean; }): Promise<{ data: { word: string; noin_canuse: boolean; k_canuse: boolean; status: "ok" | "add" | "delete"; }[]; error: null } | {data: null; error: PostgrestError; }>
Expand All @@ -76,7 +77,7 @@ export interface IGetManager{
waitWordsCount(): Promise<{count: number | null; error: PostgrestError | null}>;
allWordWaitTheme(c?: "add" | "delete"): Promise<PostgrestSingleResponse<(word_themes_wait & {words: {word: string, id: number}; themes: theme; users: user | null})[]>>
waitWordsThemes(waitWordIds: number[]): Promise<PostgrestSingleResponse<(wait_word_themes & {themes: theme, wait_words:{word: string}})[]>>;
wordsByWords(words: string[]): Promise<PostgrestSingleResponse<(word&{wthemes: number[]})[]>>;
wordsByWords(words: string[]): Promise<PostgrestSingleResponse<(okWord&{wthemes: number[]})[]>>;
randomWordByFirstLetter(f: string[]): Promise<{data: string, error: null}|{data: null, error: PostgrestError}|{data: null, error: null}>;
randomWordByLastLetter(l: string[]): Promise<{data: string, error: null}|{data: null, error: PostgrestError}|{data: null, error: null}>;
wordThemeWaitByWordId(wordId: number): Promise<PostgrestSingleResponse<{themes: theme, typez: "add" | "delete"}[]>>;
Expand All @@ -93,6 +94,7 @@ export interface IGetManager{
letterCountInfo(): Promise<{data: {firstLetterCounts: Record<string, {count: number; k_count: number; n_count: number}>; lastLetterCounts: Record<string, {count: number; k_count: number; n_count: number}>;}, error: null}|{data: null; error: PostgrestError}>;
wordsByAdvancedQuery(input: advancedQueryType): Promise<{data: {word: string, nextWordCount: number}[], error: null} | {data: null; error: PostgrestError}>;
wordState(): Promise<{data: {firstLetterCounts: word_first_letter_counts[]; lastLetterCounts: word_last_letter_counts[];}, error: null}|{data: null; error: PostgrestError}>;
docsLastUpdate(id: number): Promise<PostgrestSingleResponse<{last_update: string;} | null>>
}

// delete 관련 타입
Expand Down
Loading