Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions logic_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ Deno.test("getRemovableFiles never removes #keeplist.txt", () => {
Deno.test("resolveKeeplistName uses default and prefixed keeplist names deterministically", () => {
assertEquals(resolveKeeplistName(null), "#keeplist.txt");
assertEquals(resolveKeeplistName("vanilla"), "#vanilla-keeplist.txt");
assertEquals(
resolveKeeplistName("Vanilla_Profile"),
"#Vanilla_Profile-keeplist.txt",
);
});

Deno.test("getRemovableFiles never removes the active prefixed keeplist", () => {
Expand Down
5 changes: 2 additions & 3 deletions main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -490,14 +490,13 @@ function applyPrefixValue(rawValue) {
return true;
}

const normalized = trimmed.toLowerCase();
if (!/^[a-z0-9_-]+$/.test(normalized)) {
if (!/^[A-Za-z0-9_-]+$/.test(trimmed)) {
setPrefixValidationError("Prefix must use only letters, numbers, underscores, or hyphens.");
updateActiveKeeplistName();
return false;
}

keeplistPrefix = normalized;
keeplistPrefix = trimmed;
setPrefixValidationError("");
updateActiveKeeplistName();
return true;
Expand Down