diff --git a/jest.config.ts b/jest.config.ts index 326f2040d9..44b54440e1 100644 --- a/jest.config.ts +++ b/jest.config.ts @@ -37,7 +37,7 @@ const config: Config = { "recorderWorkletFactory": "/__mocks__/empty.js", "^fetch-mock$": "/node_modules/fetch-mock", }, - transformIgnorePatterns: ["/node_modules/(?!(mime|matrix-js-sdk)).+$"], + transformIgnorePatterns: ["/node_modules/(?!(is-ip|mime|matrix-js-sdk)).+$"], collectCoverageFrom: [ "/src/**/*.{js,ts,tsx}", // getSessionLock is piped into a different JS context via stringification, and the coverage functionality is diff --git a/src/utils/permalinks/Permalinks.ts b/src/utils/permalinks/Permalinks.ts index 9ecbf00b68..179885e6d9 100644 --- a/src/utils/permalinks/Permalinks.ts +++ b/src/utils/permalinks/Permalinks.ts @@ -6,7 +6,7 @@ SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only Please see LICENSE files in the repository root for full details. */ -import isIp from "is-ip"; +import { isIP } from "is-ip"; import * as utils from "matrix-js-sdk/src/utils"; import { Room, MatrixClient, RoomStateEvent, EventType } from "matrix-js-sdk/src/matrix"; import { KnownMembership } from "matrix-js-sdk/src/types"; @@ -491,7 +491,7 @@ function isHostnameIpAddress(hostname: string): boolean { hostname = hostname.substring(1, hostname.length - 1); } - return isIp(hostname); + return isIP(hostname); } export const calculateRoomVia = (room: Room): string[] => {