feat: Add Line plugin (#1630)
* feat: add LINE plugin (#1630) (thanks @plum-dawg) * feat: complete LINE plugin (#1630) (thanks @plum-dawg) * chore: drop line plugin node_modules (#1630) (thanks @plum-dawg) * test: mock /context report in commands test (#1630) (thanks @plum-dawg) * test: limit macOS CI workers to avoid OOM (#1630) (thanks @plum-dawg) * test: reduce macOS CI vitest workers (#1630) (thanks @plum-dawg) --------- Co-authored-by: Peter Steinberger <steipete@gmail.com>
This commit is contained in:
12
src/plugins/http-path.ts
Normal file
12
src/plugins/http-path.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
export function normalizePluginHttpPath(
|
||||
path?: string | null,
|
||||
fallback?: string | null,
|
||||
): string | null {
|
||||
const trimmed = path?.trim();
|
||||
if (!trimmed) {
|
||||
const fallbackTrimmed = fallback?.trim();
|
||||
if (!fallbackTrimmed) return null;
|
||||
return fallbackTrimmed.startsWith("/") ? fallbackTrimmed : `/${fallbackTrimmed}`;
|
||||
}
|
||||
return trimmed.startsWith("/") ? trimmed : `/${trimmed}`;
|
||||
}
|
||||
Reference in New Issue
Block a user