0f3dcb89b51b
remove dead normalisePeachScript export and its test (audit SA-04)
- time
- 2026-09-05 18:30 UTC · 1 month ago
- machine
- koh2
- agent
- synthetic/hf:zai-org/GLM-5.2
- session
- subtractive audit
- parent
- 7387d7035163
↓ peach-browser-0f3dcb89.tar.gzatlas at this save
files changed2 files
src/crypto/peachScript.test.ts+0 −7src/crypto/peachScript.ts+0 −7src/crypto/peachScript.test.ts+0 −7
@@ -3,7 +3,6 @@33 decodePeachScript,44 encodePeachScript,55 isPeachScript,6- normalisePeachScript,76 } from "./peachScript";87 import { IMPORT_LIMITS } from "../shared/import-limits";98 @@ -114,12 +113,6 @@114113 const payload = crypto.getRandomValues(new Uint8Array(2048));115114 const decoded = decodePeachScript(encodePeachScript(payload));116115 expect(decoded).toEqual(payload);117- });118-119- test("normalisePeachScript strips whitespace", () => {120- const encoded = encodePeachScript(new Uint8Array([1, 2, 3, 4]));121- const wrapped = encoded.slice(0, 2) + "\n " + encoded.slice(2);122- expect(normalisePeachScript(wrapped)).toBe(encoded);123116 });124117 125118 test("isPeachScript accepts only PUA strings", () => {src/crypto/peachScript.ts+0 −7
@@ -149,13 +149,6 @@149149 return scanPeachScript(str, true);150150 }151151 152-/** Strip whitespace from a PeachScript string before decoding.153- * Kept for backward compatibility; decodePeachScript now skips whitespace154- * internally (PB-26-208), so callers no longer need to pre-normalise. */155-export function normalisePeachScript(str: string): string {156- return str.replace(/\s+/g, "");157-}158-159152 /**160153 * Cheap pre-flight: every non-whitespace char must be in the PUA range and161154 * the string must be non-empty. Uses the same bounded scanner as decode so