Remove unnecessary exports of file-local helpers
Remove the `export` keyword from functions that are only used within their own file and are not part of any package's public API: - `parseStringsParam` and `isOrder` in notifications-backend - `toWeb` in backend-defaults urlReader - `resolvePublicPath` in app-backend Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com> Made-with: Cursor
This commit is contained in:
@@ -42,7 +42,7 @@ export function responseToReadable(response: Response): Readable {
|
||||
// The NodeJS ReadableStream is that fetch returns is super basic and not even
|
||||
// iterable. This function converts it to the smarter, iterable stream/web
|
||||
// variant instead.
|
||||
export function toWeb(
|
||||
function toWeb(
|
||||
responseBody: ReadableStream<Uint8Array>,
|
||||
): WebReadableStream<Uint8Array> {
|
||||
const reader = responseBody.getReader();
|
||||
|
||||
@@ -70,7 +70,7 @@ ${JSON.stringify(appConfigs, null, 2)
|
||||
return Buffer.from(indexHtmlContentWithConfig, 'utf8');
|
||||
}
|
||||
|
||||
export function resolvePublicPath(config: Config) {
|
||||
function resolvePublicPath(config: Config) {
|
||||
const baseUrl = new URL(
|
||||
config.getOptionalString('app.baseUrl') ?? '/',
|
||||
'http://localhost:7007',
|
||||
|
||||
@@ -23,10 +23,7 @@ import { EntityOrder } from '../database';
|
||||
* Takes a single unknown parameter and makes sure that it's a single string or
|
||||
* an array of strings, and returns as an array.
|
||||
*/
|
||||
export function parseStringsParam(
|
||||
param: unknown,
|
||||
ctx: string,
|
||||
): string[] | undefined {
|
||||
function parseStringsParam(param: unknown, ctx: string): string[] | undefined {
|
||||
if (param === undefined) {
|
||||
return undefined;
|
||||
}
|
||||
@@ -57,6 +54,6 @@ export function parseEntityOrderFieldParams(
|
||||
});
|
||||
}
|
||||
|
||||
export function isOrder(order: string): order is 'asc' | 'desc' {
|
||||
function isOrder(order: string): order is 'asc' | 'desc' {
|
||||
return ['asc', 'desc'].includes(order);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user