mirror of https://github.com/openclaw/openclaw.git
fix: tighten package tag coverage
This commit is contained in:
parent
369032c256
commit
47a15d7a9a
|
|
@ -12,6 +12,7 @@ describe("normalizePackageTagInput", () => {
|
|||
it("strips known package-name prefixes before returning the tag", () => {
|
||||
expect(normalizePackageTagInput("openclaw@beta", packageNames)).toBe("beta");
|
||||
expect(normalizePackageTagInput("@openclaw/plugin@2026.2.24", packageNames)).toBe("2026.2.24");
|
||||
expect(normalizePackageTagInput("openclaw@ ", packageNames)).toBeNull();
|
||||
});
|
||||
|
||||
it("returns trimmed raw values when no package prefix matches", () => {
|
||||
|
|
|
|||
|
|
@ -10,7 +10,8 @@ export function normalizePackageTagInput(
|
|||
for (const packageName of packageNames) {
|
||||
const prefix = `${packageName}@`;
|
||||
if (trimmed.startsWith(prefix)) {
|
||||
return trimmed.slice(prefix.length);
|
||||
const tag = trimmed.slice(prefix.length).trim();
|
||||
return tag ? tag : null;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue