UNPKG

window-resizeto

Version:

A window.resizeTo polyfill for test environments like Jest & JSDOM

18 lines (14 loc) 454 B
'use strict'; function resizeTo(windowObj, width, height) { Object.assign(windowObj, { innerWidth: width, innerHeight: height, outerWidth: width, outerHeight: height }).dispatchEvent(new windowObj.Event('resize')); } // we don't check `if (!('resizeTo' in window))` first because JSDOM sets it to window.resizeTo = function (width, height) { resizeTo(this, width, height); }; //# sourceMappingURL=polyfill.cjs.development.js.map