refactor(daemon): reuse shared path normalizer · openclaw/openclaw@626a22d
obviyus
·
2026-05-02
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | import path from "node:path"; |
| 2 | +import { normalizeLowercaseStringOrEmpty } from "../shared/string-coerce.js"; |
2 | 3 | |
3 | 4 | function getPathModule(platform: NodeJS.Platform) { |
4 | 5 | return platform === "win32" ? path.win32 : path.posix; |
5 | 6 | } |
6 | 7 | |
7 | | -function normalizeLowercaseStringOrEmpty(value: string | undefined): string { |
8 | | -return value?.trim().toLowerCase() ?? ""; |
9 | | -} |
10 | | - |
11 | 8 | export function normalizeServicePathEntry(entry: string, platform: NodeJS.Platform): string { |
12 | 9 | const pathModule = getPathModule(platform); |
13 | 10 | const normalized = pathModule.normalize(entry).replaceAll("\\", "/"); |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。