diff --git a/src/utils/is.js b/src/utils/is.js index 876ab47..00eb89b 100644 --- a/src/utils/is.js +++ b/src/utils/is.js @@ -69,7 +69,5 @@ export const isDomainOrSubdomain = (destination, original) => { const orig = new URL(original).hostname; const dest = new URL(destination).hostname; - return orig === dest || ( - orig[orig.length - dest.length - 1] === '.' && orig.endsWith(dest) - ); + return orig === dest || orig.endsWith(`.${dest}`); };