Skip to content

Commit

Permalink
chore: update comments in codes (#3145)
Browse files Browse the repository at this point in the history
  • Loading branch information
yusukebe committed Jul 16, 2024
1 parent 1cee728 commit 1afecac
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
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

0 comments on commit 1afecac

Please sign in to comment.