7 lines
353 B
JavaScript
7 lines
353 B
JavaScript
const fs = require('fs');
|
|
const html = fs.readFileSync('internal/httpserver/ui.html', 'utf8');
|
|
new Function(html.split('<script>')[1].split('</script>')[0]);
|
|
const ids = [...html.matchAll(/\bid="([^"]+)"/g)].map(m=>m[1]);
|
|
if(new Set(ids).size !== ids.length) throw Error('Duplicate DOM IDs');
|
|
console.log('UI JavaScript syntax and unique DOM IDs: OK');
|