Skip to content

Commit

Permalink
refactor: implementing XOs suggestion
Browse files Browse the repository at this point in the history
unicorn/no-typeof-undefined
  • Loading branch information
mfranzke committed May 27, 2023
1 parent 07c53a0 commit 1b626ec
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/loading-attribute-polyfill.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ function onIntersection(entries, observer) {
* Handle printing the page
*/
function onPrinting() {
if (typeof window.matchMedia === 'undefined') {
if (window.matchMedia === undefined) {
return;
}

Expand Down Expand Up @@ -170,7 +170,7 @@ function getAndPrepareHTMLCode(noScriptTag) {
capabilities.scrolling
) {
// Check for IntersectionObserver support
if (typeof intersectionObserver === 'undefined') {
if (intersectionObserver === undefined) {
// Attach abandonned attribute 'lazyload' to the HTML tags on browsers w/o IntersectionObserver being available
lazyAreaHtml = lazyAreaHtml.replace(
/(?:\r\n|\r|\n|\t| )src=/g,
Expand Down Expand Up @@ -214,7 +214,7 @@ function prepareElement(noScriptTag) {

if (
capabilities.scrolling &&
typeof intersectionObserver !== 'undefined' &&
intersectionObserver !== undefined &&
actualChild.tagName &&
(((actualChild.tagName.toLowerCase() === 'img' ||
actualChild.tagName.toLowerCase() === 'picture') &&
Expand Down

0 comments on commit 1b626ec

Please sign in to comment.