Skip to content

Commit

Permalink
Upgrade to itty-router v5
Browse files Browse the repository at this point in the history
Increased hnkrocks-chapter-router version to 2.10.1
  • Loading branch information
MajorTanya committed Apr 2, 2024
1 parent 6e25099 commit 9e6efce
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 18 deletions.
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "hnkrocks-chapter-router",
"version": "2.10.0",
"version": "2.10.1",
"dependencies": {
"itty-router": "^4.2.2",
"itty-router": "^5.0.5",
"reflare": "^1.1.5"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion src/handlers/handleChapters.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { IRequestStrict } from 'itty-router/Router';
import type { IRequestStrict } from 'itty-router/types/IRequestStrict';
import { HNK_TITLE_URL, ZERO_DECIMAL_PATTERN } from '../constants';
import type { Env } from '../types';

Expand Down
2 changes: 1 addition & 1 deletion src/handlers/handleDirectPages.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { IRequestStrict } from 'itty-router/Router';
import type { IRequestStrict } from 'itty-router/types/IRequestStrict';
import { OEMBED_PAGE_DIRECT } from '../constants';
import { redirectToHnKTitlePage } from './handleChapters';
import type { Env } from '../types';
Expand Down
2 changes: 1 addition & 1 deletion src/handlers/handleExtraPages.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { IRequestStrict } from 'itty-router/Router';
import type { IRequestStrict } from 'itty-router/types/IRequestStrict';
import useReflare from 'reflare';

export const handleExtraPages = async (request: IRequestStrict): Promise<Response> => {
Expand Down
2 changes: 1 addition & 1 deletion src/handlers/handleFandub.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { IRequestStrict } from 'itty-router/Router';
import type { IRequestStrict } from 'itty-router/types/IRequestStrict';
import { FANDUB_EP_01, FANDUB_EP_02, FANDUB_PLAYLIST } from '../constants';

export const redirectToFandubPlaylist = () => Response.redirect(FANDUB_PLAYLIST);
Expand Down
2 changes: 1 addition & 1 deletion src/handlers/handleOEmbed.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { IRequestStrict } from 'itty-router/Router';
import type { IRequestStrict } from 'itty-router/types/IRequestStrict';
import { DEFAULT_JSON_HEADERS, OEMBED_BASE_RESPONSE, OEMBED_PAGE_DIRECT } from '../constants';

type OEmbedProvider = { provider_name: string; provider_url: string } | Record<string, never>;
Expand Down
2 changes: 1 addition & 1 deletion src/handlers/handleOtherWorks.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { IRequestStrict } from 'itty-router/Router';
import type { IRequestStrict } from 'itty-router/types/IRequestStrict';
import {
HNK_FREEDOM_URL,
HNK_LOREBOOK_URL,
Expand Down
5 changes: 1 addition & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import { handleExtraPages } from './handlers/handleExtraPages';
import { handleFandubEpisodeNo, redirectToFandubPlaylist } from './handlers/handleFandub';
import { handleOEmbed } from './handlers/handleOEmbed';
import { handleOtherWorks } from './handlers/handleOtherWorks';
import type { Env } from './types';

const router = Router();

Expand Down Expand Up @@ -62,7 +61,5 @@ router.all('*', redirectToHnKTitlePage);

// noinspection JSUnusedGlobalSymbols
export default {
async fetch(request: Request, env: Env, _ctx: ExecutionContext): Promise<Response> {
return router.handle(request, env);
}
fetch: router.fetch
};

0 comments on commit 9e6efce

Please sign in to comment.