]> git.ardis.lu - ens2hex/commitdiff
Change filter to allow TLDs other than ".eth"
authorArdis Lu <ardisglu@gmail.com>
Sun, 5 Jan 2025 05:17:35 +0000 (21:17 -0800)
committerArdis Lu <ardisglu@gmail.com>
Sun, 5 Jan 2025 05:17:35 +0000 (21:17 -0800)
index.html

index b32a1804ca60dce9253bd32d06e33097588b8b47..237e562e5a4f32b1aad9874de6aed808298fdb5b 100644 (file)
       const block = formData.get('block') === '' ? 'latest' : Number(formData.get('block'));
       const combined = `${formData.get('text')}\n${await formData.get('file').text()}`; // Concatenate textarea and file inputs
       const parsed = new Set(combined.split('\n').map(c => c.split(',')).flat().map(e => e.trim().toLocaleLowerCase())); // Split on newline or comma, flatten, trim whitespace, lowercase, and de-duplicate
-      const cleaned = [...parsed].filter(name => name.slice(-4) === '.eth'); // Remove anything that does not end in '.eth'
+      const cleaned = [...parsed].filter(name => name.includes('.')); // Remove anything that does not have a dot, names must have at least one
 
       if (cleaned.length === 0) {
         status.textContent = 'No valid ENS names found.';
This page took 0.040778 seconds and 4 git commands to generate.