Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update comments in codes #3145

Merged
merged 1 commit into from
Jul 16, 2024
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: 11 additions & 6 deletions src/middleware/combine/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* @module
* Combine Middleware for Hono.
*/

import type { Context } from '../../context'
import type { MiddlewareHandler, Next } from '../../types'
import { TrieRouter } from '../../router/trie-router'
Expand All @@ -18,8 +23,8 @@ type Condition = (c: Context) => boolean
*
* @example
* ```ts
* import { some } from 'combine'
* import { bearerAuth } from 'bearer-auth'
* import { some } from 'hono/combine'
* import { bearerAuth } from 'hono/bearer-auth'
* import { myRateLimit } from '@/rate-limit'
*
* // If client has a valid token, then skip rate limiting.
Expand Down Expand Up @@ -67,8 +72,8 @@ export const some = (...middleware: (MiddlewareHandler | Condition)[]): Middlewa
*
* @example
* ```ts
* import { some, every } from 'combine'
* import { bearerAuth } from 'bearer-auth'
* import { some, every } from 'hono/combine'
* import { bearerAuth } from 'hono/bearer-auth'
* import { myCheckLocalNetwork } from '@/check-local-network'
* import { myRateLimit } from '@/rate-limit'
*
Expand Down Expand Up @@ -110,8 +115,8 @@ export const every = (...middleware: (MiddlewareHandler | Condition)[]): Middlew
*
* @example
* ```ts
* import { except } from 'combine'
* import { bearerAuth } from 'bearer-auth
* import { except } from 'hono/combine'
* import { bearerAuth } from 'hono/bearer-auth
*
* // If client is accessing public API, then skip authentication.
* // Otherwise, require a valid token.
Expand Down
6 changes: 3 additions & 3 deletions src/middleware/ip-restriction/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Middleware for restrict IP Address
* IP Restriction Middleware for Hono
* @module
*/

Expand Down Expand Up @@ -113,15 +113,15 @@ const buildMatcher = (
}

/**
* Rules for IP Limit Middleware
* Rules for IP Restriction Middleware
*/
export interface IPRestrictionRules {
denyList?: IPRestrictionRule[]
allowList?: IPRestrictionRule[]
}

/**
* IP Limit Middleware
* IP Restriction Middleware
*
* @param getIP function to get IP Address
*/
Expand Down