import { sanitizeObject } from './src/utils/sanitizer'; const runTest = (name: string, input: any) => { const output = sanitizeObject(input); console.log(`[${name}] Input: ${JSON.stringify(input)}`); console.log(`[${name}] Output: ${JSON.stringify(output)}`); console.log(`[${name}] Description Empty String: ${output.description === ''}`); console.log('---'); }; console.log('--- SYSTEM SANITIZER OBJECT TEST ---'); // Case 1: Script only (should become empty string) runTest('Script Only', { description: "" }); // Case 2: Encoded script only (should become empty string) runTest('Encoded Script', { description: "<script>alert(1)</script>" }); // Case 3: Script inside valid tags (should become empty string if result is just empty tags) runTest('Script in tags', { description: "
" }); // Case 4: Valid text (should stay same) runTest('Valid Text', { description: "Hello World
" }); // Case 5: Empty tags/spaces (should become empty string) runTest('Empty Tags', { description: "" });