This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let widestElement = document.body; | |
let widestElementDepth = 0; | |
function checkElemWidth(elem, depth) { | |
const currentWidest = widestElement.getBoundingClientRect(); | |
const boundingRect = elem.getBoundingClientRect(); | |
const currentRight = currentWidest.right; | |
const right = boundingRect.right; | |
if (right >= currentRight && depth > widestElementDepth) { | |
widestElement = elem; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
A collection of tests where Flow and TypeScript might have different behavior | |
Some tests are borrowed from https://github.com/vkurchatkin/typescript-vs-flow | |
Some tests now have the same behavior as the new versions of Flow/TS have fixed the bugs and improved type safety | |
*/ | |
/* 1. Accessing unknown properties on objects */ |