Skip to content

Commit

Permalink
Replace assert altogether
Browse files Browse the repository at this point in the history
  • Loading branch information
rikhuijzer committed Jan 22, 2024
1 parent 9de6c7d commit 92804f1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions frontend.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ function addSelectOption(selector, text, enabled, value) {

function getElementById(id) {
const elem = document.getElementById(id);
var assert = require('assert');
assert(elem != null);
if (elem == null) {
throw new Error("Expected to find element with id: " + id);
}
return elem;
}

Expand Down

0 comments on commit 92804f1

Please sign in to comment.