Skip to content

Commit ca588fc

Browse files
authored
Merge pull request #338 from Nexters/develop
[운영배포] 스킴 오타 수정
2 parents 90afcdd + f7682a2 commit ca588fc

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed
Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
const BASE_SCHEME = 'boolti://';
2+
3+
interface SchemeOptions {
4+
path: string;
5+
query?: Record<string, string | number | boolean | undefined>;
6+
}
7+
8+
export function createAppScheme({ path, query }: SchemeOptions) {
9+
const queryString = query
10+
? '?' +
11+
Object.entries(query)
12+
.filter(([, v]) => v !== undefined)
13+
.map(([k, v]) => `${encodeURIComponent(k)}=${encodeURIComponent(String(v))}`)
14+
.join('&')
15+
: '';
16+
return `${BASE_SCHEME}${path}${queryString}`;
17+
}
18+
119
export const SCHEMES = {
2-
선물_등록: (giftId: string) => `boolti:///gift/${giftId}`,
20+
선물_등록: (giftId: string) => createAppScheme({ path: `gift/${giftId}` }),
321
};

0 commit comments

Comments
 (0)