Skip to content

Commit

Permalink
Rename StaticFileHandlerOpts interface to StaticFileHandlerOptions
Browse files Browse the repository at this point in the history
  • Loading branch information
TooTallNate committed Oct 27, 2024
1 parent fc323bb commit 8d86759
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/moody-pants-learn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@nx.js/http": patch
---

Rename `StaticFileHandlerOpts` interface to `StaticFileHandlerOptions`
5 changes: 4 additions & 1 deletion packages/http/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import { UnshiftableStream } from './unshiftable-readable-stream';
import { readRequest, writeResponse } from './server';

export { createStaticFileHandler, type StaticFileHandlerOpts } from './static';
export {
createStaticFileHandler,
type StaticFileHandlerOptions,
} from './static';

/**
* Handler function for processing an HTTP request.
Expand Down
4 changes: 2 additions & 2 deletions packages/http/src/static.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import mime from 'mime';
/**
* Options object for the {@link createStaticFileHandler | `createStaticFileHandler()`} function.
*/
export interface StaticFileHandlerOpts {
export interface StaticFileHandlerOptions {
/**
* Addional HTTP headers to include in the response. Can be a static
* `Headers` object, or a function which returns a `Headers` object.
Expand Down Expand Up @@ -44,7 +44,7 @@ export function resolvePath(url: string, root: string): URL {
*/
export function createStaticFileHandler(
root: Switch.PathLike,
opts?: StaticFileHandlerOpts,
opts?: StaticFileHandlerOptions,
) {
let rootStr = String(root);
if (!rootStr.endsWith('/')) rootStr += '/';
Expand Down

0 comments on commit 8d86759

Please sign in to comment.