for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
export var isShiftPressed = false;
export var isCtrlPressed = false;
export function isHtmlElement(object) {
return object instanceof HTMLElement;
HTMLElement
/** global: HTMLElement */
This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.
To learn more about declaring variables in Javascript, see the MDN.
}
export function initHelpers() {
document.addEventListener('keydown', event => handleKeyDown(event));
document.addEventListener('keyup', event => handleKeyUp(event));
export function onReady(fn) {
if (document.readyState != 'loading') {
fn();
} else {
document.addEventListener('DOMContentLoaded', fn);
export function assigned(obj) {
return !(typeof obj === 'undefined' || obj === null);
function handleKeyDown(event) {
handleKeyToggle(event, true);
function handleKeyUp(event) {
handleKeyToggle(event, false);
function handleKeyToggle(event, isPressed) {
if (event.key === 'Shift') {
isShiftPressed = isPressed;
} else if (event.key === 'Control') {
isCtrlPressed = isPressed;
This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.
To learn more about declaring variables in Javascript, see the MDN.