refactor: hide utility helper internals

This commit is contained in:
Peter Steinberger
2026-05-02 07:33:05 +01:00
parent 8adbee3a68
commit 7f13a43ebb
4 changed files with 5 additions and 7 deletions

View File

@@ -9,7 +9,7 @@ function isJsonObject(value: unknown): value is Record<string, unknown> {
return typeof value === "object" && value !== null && !Array.isArray(value);
}
export function decodeJsonPointerToken(token: string): string {
function decodeJsonPointerToken(token: string): string {
return token.replace(/~1/g, "/").replace(/~0/g, "~");
}

View File

@@ -134,7 +134,7 @@ export function ensureObject(
return next;
}
export function normalizeKnownProvider(
function normalizeKnownProvider(
value: unknown,
providers: Array<{ id: string }>,
): string | undefined {

View File

@@ -10,9 +10,7 @@ type NetworkInterfaceEntryInput = {
netmask?: string;
};
export function makeNetworkInterfaceEntry(
input: NetworkInterfaceEntryInput,
): NetworkInterfaceEntry {
function makeNetworkInterfaceEntry(input: NetworkInterfaceEntryInput): NetworkInterfaceEntry {
if (input.family === "IPv6") {
return {
address: input.address,

View File

@@ -12,7 +12,7 @@ const WORD_BOUNDARY_CHARS = /[\s\-_./:#@]/;
/**
* Check if position is at a word boundary.
*/
export function isWordBoundary(text: string, index: number): boolean {
function isWordBoundary(text: string, index: number): boolean {
return index === 0 || WORD_BOUNDARY_CHARS.test(text[index - 1] ?? "");
}
@@ -42,7 +42,7 @@ export function findWordBoundaryIndex(text: string, query: string): number | nul
* Fuzzy match with pre-lowercased inputs (avoids toLowerCase on every keystroke).
* Returns score (lower = better) or null if no match.
*/
export function fuzzyMatchLower(queryLower: string, textLower: string): number | null {
function fuzzyMatchLower(queryLower: string, textLower: string): number | null {
if (queryLower.length === 0) {
return 0;
}