dn-react-router-toolkit 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/auth-kit/apple_auth.d.mts +24 -0
- package/dist/{esm/auth-kit → auth-kit}/apple_auth.d.ts +11 -2
- package/dist/auth-kit/apple_auth.js +75 -0
- package/dist/auth-kit/apple_auth.mjs +50 -0
- package/dist/auth-kit/auth_service.d.mts +73 -0
- package/dist/{esm/auth-kit → auth-kit}/auth_service.d.ts +17 -11
- package/dist/auth-kit/auth_service.js +257 -0
- package/dist/auth-kit/auth_service.mjs +218 -0
- package/dist/auth-kit/client/google_login_button.d.mts +9 -0
- package/dist/auth-kit/client/google_login_button.d.ts +9 -0
- package/dist/auth-kit/client/google_login_button.js +67 -0
- package/dist/auth-kit/client/google_login_button.mjs +32 -0
- package/dist/auth-kit/client/redirect_page.d.mts +5 -0
- package/dist/auth-kit/client/redirect_page.d.ts +5 -0
- package/dist/auth-kit/client/redirect_page.js +53 -0
- package/dist/auth-kit/client/redirect_page.mjs +18 -0
- package/dist/auth-kit/google_auth.d.mts +27 -0
- package/dist/{esm/auth-kit → auth-kit}/google_auth.d.ts +11 -2
- package/dist/auth-kit/google_auth.js +144 -0
- package/dist/auth-kit/google_auth.mjs +117 -0
- package/dist/auth-kit/jwt.d.mts +18 -0
- package/dist/{esm/auth-kit → auth-kit}/jwt.d.ts +5 -2
- package/dist/auth-kit/jwt.js +76 -0
- package/dist/auth-kit/jwt.mjs +51 -0
- package/dist/auth-kit/kakao_auth.d.mts +24 -0
- package/dist/{esm/auth-kit → auth-kit}/kakao_auth.d.ts +11 -2
- package/dist/auth-kit/kakao_auth.js +115 -0
- package/dist/auth-kit/kakao_auth.mjs +88 -0
- package/dist/auth-kit/repository.d.mts +42 -0
- package/dist/{esm/auth-kit → auth-kit}/repository.d.ts +3 -1
- package/dist/auth-kit/repository.js +18 -0
- package/dist/auth-kit/repository.mjs +0 -0
- package/dist/auth-kit/with_auth.d.mts +17 -0
- package/dist/auth-kit/with_auth.d.ts +17 -0
- package/dist/auth-kit/with_auth.js +108 -0
- package/dist/auth-kit/with_auth.mjs +71 -0
- package/dist/cn.d.mts +3 -0
- package/dist/cn.d.ts +3 -0
- package/dist/cn.js +32 -0
- package/dist/cn.mjs +7 -0
- package/dist/components/index.d.mts +5 -0
- package/dist/components/index.d.ts +5 -0
- package/dist/components/index.js +261 -0
- package/dist/components/index.mjs +219 -0
- package/dist/components/modal/fullscreen_container.d.mts +7 -0
- package/dist/components/modal/fullscreen_container.d.ts +7 -0
- package/dist/components/modal/fullscreen_container.js +102 -0
- package/dist/components/modal/fullscreen_container.mjs +68 -0
- package/dist/components/modal/hooks.d.mts +18 -0
- package/dist/components/modal/hooks.d.ts +18 -0
- package/dist/components/modal/hooks.js +236 -0
- package/dist/components/modal/hooks.mjs +204 -0
- package/dist/components/modal/index.d.mts +4 -0
- package/dist/components/modal/index.d.ts +4 -0
- package/dist/components/modal/index.js +238 -0
- package/dist/components/modal/index.mjs +203 -0
- package/dist/components/modal/modal.d.mts +13 -0
- package/dist/components/modal/modal.d.ts +13 -0
- package/dist/components/modal/modal.js +155 -0
- package/dist/components/modal/modal.mjs +130 -0
- package/dist/components/styles.d.mts +9 -0
- package/dist/components/styles.d.ts +9 -0
- package/dist/components/styles.js +48 -0
- package/dist/components/styles.mjs +17 -0
- package/dist/date.d.mts +3 -0
- package/dist/date.d.ts +3 -0
- package/dist/date.js +63 -0
- package/dist/date.mjs +28 -0
- package/dist/file-kit/cdn.d.mts +5 -0
- package/dist/file-kit/cdn.d.ts +5 -0
- package/dist/file-kit/cdn.js +34 -0
- package/dist/file-kit/cdn.mjs +9 -0
- package/dist/file-kit/client/drop_file_input.d.mts +33 -0
- package/dist/{esm/file-kit → file-kit}/client/drop_file_input.d.ts +10 -8
- package/dist/file-kit/client/drop_file_input.js +235 -0
- package/dist/file-kit/client/drop_file_input.mjs +205 -0
- package/dist/file-kit/client/file_uploader.d.mts +13 -0
- package/dist/{esm/file-kit → file-kit}/client/file_uploader.d.ts +4 -2
- package/dist/file-kit/client/file_uploader.js +115 -0
- package/dist/file-kit/client/file_uploader.mjs +90 -0
- package/dist/file-kit/file_service.d.mts +26 -0
- package/dist/{esm/file-kit → file-kit}/file_service.d.ts +7 -4
- package/dist/file-kit/file_service.js +60 -0
- package/dist/file-kit/file_service.mjs +35 -0
- package/dist/file-kit/object_storage.d.mts +17 -0
- package/dist/{esm/file-kit → file-kit}/object_storage.d.ts +6 -2
- package/dist/file-kit/object_storage.js +78 -0
- package/dist/file-kit/object_storage.mjs +57 -0
- package/dist/file-kit/repository.d.mts +16 -0
- package/dist/{esm/file-kit → file-kit}/repository.d.ts +3 -1
- package/dist/file-kit/repository.js +18 -0
- package/dist/file-kit/repository.mjs +0 -0
- package/dist/file-kit/responsive_image.d.mts +20 -0
- package/dist/file-kit/responsive_image.d.ts +20 -0
- package/dist/file-kit/responsive_image.js +123 -0
- package/dist/file-kit/responsive_image.mjs +87 -0
- package/dist/http-kit/index.d.mts +1 -0
- package/dist/http-kit/index.d.ts +1 -0
- package/dist/http-kit/index.js +111 -0
- package/dist/http-kit/index.mjs +68 -0
- package/dist/http-kit/response.d.mts +19 -0
- package/dist/http-kit/response.d.ts +19 -0
- package/dist/http-kit/response.js +109 -0
- package/dist/http-kit/response.mjs +68 -0
- package/dist/index.d.mts +4 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +91 -0
- package/dist/index.mjs +51 -0
- package/dist/route/api/auth/login/[provider]/route.js +113 -0
- package/dist/route/api/auth/login/[provider]/route.mjs +86 -0
- package/dist/route/api/auth/login/_provider_/route.d.mts +20 -0
- package/dist/route/api/auth/login/_provider_/route.d.ts +20 -0
- package/dist/route/api/auth/login/route.d.mts +14 -0
- package/dist/route/api/auth/login/route.d.ts +14 -0
- package/dist/route/api/auth/login/route.js +107 -0
- package/dist/route/api/auth/login/route.mjs +80 -0
- package/dist/route/api/auth/logout/route.d.mts +14 -0
- package/dist/route/api/auth/logout/route.d.ts +14 -0
- package/dist/route/api/auth/logout/route.js +98 -0
- package/dist/route/api/auth/logout/route.mjs +71 -0
- package/dist/route/api/auth/refresh/route.d.mts +13 -0
- package/dist/route/api/auth/refresh/route.d.ts +13 -0
- package/dist/route/api/auth/refresh/route.js +92 -0
- package/dist/route/api/auth/refresh/route.mjs +65 -0
- package/dist/route/api/auth/route.d.mts +13 -0
- package/dist/route/api/auth/route.d.ts +13 -0
- package/dist/route/api/auth/route.js +82 -0
- package/dist/route/api/auth/route.mjs +55 -0
- package/dist/route/api/files/[fileId]/route.js +99 -0
- package/dist/route/api/files/[fileId]/route.mjs +72 -0
- package/dist/route/api/files/_fileId_/route.d.mts +17 -0
- package/dist/route/api/files/_fileId_/route.d.ts +17 -0
- package/dist/route/api/files/route.d.mts +16 -0
- package/dist/route/api/files/route.d.ts +16 -0
- package/dist/route/api/files/route.js +106 -0
- package/dist/route/api/files/route.mjs +79 -0
- package/dist/route/api.d.mts +29 -0
- package/dist/route/api.d.ts +29 -0
- package/dist/route/api.js +395 -0
- package/dist/route/api.mjs +368 -0
- package/dist/route/auth/callback/[provider]/route.js +120 -0
- package/dist/route/auth/callback/[provider]/route.mjs +93 -0
- package/dist/route/auth/callback/_provider_/route.d.mts +20 -0
- package/dist/route/auth/callback/_provider_/route.d.ts +20 -0
- package/dist/seo-kit/index.d.mts +6 -0
- package/dist/seo-kit/index.d.ts +6 -0
- package/dist/seo-kit/index.js +321 -0
- package/dist/seo-kit/index.mjs +282 -0
- package/dist/seo-kit/loader.d.mts +7 -0
- package/dist/seo-kit/loader.d.ts +7 -0
- package/dist/seo-kit/loader.js +43 -0
- package/dist/seo-kit/loader.mjs +18 -0
- package/dist/seo-kit/seo.d.mts +103 -0
- package/dist/{esm/seo-kit → seo-kit}/seo.d.ts +10 -6
- package/dist/seo-kit/seo.js +286 -0
- package/dist/seo-kit/seo.mjs +251 -0
- package/dist/seo-kit/seo_loader.d.mts +16 -0
- package/dist/seo-kit/seo_loader.d.ts +16 -0
- package/dist/seo-kit/seo_loader.js +68 -0
- package/dist/seo-kit/seo_loader.mjs +31 -0
- package/dist/singleton.d.mts +3 -0
- package/dist/singleton.d.ts +3 -0
- package/dist/singleton.js +37 -0
- package/dist/singleton.mjs +12 -0
- package/dist/slug.d.mts +3 -0
- package/dist/slug.d.ts +3 -0
- package/dist/slug.js +32 -0
- package/dist/slug.mjs +7 -0
- package/package.json +36 -34
- package/tsup.config.ts +9 -0
- package/dist/cjs/auth-kit/apple_auth.js +0 -61
- package/dist/cjs/auth-kit/auth_service.js +0 -204
- package/dist/cjs/auth-kit/client/google_login_button.js +0 -19
- package/dist/cjs/auth-kit/client/redirect_page.js +0 -18
- package/dist/cjs/auth-kit/google_auth.js +0 -69
- package/dist/cjs/auth-kit/jwt.js +0 -54
- package/dist/cjs/auth-kit/kakao_auth.js +0 -43
- package/dist/cjs/auth-kit/repository.js +0 -2
- package/dist/cjs/auth-kit/with_auth.js +0 -46
- package/dist/cjs/cn.js +0 -6
- package/dist/cjs/components/index.js +0 -18
- package/dist/cjs/components/modal/fullscreen_container.js +0 -49
- package/dist/cjs/components/modal/hooks.js +0 -76
- package/dist/cjs/components/modal/index.js +0 -19
- package/dist/cjs/components/modal/modal.js +0 -79
- package/dist/cjs/components/styles.js +0 -10
- package/dist/cjs/date.js +0 -31
- package/dist/cjs/file-kit/cdn.js +0 -9
- package/dist/cjs/file-kit/client/drop_file_input.js +0 -148
- package/dist/cjs/file-kit/client/file_uploader.js +0 -88
- package/dist/cjs/file-kit/file_service.js +0 -32
- package/dist/cjs/file-kit/object_storage.js +0 -51
- package/dist/cjs/file-kit/repository.js +0 -2
- package/dist/cjs/file-kit/responsive_image.js +0 -63
- package/dist/cjs/http-kit/index.js +0 -17
- package/dist/cjs/http-kit/response.js +0 -37
- package/dist/cjs/index.js +0 -20
- package/dist/cjs/route/api/auth/login/[provider]/route.js +0 -36
- package/dist/cjs/route/api/auth/login/route.js +0 -35
- package/dist/cjs/route/api/auth/logout/route.js +0 -22
- package/dist/cjs/route/api/auth/refresh/route.js +0 -22
- package/dist/cjs/route/api/auth/route.js +0 -12
- package/dist/cjs/route/api/files/[fileId]/route.js +0 -20
- package/dist/cjs/route/api/files/route.js +0 -34
- package/dist/cjs/route/auth/callback/[provider]/route.js +0 -38
- package/dist/cjs/route/index.js +0 -80
- package/dist/cjs/seo-kit/index.js +0 -19
- package/dist/cjs/seo-kit/loader.js +0 -17
- package/dist/cjs/seo-kit/seo.js +0 -278
- package/dist/cjs/seo-kit/seo_loader.js +0 -15
- package/dist/cjs/singleton.js +0 -12
- package/dist/cjs/slug.js +0 -10
- package/dist/esm/auth-kit/apple_auth.js +0 -57
- package/dist/esm/auth-kit/auth_service.js +0 -197
- package/dist/esm/auth-kit/client/google_login_button.d.ts +0 -5
- package/dist/esm/auth-kit/client/google_login_button.js +0 -16
- package/dist/esm/auth-kit/client/redirect_page.d.ts +0 -1
- package/dist/esm/auth-kit/client/redirect_page.js +0 -15
- package/dist/esm/auth-kit/google_auth.js +0 -65
- package/dist/esm/auth-kit/jwt.js +0 -50
- package/dist/esm/auth-kit/kakao_auth.js +0 -39
- package/dist/esm/auth-kit/repository.js +0 -1
- package/dist/esm/auth-kit/with_auth.d.ts +0 -12
- package/dist/esm/auth-kit/with_auth.js +0 -43
- package/dist/esm/cn.d.ts +0 -1
- package/dist/esm/cn.js +0 -3
- package/dist/esm/components/index.d.ts +0 -2
- package/dist/esm/components/index.js +0 -2
- package/dist/esm/components/modal/fullscreen_container.d.ts +0 -5
- package/dist/esm/components/modal/fullscreen_container.js +0 -45
- package/dist/esm/components/modal/hooks.d.ts +0 -15
- package/dist/esm/components/modal/hooks.js +0 -67
- package/dist/esm/components/modal/index.d.ts +0 -3
- package/dist/esm/components/modal/index.js +0 -3
- package/dist/esm/components/modal/modal.d.ts +0 -10
- package/dist/esm/components/modal/modal.js +0 -43
- package/dist/esm/components/styles.d.ts +0 -7
- package/dist/esm/components/styles.js +0 -7
- package/dist/esm/date.d.ts +0 -1
- package/dist/esm/date.js +0 -24
- package/dist/esm/file-kit/cdn.d.ts +0 -3
- package/dist/esm/file-kit/cdn.js +0 -5
- package/dist/esm/file-kit/client/drop_file_input.js +0 -144
- package/dist/esm/file-kit/client/file_uploader.js +0 -84
- package/dist/esm/file-kit/file_service.js +0 -28
- package/dist/esm/file-kit/object_storage.js +0 -47
- package/dist/esm/file-kit/repository.js +0 -1
- package/dist/esm/file-kit/responsive_image.d.ts +0 -17
- package/dist/esm/file-kit/responsive_image.js +0 -58
- package/dist/esm/http-kit/index.d.ts +0 -1
- package/dist/esm/http-kit/index.js +0 -1
- package/dist/esm/http-kit/response.d.ts +0 -17
- package/dist/esm/http-kit/response.js +0 -31
- package/dist/esm/index.d.ts +0 -4
- package/dist/esm/index.js +0 -4
- package/dist/esm/route/api/auth/login/[provider]/route.d.ts +0 -10
- package/dist/esm/route/api/auth/login/[provider]/route.js +0 -32
- package/dist/esm/route/api/auth/login/route.d.ts +0 -6
- package/dist/esm/route/api/auth/login/route.js +0 -31
- package/dist/esm/route/api/auth/logout/route.d.ts +0 -6
- package/dist/esm/route/api/auth/logout/route.js +0 -18
- package/dist/esm/route/api/auth/refresh/route.d.ts +0 -4
- package/dist/esm/route/api/auth/refresh/route.js +0 -18
- package/dist/esm/route/api/auth/route.d.ts +0 -4
- package/dist/esm/route/api/auth/route.js +0 -8
- package/dist/esm/route/api/files/[fileId]/route.d.ts +0 -8
- package/dist/esm/route/api/files/[fileId]/route.js +0 -16
- package/dist/esm/route/api/files/route.d.ts +0 -6
- package/dist/esm/route/api/files/route.js +0 -30
- package/dist/esm/route/auth/callback/[provider]/route.d.ts +0 -11
- package/dist/esm/route/auth/callback/[provider]/route.js +0 -34
- package/dist/esm/route/index.d.ts +0 -22
- package/dist/esm/route/index.js +0 -76
- package/dist/esm/seo-kit/index.d.ts +0 -3
- package/dist/esm/seo-kit/index.js +0 -3
- package/dist/esm/seo-kit/loader.d.ts +0 -5
- package/dist/esm/seo-kit/loader.js +0 -14
- package/dist/esm/seo-kit/seo.js +0 -275
- package/dist/esm/seo-kit/seo_loader.d.ts +0 -12
- package/dist/esm/seo-kit/seo_loader.js +0 -12
- package/dist/esm/singleton.d.ts +0 -1
- package/dist/esm/singleton.js +0 -9
- package/dist/esm/slug.d.ts +0 -1
- package/dist/esm/slug.js +0 -6
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { NO_CONTENT, UNAUTHORIZED } from "../../../../http-kit";
|
|
2
|
-
export const logoutHandler = async (request, { AUTH, repository }) => {
|
|
3
|
-
const auth = await AUTH.verifyOrRefresh(request);
|
|
4
|
-
if (!auth) {
|
|
5
|
-
return UNAUTHORIZED();
|
|
6
|
-
}
|
|
7
|
-
await repository.updateUserRefreshToken(auth.userId, null);
|
|
8
|
-
const headers = new Headers();
|
|
9
|
-
const [accessTokenSetCookie, refreshTokenSetCookie] = await Promise.all([
|
|
10
|
-
AUTH.getAccessTokenSetCookie(null),
|
|
11
|
-
AUTH.getRefreshTokenSetCookie(null),
|
|
12
|
-
]);
|
|
13
|
-
headers.append("Set-Cookie", accessTokenSetCookie);
|
|
14
|
-
headers.append("Set-Cookie", refreshTokenSetCookie);
|
|
15
|
-
return NO_CONTENT({
|
|
16
|
-
headers,
|
|
17
|
-
});
|
|
18
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { BAD_REQUEST, CREATED, UNAUTHORIZED } from "../../../../http-kit";
|
|
2
|
-
export const authRefreshHandler = async (request, { AUTH, }) => {
|
|
3
|
-
const refreshToken = request?.headers.get("Authorization")?.replace("Bearer ", "") ||
|
|
4
|
-
(await AUTH.getRefreshTokenFromCookies(request));
|
|
5
|
-
if (!refreshToken) {
|
|
6
|
-
return BAD_REQUEST();
|
|
7
|
-
}
|
|
8
|
-
try {
|
|
9
|
-
const accessToken = await AUTH.refreshAccessToken(refreshToken);
|
|
10
|
-
return CREATED({ accessToken });
|
|
11
|
-
}
|
|
12
|
-
catch (e) {
|
|
13
|
-
if (e instanceof Error) {
|
|
14
|
-
return UNAUTHORIZED(e.message);
|
|
15
|
-
}
|
|
16
|
-
throw e;
|
|
17
|
-
}
|
|
18
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { AuthService } from "../../../../auth-kit/auth_service";
|
|
2
|
-
import { type FileRepository } from "../../../../file-kit/repository";
|
|
3
|
-
export declare const fileDeleteHandler: <TFile>(request: Request, { fileId }: {
|
|
4
|
-
fileId: string;
|
|
5
|
-
}, { AUTH, repository, }: {
|
|
6
|
-
AUTH: AuthService;
|
|
7
|
-
repository: FileRepository<TFile>;
|
|
8
|
-
}) => Promise<Response>;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { FORBIDDEN, NO_CONTENT, NOT_FOUND } from "../../../../http-kit";
|
|
2
|
-
export const fileDeleteHandler = async (request, { fileId }, { AUTH, repository, }) => {
|
|
3
|
-
const auth = await AUTH.verifyOrRefresh(request);
|
|
4
|
-
const file = await repository.findFileById(fileId);
|
|
5
|
-
const headers = {
|
|
6
|
-
"Access-Control-Allow-Origin": "*",
|
|
7
|
-
};
|
|
8
|
-
if (!file) {
|
|
9
|
-
return NOT_FOUND("파일을 찾을 수 없습니다.", { headers });
|
|
10
|
-
}
|
|
11
|
-
if (!repository.hasPermission(file, auth?.userId)) {
|
|
12
|
-
return FORBIDDEN("파일을 삭제할 권한이 없습니다.", { headers });
|
|
13
|
-
}
|
|
14
|
-
await repository.deleteFile(fileId);
|
|
15
|
-
return NO_CONTENT({ headers });
|
|
16
|
-
};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { AuthService } from "../../../auth-kit/auth_service";
|
|
2
|
-
import { FileService } from "../../../file-kit/file_service";
|
|
3
|
-
export declare const fileUploadHandler: <TFile>(request: Request, { AUTH, FILE_SERVICE, }: {
|
|
4
|
-
AUTH: AuthService;
|
|
5
|
-
FILE_SERVICE: FileService<TFile>;
|
|
6
|
-
}) => Promise<Response>;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { BAD_REQUEST, CREATED, INTERNAL_SERVER_ERROR } from "../../../http-kit";
|
|
2
|
-
export const fileUploadHandler = async (request, { AUTH, FILE_SERVICE, }) => {
|
|
3
|
-
const auth = await AUTH.verifyOrRefresh(request);
|
|
4
|
-
const { name, type, size, metadata } = await request.json();
|
|
5
|
-
const headers = {
|
|
6
|
-
"Access-Control-Allow-Origin": "*",
|
|
7
|
-
};
|
|
8
|
-
if (typeof name !== "string") {
|
|
9
|
-
return BAD_REQUEST("파일 이름이 필요해요.", { headers });
|
|
10
|
-
}
|
|
11
|
-
if (typeof type !== "string") {
|
|
12
|
-
return BAD_REQUEST("파일 타입이 필요해요.", { headers });
|
|
13
|
-
}
|
|
14
|
-
try {
|
|
15
|
-
const result = await FILE_SERVICE.generateSignedUrl({
|
|
16
|
-
userId: auth?.userId,
|
|
17
|
-
name,
|
|
18
|
-
type,
|
|
19
|
-
size,
|
|
20
|
-
metadata,
|
|
21
|
-
});
|
|
22
|
-
return CREATED(result, { headers });
|
|
23
|
-
}
|
|
24
|
-
catch (e) {
|
|
25
|
-
if (e instanceof Error) {
|
|
26
|
-
return INTERNAL_SERVER_ERROR(e.message, { headers });
|
|
27
|
-
}
|
|
28
|
-
return INTERNAL_SERVER_ERROR(e, { headers });
|
|
29
|
-
}
|
|
30
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { AuthService } from "../../../../auth-kit/auth_service";
|
|
2
|
-
import { GoogleAuth } from "../../../../auth-kit/google_auth";
|
|
3
|
-
import { AppleAuth } from "../../../../auth-kit/apple_auth";
|
|
4
|
-
export declare const thirdPartyAuthCallbackHandler: (request: Request, { provider, }: {
|
|
5
|
-
provider: string;
|
|
6
|
-
}, { AUTH, GOOGLE_AUTH, APPLE_AUTH, SITE_ORIGIN, }: {
|
|
7
|
-
AUTH: AuthService;
|
|
8
|
-
GOOGLE_AUTH: GoogleAuth;
|
|
9
|
-
APPLE_AUTH: AppleAuth;
|
|
10
|
-
SITE_ORIGIN: string;
|
|
11
|
-
}) => Promise<Response>;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { BAD_REQUEST } from "../../../../http-kit";
|
|
2
|
-
export const thirdPartyAuthCallbackHandler = async (request, { provider, }, { AUTH, GOOGLE_AUTH, APPLE_AUTH, SITE_ORIGIN, }) => {
|
|
3
|
-
const url = new URL(request.url);
|
|
4
|
-
const code = url.searchParams.get("code");
|
|
5
|
-
if (!code) {
|
|
6
|
-
throw BAD_REQUEST("코드가 없습니다.");
|
|
7
|
-
}
|
|
8
|
-
const getThirdPartyAuth = (provider) => {
|
|
9
|
-
switch (provider) {
|
|
10
|
-
case "google":
|
|
11
|
-
return GOOGLE_AUTH;
|
|
12
|
-
case "apple":
|
|
13
|
-
return APPLE_AUTH;
|
|
14
|
-
default:
|
|
15
|
-
throw BAD_REQUEST("지원하지 않는 인증 제공자입니다.");
|
|
16
|
-
}
|
|
17
|
-
};
|
|
18
|
-
const { accessToken, refreshToken } = await getThirdPartyAuth(provider).signIn(code);
|
|
19
|
-
const [accessTokenSetCookie, refreshTokenSetCookie] = await Promise.all([
|
|
20
|
-
AUTH.getAccessTokenSetCookie(accessToken),
|
|
21
|
-
AUTH.getRefreshTokenSetCookie(refreshToken),
|
|
22
|
-
]);
|
|
23
|
-
const headers = new Headers();
|
|
24
|
-
headers.append("Set-Cookie", accessTokenSetCookie);
|
|
25
|
-
headers.append("Set-Cookie", refreshTokenSetCookie);
|
|
26
|
-
const redirectUrl = url.searchParams.get("state") || SITE_ORIGIN;
|
|
27
|
-
return new Response("Temporary Redirect", {
|
|
28
|
-
status: 307,
|
|
29
|
-
headers: {
|
|
30
|
-
...headers,
|
|
31
|
-
Location: new URL(`/r?redirectUrl=${encodeURIComponent(redirectUrl)}`, request.url).toString(),
|
|
32
|
-
},
|
|
33
|
-
});
|
|
34
|
-
};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { AuthService } from "../auth-kit/auth_service";
|
|
2
|
-
import { GoogleAuth } from "../auth-kit/google_auth";
|
|
3
|
-
import { AppleAuth } from "../auth-kit/apple_auth";
|
|
4
|
-
import { type FileRepository } from "../file-kit/repository";
|
|
5
|
-
import { FileService } from "../file-kit/file_service";
|
|
6
|
-
import { JWTManager } from "../auth-kit/jwt";
|
|
7
|
-
import { type AuthRepository } from "../auth-kit/repository";
|
|
8
|
-
import { KakaoAuth } from "../auth-kit/kakao_auth";
|
|
9
|
-
export declare const createAuthAPIHandler: <TFile>({ AUTH, GOOGLE_AUTH, APPLE_AUTH, KAKAO_AUTH, JWT_MANAGER, FILE_SERVICE, SITE_ORIGIN, authRepository, fileRepository, }: {
|
|
10
|
-
SITE_ORIGIN: string;
|
|
11
|
-
JWT_MANAGER: JWTManager;
|
|
12
|
-
AUTH: AuthService;
|
|
13
|
-
GOOGLE_AUTH: GoogleAuth;
|
|
14
|
-
APPLE_AUTH: AppleAuth;
|
|
15
|
-
KAKAO_AUTH: KakaoAuth;
|
|
16
|
-
FILE_SERVICE: FileService<TFile>;
|
|
17
|
-
authRepository: AuthRepository;
|
|
18
|
-
fileRepository: FileRepository<TFile>;
|
|
19
|
-
}) => ({ request, params, }: {
|
|
20
|
-
request: Request;
|
|
21
|
-
params: any;
|
|
22
|
-
}) => Promise<Response>;
|
package/dist/esm/route/index.js
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import { thirdPartyAuthCallbackHandler } from "./auth/callback/[provider]/route";
|
|
2
|
-
import { fileUploadHandler } from "./api/files/route";
|
|
3
|
-
import { fileDeleteHandler } from "./api/files/[fileId]/route";
|
|
4
|
-
import { getAuthHandler } from "./api/auth/route";
|
|
5
|
-
import { loginThirdPartyHandler } from "./api/auth/login/[provider]/route";
|
|
6
|
-
import { loginCredentialHandler } from "./api/auth/login/route";
|
|
7
|
-
import { logoutHandler } from "./api/auth/logout/route";
|
|
8
|
-
import { authRefreshHandler } from "./api/auth/refresh/route";
|
|
9
|
-
export const createAuthAPIHandler = ({ AUTH, GOOGLE_AUTH, APPLE_AUTH, KAKAO_AUTH, JWT_MANAGER, FILE_SERVICE, SITE_ORIGIN, authRepository, fileRepository, }) => {
|
|
10
|
-
const handler = async ({ request, params, }) => {
|
|
11
|
-
const method = request.method.toUpperCase();
|
|
12
|
-
const slug = params["*"].split("/");
|
|
13
|
-
if (slug[0] === "auth") {
|
|
14
|
-
if (!slug[1]) {
|
|
15
|
-
if (method === "GET") {
|
|
16
|
-
return getAuthHandler(request, { AUTH });
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
if (slug[1] === "login") {
|
|
20
|
-
if (slug[2]) {
|
|
21
|
-
const provider = slug[2];
|
|
22
|
-
if (method === "POST") {
|
|
23
|
-
return loginThirdPartyHandler(request, { provider }, { GOOGLE_AUTH, KAKAO_AUTH, APPLE_AUTH });
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
if (method === "POST") {
|
|
27
|
-
return loginCredentialHandler(request, {
|
|
28
|
-
AUTH,
|
|
29
|
-
JWT_MANAGER,
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
if (slug[1] === "logout") {
|
|
34
|
-
if (method === "POST") {
|
|
35
|
-
return logoutHandler(request, {
|
|
36
|
-
AUTH,
|
|
37
|
-
repository: authRepository,
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
if (slug[1] === "refresh") {
|
|
42
|
-
if (method === "GET") {
|
|
43
|
-
return authRefreshHandler(request, { AUTH });
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
if (slug[1] === "callback") {
|
|
47
|
-
if (slug[2]) {
|
|
48
|
-
const provider = slug[2];
|
|
49
|
-
if (method === "GET") {
|
|
50
|
-
return thirdPartyAuthCallbackHandler(request, { provider }, {
|
|
51
|
-
AUTH,
|
|
52
|
-
GOOGLE_AUTH,
|
|
53
|
-
APPLE_AUTH,
|
|
54
|
-
SITE_ORIGIN,
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
if (slug[0] === "files") {
|
|
61
|
-
if (!slug[1]) {
|
|
62
|
-
if (method === "POST") {
|
|
63
|
-
return fileUploadHandler(request, { AUTH, FILE_SERVICE });
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
if (slug[1]) {
|
|
67
|
-
if (method === "DELETE") {
|
|
68
|
-
const fileId = slug[1];
|
|
69
|
-
return fileDeleteHandler(request, { fileId }, { AUTH, repository: fileRepository });
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
return new Response("Not Found", { status: 404 });
|
|
74
|
-
};
|
|
75
|
-
return handler;
|
|
76
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export function createLoader(fn = () => ({})) {
|
|
2
|
-
let loadedData;
|
|
3
|
-
return {
|
|
4
|
-
getData() {
|
|
5
|
-
return loadedData;
|
|
6
|
-
},
|
|
7
|
-
wrap(mapper) {
|
|
8
|
-
return async function Thing(props) {
|
|
9
|
-
loadedData = await fn(props);
|
|
10
|
-
return mapper(loadedData);
|
|
11
|
-
};
|
|
12
|
-
},
|
|
13
|
-
};
|
|
14
|
-
}
|
package/dist/esm/seo-kit/seo.js
DELETED
|
@@ -1,275 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
export function configSEO(config) {
|
|
3
|
-
return {
|
|
4
|
-
config,
|
|
5
|
-
async init(props = {}) {
|
|
6
|
-
const canonicalPath = props.canonicalPath;
|
|
7
|
-
const url = canonicalPath
|
|
8
|
-
? `${config.origin}${canonicalPath}`
|
|
9
|
-
: `${config.origin}${props.path || ""}`;
|
|
10
|
-
const pageTitle = props.title
|
|
11
|
-
? `${props.title} | ${config.siteName}`
|
|
12
|
-
: config.siteName;
|
|
13
|
-
const description = props.description || config.description;
|
|
14
|
-
const keywords = props.keywords || config.keywords;
|
|
15
|
-
const websiteSchemaId = `${config.origin}/#website`;
|
|
16
|
-
const websiteSchema = {
|
|
17
|
-
"@type": "WebSite",
|
|
18
|
-
"@id": websiteSchemaId,
|
|
19
|
-
url: config.origin,
|
|
20
|
-
name: config.siteName,
|
|
21
|
-
alternateName: config.siteName,
|
|
22
|
-
description: config.description,
|
|
23
|
-
inLanguage: "ko",
|
|
24
|
-
};
|
|
25
|
-
const thumbnailSchemaId = `${url}/#thumbnail`;
|
|
26
|
-
const thumbnail = props.thumbnail ||
|
|
27
|
-
(typeof config.thumbnail === "function"
|
|
28
|
-
? await config.thumbnail()
|
|
29
|
-
: config.thumbnail);
|
|
30
|
-
const thumbnailUrl = thumbnail?.url;
|
|
31
|
-
const socialImage = thumbnail
|
|
32
|
-
? [
|
|
33
|
-
typeof thumbnail === "string"
|
|
34
|
-
? {
|
|
35
|
-
url: thumbnail,
|
|
36
|
-
alt: `${props.title} 대표 이미지`,
|
|
37
|
-
}
|
|
38
|
-
: thumbnail,
|
|
39
|
-
]
|
|
40
|
-
: [];
|
|
41
|
-
const images = [
|
|
42
|
-
...(thumbnailUrl
|
|
43
|
-
? [
|
|
44
|
-
{
|
|
45
|
-
id: thumbnailSchemaId,
|
|
46
|
-
url: thumbnailUrl,
|
|
47
|
-
alt: `${props.title} 대표 이미지`,
|
|
48
|
-
},
|
|
49
|
-
]
|
|
50
|
-
: []),
|
|
51
|
-
...(props.images || []),
|
|
52
|
-
...(props.collection?.map((portfolio) => portfolio.thumbnail) || []),
|
|
53
|
-
].filter(Boolean);
|
|
54
|
-
const image = images
|
|
55
|
-
.filter((file) => file.id)
|
|
56
|
-
.map((file) => ({
|
|
57
|
-
"@type": "ImageObject",
|
|
58
|
-
"@id": `${url}/#${file.id}`,
|
|
59
|
-
}));
|
|
60
|
-
const breadcrumbSchemaId = `${url}#breadcrumb`;
|
|
61
|
-
const updatedAt = props.updatedAt;
|
|
62
|
-
const createdAt = props.createdAt;
|
|
63
|
-
const meta = () => {
|
|
64
|
-
return [
|
|
65
|
-
{ title: pageTitle },
|
|
66
|
-
{ name: "description", content: description },
|
|
67
|
-
{ name: "keywords", content: keywords?.join(", ") || "" },
|
|
68
|
-
{
|
|
69
|
-
tagName: "link",
|
|
70
|
-
rel: "canonical",
|
|
71
|
-
href: url,
|
|
72
|
-
},
|
|
73
|
-
{ property: "og:type", content: props.type || "website" },
|
|
74
|
-
{ property: "og:title", content: pageTitle },
|
|
75
|
-
{ property: "og:description", content: description },
|
|
76
|
-
{ property: "og:url", content: url },
|
|
77
|
-
{ property: "og:site_name", content: config.siteName },
|
|
78
|
-
...socialImage.map((file) => ({
|
|
79
|
-
property: "og:image",
|
|
80
|
-
content: file.url,
|
|
81
|
-
})),
|
|
82
|
-
{
|
|
83
|
-
property: "twitter:card",
|
|
84
|
-
content: socialImage.length > 0 ? "summary_large_image" : "summary",
|
|
85
|
-
},
|
|
86
|
-
{ property: "twitter:title", content: pageTitle },
|
|
87
|
-
{ property: "twitter:description", content: description },
|
|
88
|
-
...socialImage.map((file) => ({
|
|
89
|
-
property: "twitter:image",
|
|
90
|
-
content: file.url,
|
|
91
|
-
})),
|
|
92
|
-
];
|
|
93
|
-
};
|
|
94
|
-
const additionalStructedData = [
|
|
95
|
-
...(typeof props.structedData === "function"
|
|
96
|
-
? await props.structedData()
|
|
97
|
-
: props.structedData || []),
|
|
98
|
-
...(typeof config.structedData === "function"
|
|
99
|
-
? await config.structedData()
|
|
100
|
-
: config.structedData || []),
|
|
101
|
-
];
|
|
102
|
-
function getStructedData() {
|
|
103
|
-
const collectionMainEntity = props.collection
|
|
104
|
-
? {
|
|
105
|
-
"@type": "ItemList",
|
|
106
|
-
numberOfItems: props.collection.length,
|
|
107
|
-
itemListElement: props.collection.map((item, index) => ({
|
|
108
|
-
"@type": "ListItem",
|
|
109
|
-
position: index + 1,
|
|
110
|
-
url: item.url,
|
|
111
|
-
item: {
|
|
112
|
-
"@type": "WebPage",
|
|
113
|
-
"@id": `${item.url}#webpage`,
|
|
114
|
-
url: item.url,
|
|
115
|
-
name: item.title,
|
|
116
|
-
thumbnailUrl: item.thumbnail?.url,
|
|
117
|
-
dateModified: item.updatedAt?.toISOString(),
|
|
118
|
-
dateCreated: item.createdAt?.toISOString(),
|
|
119
|
-
datePublished: item.createdAt?.toISOString(),
|
|
120
|
-
},
|
|
121
|
-
})),
|
|
122
|
-
}
|
|
123
|
-
: undefined;
|
|
124
|
-
return {
|
|
125
|
-
"@context": "https://schema.org",
|
|
126
|
-
"@graph": [
|
|
127
|
-
{
|
|
128
|
-
"@type": "WebPage",
|
|
129
|
-
"@id": `${url}#webpage`,
|
|
130
|
-
url,
|
|
131
|
-
name: pageTitle,
|
|
132
|
-
description,
|
|
133
|
-
keywords: keywords,
|
|
134
|
-
dateModified: updatedAt?.toISOString(),
|
|
135
|
-
datePublished: createdAt?.toISOString(),
|
|
136
|
-
dateCreated: createdAt?.toISOString(),
|
|
137
|
-
primaryImageOfPage: thumbnail
|
|
138
|
-
? {
|
|
139
|
-
"@id": thumbnailSchemaId,
|
|
140
|
-
}
|
|
141
|
-
: undefined,
|
|
142
|
-
isPartOf: {
|
|
143
|
-
"@id": websiteSchemaId,
|
|
144
|
-
},
|
|
145
|
-
inLanguage: "ko",
|
|
146
|
-
breadcrumb: props.breadcrumbs && props.breadcrumbs.length > 0
|
|
147
|
-
? {
|
|
148
|
-
"@id": breadcrumbSchemaId,
|
|
149
|
-
}
|
|
150
|
-
: undefined,
|
|
151
|
-
image,
|
|
152
|
-
mainEntity: collectionMainEntity,
|
|
153
|
-
},
|
|
154
|
-
props.article &&
|
|
155
|
-
{
|
|
156
|
-
"@type": "Article",
|
|
157
|
-
"@id": `${url}#article`,
|
|
158
|
-
url,
|
|
159
|
-
name: pageTitle,
|
|
160
|
-
description,
|
|
161
|
-
keywords: keywords,
|
|
162
|
-
headline: pageTitle,
|
|
163
|
-
dateModified: updatedAt?.toISOString(),
|
|
164
|
-
datePublished: createdAt?.toISOString(),
|
|
165
|
-
dateCreated: createdAt?.toISOString(),
|
|
166
|
-
isPartOf: {
|
|
167
|
-
"@id": websiteSchemaId,
|
|
168
|
-
},
|
|
169
|
-
inLanguage: "ko",
|
|
170
|
-
image,
|
|
171
|
-
},
|
|
172
|
-
props.blogPosting &&
|
|
173
|
-
{
|
|
174
|
-
"@type": "BlogPosting",
|
|
175
|
-
"@id": `${url}/#blogposting`,
|
|
176
|
-
url,
|
|
177
|
-
headline: pageTitle,
|
|
178
|
-
description: description,
|
|
179
|
-
thumbnailUrl,
|
|
180
|
-
datePublished: createdAt?.toISOString(),
|
|
181
|
-
dateModified: updatedAt?.toISOString(),
|
|
182
|
-
isPartOf: { "@id": websiteSchemaId },
|
|
183
|
-
image,
|
|
184
|
-
},
|
|
185
|
-
props.creativeWork &&
|
|
186
|
-
{
|
|
187
|
-
"@type": "CreativeWork",
|
|
188
|
-
"@id": `${url}/#creativework`,
|
|
189
|
-
url,
|
|
190
|
-
name: pageTitle,
|
|
191
|
-
description: description,
|
|
192
|
-
datePublished: createdAt?.toISOString(),
|
|
193
|
-
dateModified: updatedAt?.toISOString(),
|
|
194
|
-
isPartOf: { "@id": websiteSchemaId },
|
|
195
|
-
thumbnailUrl,
|
|
196
|
-
image,
|
|
197
|
-
},
|
|
198
|
-
props.visualArtwork &&
|
|
199
|
-
{
|
|
200
|
-
"@type": "VisualArtwork",
|
|
201
|
-
"@id": `${url}/#visualartwork`,
|
|
202
|
-
url,
|
|
203
|
-
name: pageTitle,
|
|
204
|
-
description: description,
|
|
205
|
-
datePublished: createdAt?.toISOString(),
|
|
206
|
-
dateModified: updatedAt?.toISOString(),
|
|
207
|
-
isPartOf: { "@id": websiteSchemaId },
|
|
208
|
-
thumbnailUrl,
|
|
209
|
-
image,
|
|
210
|
-
},
|
|
211
|
-
props.collection &&
|
|
212
|
-
{
|
|
213
|
-
"@type": "CollectionPage",
|
|
214
|
-
"@id": `${url}/#collectionpage`,
|
|
215
|
-
url: url,
|
|
216
|
-
name: pageTitle,
|
|
217
|
-
description: description,
|
|
218
|
-
isPartOf: { "@id": websiteSchemaId },
|
|
219
|
-
image,
|
|
220
|
-
inLanguage: "ko-KR",
|
|
221
|
-
breadcrumb: props.breadcrumbs && props.breadcrumbs.length > 0
|
|
222
|
-
? {
|
|
223
|
-
"@id": `${url}/#breadcrumb`,
|
|
224
|
-
}
|
|
225
|
-
: undefined,
|
|
226
|
-
mainEntity: collectionMainEntity,
|
|
227
|
-
},
|
|
228
|
-
websiteSchema,
|
|
229
|
-
props.breadcrumbs &&
|
|
230
|
-
props.breadcrumbs.length > 0 &&
|
|
231
|
-
{
|
|
232
|
-
"@id": breadcrumbSchemaId,
|
|
233
|
-
"@type": "BreadcrumbList",
|
|
234
|
-
itemListElement: props.breadcrumbs.map((breadcrumb, index) => ({
|
|
235
|
-
"@type": "ListItem",
|
|
236
|
-
position: index + 1,
|
|
237
|
-
name: breadcrumb.label,
|
|
238
|
-
item: `${config.origin}${breadcrumb.href}`,
|
|
239
|
-
})),
|
|
240
|
-
},
|
|
241
|
-
...additionalStructedData,
|
|
242
|
-
...images.map((file) => {
|
|
243
|
-
return {
|
|
244
|
-
"@type": "ImageObject",
|
|
245
|
-
"@id": `${url}/#${file.id}`,
|
|
246
|
-
url: file.url,
|
|
247
|
-
contentUrl: file.url,
|
|
248
|
-
name: file.alt,
|
|
249
|
-
description: file.alt,
|
|
250
|
-
width: file?.width?.toString(),
|
|
251
|
-
height: file?.height?.toString(),
|
|
252
|
-
creditText: config.copyright,
|
|
253
|
-
license: `${config.origin}/terms`,
|
|
254
|
-
copyrightNotice: config.copyright,
|
|
255
|
-
acquireLicensePage: `${config.origin}/terms`,
|
|
256
|
-
};
|
|
257
|
-
}),
|
|
258
|
-
].filter(Boolean),
|
|
259
|
-
};
|
|
260
|
-
}
|
|
261
|
-
function generateJSONLD() {
|
|
262
|
-
const structedData = getStructedData();
|
|
263
|
-
return (_jsx("script", { type: "application/ld+json", dangerouslySetInnerHTML: {
|
|
264
|
-
__html: JSON.stringify(structedData).replace(/</g, "\\u003c"),
|
|
265
|
-
} }));
|
|
266
|
-
}
|
|
267
|
-
return {
|
|
268
|
-
config,
|
|
269
|
-
props,
|
|
270
|
-
meta,
|
|
271
|
-
generateJSONLD,
|
|
272
|
-
};
|
|
273
|
-
},
|
|
274
|
-
};
|
|
275
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { type LoaderFn } from "./loader";
|
|
2
|
-
import { type JSX } from "react";
|
|
3
|
-
import { type SEO } from "./seo";
|
|
4
|
-
import React from "react";
|
|
5
|
-
export declare function createSEOLoader<T, U extends JSX.IntrinsicAttributes & {
|
|
6
|
-
seo: SEO;
|
|
7
|
-
}>(fn?: LoaderFn<T, U>): {
|
|
8
|
-
meta: (props: T) => Promise<import("react-router").MetaFunction<unknown, Record<string, unknown>>>;
|
|
9
|
-
Page(Fc: React.FC<U>): (props: T) => Promise<import("react/jsx-runtime").JSX.Element>;
|
|
10
|
-
getData(): U;
|
|
11
|
-
wrap<V>(mapper: (props: U) => V | Promise<V>): (props: T) => Promise<V>;
|
|
12
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { createLoader } from "./loader";
|
|
3
|
-
export function createSEOLoader(fn = () => ({})) {
|
|
4
|
-
const loader = createLoader(fn);
|
|
5
|
-
return {
|
|
6
|
-
...loader,
|
|
7
|
-
meta: loader.wrap((data) => data.seo.meta),
|
|
8
|
-
Page(Fc) {
|
|
9
|
-
return loader.wrap((data) => (_jsxs(_Fragment, { children: [data.seo?.generateJSONLD(), _jsx(Fc, { ...data })] })));
|
|
10
|
-
},
|
|
11
|
-
};
|
|
12
|
-
}
|
package/dist/esm/singleton.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function singleton<T>(name: string, fn: () => T): T;
|
package/dist/esm/singleton.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export function singleton(name, fn) {
|
|
2
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3
|
-
const globalAny = globalThis;
|
|
4
|
-
globalAny.__singletons = globalAny.__singletons || {};
|
|
5
|
-
if (!globalAny.__singletons[name]) {
|
|
6
|
-
globalAny.__singletons[name] = fn();
|
|
7
|
-
}
|
|
8
|
-
return globalAny.__singletons[name];
|
|
9
|
-
}
|
package/dist/esm/slug.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const toSlug: (str: string) => string;
|