refactor(all): strict boolean conditions

This commit is contained in:
Manu Mtz.-Almeida
2018-08-31 18:59:09 +02:00
parent f383ebdf13
commit ba2230510e
96 changed files with 990 additions and 962 deletions

View File

@ -10,12 +10,12 @@ export function reorderArray(array: any[], indexes: {from: number, to: number}):
}
export function hasShadowDom(el: HTMLElement) {
return !!el.shadowRoot && !!el.attachShadow;
return !!el.shadowRoot && !!(el as any).attachShadow;
}
export function renderHiddenInput(container: HTMLElement, name: string, value: string, disabled: boolean) {
if (hasShadowDom(container)) {
let input = container.querySelector('input.aux-input') as HTMLInputElement;
let input = container.querySelector('input.aux-input') as HTMLInputElement | null;
if (!input) {
input = container.ownerDocument.createElement('input');
input.type = 'hidden';