chore: replace deprecated lodash.isequal

This commit is contained in:
Tim 2026-01-14 03:06:48 +01:00
parent da675cd56c
commit 9dbf950a40
6 changed files with 19 additions and 30 deletions

View file

@ -25,13 +25,13 @@
"buffer": "6.0.3", "buffer": "6.0.3",
"classnames": "2.5.1", "classnames": "2.5.1",
"eventemitter3": "5.0.1", "eventemitter3": "5.0.1",
"fast-equals": "^6.0.0",
"filter-invalid-dom-props": "3.0.1", "filter-invalid-dom-props": "3.0.1",
"hat": "^0.0.3", "hat": "^0.0.3",
"i18next": "^24.0.5", "i18next": "^24.0.5",
"langs": "github:Stremio/nodejs-langs", "langs": "github:Stremio/nodejs-langs",
"lodash.debounce": "4.0.8", "lodash.debounce": "4.0.8",
"lodash.intersection": "4.4.0", "lodash.intersection": "4.4.0",
"lodash.isequal": "4.5.0",
"lodash.throttle": "4.1.1", "lodash.throttle": "4.1.1",
"magnet-uri": "6.2.0", "magnet-uri": "6.2.0",
"prop-types": "15.8.1", "prop-types": "15.8.1",
@ -53,7 +53,6 @@
"@stylistic/eslint-plugin": "^5.4.0", "@stylistic/eslint-plugin": "^5.4.0",
"@stylistic/eslint-plugin-jsx": "^4.4.1", "@stylistic/eslint-plugin-jsx": "^4.4.1",
"@types/hat": "^0.0.4", "@types/hat": "^0.0.4",
"@types/lodash.isequal": "^4.5.8",
"@types/lodash.throttle": "^4.1.9", "@types/lodash.throttle": "^4.1.9",
"@types/react": "^18.3.13", "@types/react": "^18.3.13",
"@types/react-dom": "^18.3.1", "@types/react-dom": "^18.3.1",

View file

@ -41,6 +41,9 @@ importers:
eventemitter3: eventemitter3:
specifier: 5.0.1 specifier: 5.0.1
version: 5.0.1 version: 5.0.1
fast-equals:
specifier: ^6.0.0
version: 6.0.0
filter-invalid-dom-props: filter-invalid-dom-props:
specifier: 3.0.1 specifier: 3.0.1
version: 3.0.1 version: 3.0.1
@ -59,9 +62,6 @@ importers:
lodash.intersection: lodash.intersection:
specifier: 4.4.0 specifier: 4.4.0
version: 4.4.0 version: 4.4.0
lodash.isequal:
specifier: 4.5.0
version: 4.5.0
lodash.throttle: lodash.throttle:
specifier: 4.1.1 specifier: 4.1.1
version: 4.1.1 version: 4.1.1
@ -120,9 +120,6 @@ importers:
'@types/hat': '@types/hat':
specifier: ^0.0.4 specifier: ^0.0.4
version: 0.0.4 version: 0.0.4
'@types/lodash.isequal':
specifier: ^4.5.8
version: 4.5.8
'@types/lodash.throttle': '@types/lodash.throttle':
specifier: ^4.1.9 specifier: ^4.1.9
version: 4.1.9 version: 4.1.9
@ -1401,9 +1398,6 @@ packages:
'@types/json-schema@7.0.15': '@types/json-schema@7.0.15':
resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==} resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==}
'@types/lodash.isequal@4.5.8':
resolution: {integrity: sha512-uput6pg4E/tj2LGxCZo9+y27JNyB2OZuuI/T5F+ylVDYuqICLG2/ktjxx0v6GvVntAf8TvEzeQLcV0ffRirXuA==}
'@types/lodash.throttle@4.1.9': '@types/lodash.throttle@4.1.9':
resolution: {integrity: sha512-PCPVfpfueguWZQB7pJQK890F2scYKoDUL3iM522AptHWn7d5NQmeS/LTEHIcLr5PaTzl3dK2Z0xSUHHTHwaL5g==} resolution: {integrity: sha512-PCPVfpfueguWZQB7pJQK890F2scYKoDUL3iM522AptHWn7d5NQmeS/LTEHIcLr5PaTzl3dK2Z0xSUHHTHwaL5g==}
@ -2502,6 +2496,10 @@ packages:
fast-deep-equal@3.1.3: fast-deep-equal@3.1.3:
resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==}
fast-equals@6.0.0:
resolution: {integrity: sha512-PFhhIGgdM79r5Uztdj9Zb6Tt1zKafqVfdMGwVca1z5z6fbX7DmsySSuJd8HiP6I1j505DCS83cLxo5rmSNeVEA==}
engines: {node: '>=6.0.0'}
fast-glob@3.3.3: fast-glob@3.3.3:
resolution: {integrity: sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==} resolution: {integrity: sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==}
engines: {node: '>=8.6.0'} engines: {node: '>=8.6.0'}
@ -3402,10 +3400,6 @@ packages:
lodash.intersection@4.4.0: lodash.intersection@4.4.0:
resolution: {integrity: sha512-N+L0cCfnqMv6mxXtSPeKt+IavbOBBSiAEkKyLasZ8BVcP9YXQgxLO12oPR8OyURwKV8l5vJKiE1M8aS70heuMg==} resolution: {integrity: sha512-N+L0cCfnqMv6mxXtSPeKt+IavbOBBSiAEkKyLasZ8BVcP9YXQgxLO12oPR8OyURwKV8l5vJKiE1M8aS70heuMg==}
lodash.isequal@4.5.0:
resolution: {integrity: sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ==}
deprecated: This package is deprecated. Use require('node:util').isDeepStrictEqual instead.
lodash.memoize@4.1.2: lodash.memoize@4.1.2:
resolution: {integrity: sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag==} resolution: {integrity: sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag==}
@ -6706,10 +6700,6 @@ snapshots:
'@types/json-schema@7.0.15': {} '@types/json-schema@7.0.15': {}
'@types/lodash.isequal@4.5.8':
dependencies:
'@types/lodash': 4.17.20
'@types/lodash.throttle@4.1.9': '@types/lodash.throttle@4.1.9':
dependencies: dependencies:
'@types/lodash': 4.17.20 '@types/lodash': 4.17.20
@ -8091,6 +8081,8 @@ snapshots:
fast-deep-equal@3.1.3: {} fast-deep-equal@3.1.3: {}
fast-equals@6.0.0: {}
fast-glob@3.3.3: fast-glob@3.3.3:
dependencies: dependencies:
'@nodelib/fs.stat': 2.0.5 '@nodelib/fs.stat': 2.0.5
@ -9174,8 +9166,6 @@ snapshots:
lodash.intersection@4.4.0: {} lodash.intersection@4.4.0: {}
lodash.isequal@4.5.0: {}
lodash.memoize@4.1.2: {} lodash.memoize@4.1.2: {}
lodash.merge@4.6.2: {} lodash.merge@4.6.2: {}

View file

@ -1,7 +1,7 @@
// Copyright (C) 2017-2023 Smart code 203358507 // Copyright (C) 2017-2023 Smart code 203358507
const React = require('react'); const React = require('react');
const isEqual = require('lodash.isequal'); const { deepEqual } = require('fast-equals');
const { withCoreSuspender, useProfile, useToast } = require('stremio/common'); const { withCoreSuspender, useProfile, useToast } = require('stremio/common');
const { useServices } = require('stremio/services'); const { useServices } = require('stremio/services');
@ -18,7 +18,7 @@ const SearchParamsHandler = () => {
setSearchParams((previousSearchParams) => { setSearchParams((previousSearchParams) => {
const currentSearchParams = Object.fromEntries(searchParams.entries()); const currentSearchParams = Object.fromEntries(searchParams.entries());
return isEqual(previousSearchParams, currentSearchParams) ? previousSearchParams : currentSearchParams; return deepEqual(previousSearchParams, currentSearchParams) ? previousSearchParams : currentSearchParams;
}); });
}; };

View file

@ -2,7 +2,7 @@
const React = require('react'); const React = require('react');
const throttle = require('lodash.throttle'); const throttle = require('lodash.throttle');
const isEqual = require('lodash.isequal'); const { deepEqual } = require('fast-equals');
const intersection = require('lodash.intersection'); const intersection = require('lodash.intersection');
const { useCoreSuspender } = require('stremio/common/CoreSuspender'); const { useCoreSuspender } = require('stremio/common/CoreSuspender');
const { useRouteFocused } = require('stremio-router'); const { useRouteFocused } = require('stremio-router');
@ -19,7 +19,7 @@ const useModelState = ({ action, ...args }) => {
const [state, setState] = React.useReducer( const [state, setState] = React.useReducer(
(prevState, nextState) => { (prevState, nextState) => {
return Object.keys(prevState).reduce((result, key) => { return Object.keys(prevState).reduce((result, key) => {
result[key] = isEqual(prevState[key], nextState[key]) ? prevState[key] : nextState[key]; result[key] = deepEqual(prevState[key], nextState[key]) ? prevState[key] : nextState[key];
return result; return result;
}, {}); }, {});
}, },

View file

@ -5,7 +5,7 @@ const ReactIs = require('react-is');
const PropTypes = require('prop-types'); const PropTypes = require('prop-types');
const classnames = require('classnames'); const classnames = require('classnames');
const UrlUtils = require('url'); const UrlUtils = require('url');
const isEqual = require('lodash.isequal'); const { deepEqual } = require('fast-equals');
const { RouteFocusedProvider } = require('../RouteFocusedContext'); const { RouteFocusedProvider } = require('../RouteFocusedContext');
const Route = require('../Route'); const Route = require('../Route');
const routeConfigForPath = require('./routeConfigForPath'); const routeConfigForPath = require('./routeConfigForPath');
@ -54,11 +54,11 @@ const Router = ({ className, onPathNotMatch, onRouteChange, ...props }) => {
return { return {
key: `${routeViewIndex}${routeIndex}`, key: `${routeViewIndex}${routeIndex}`,
component: routeConfig.component, component: routeConfig.component,
urlParams: view !== null && isEqual(view.urlParams, urlParams) ? urlParams: view !== null && deepEqual(view.urlParams, urlParams) ?
view.urlParams view.urlParams
: :
urlParams, urlParams,
queryParams: view !== null && isEqual(Array.from(view.queryParams.entries()), Array.from(queryParams.entries())) ? queryParams: view !== null && deepEqual(Array.from(view.queryParams.entries()), Array.from(queryParams.entries())) ?
view.queryParams view.queryParams
: :
queryParams queryParams

View file

@ -2,7 +2,7 @@
import { useMemo } from 'react'; import { useMemo } from 'react';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import isEqual from 'lodash.isequal'; import { deepEqual } from 'fast-equals';
import { useServices } from 'stremio/services'; import { useServices } from 'stremio/services';
const CACHE_SIZES = [0, 2147483648, 5368709120, 10737418240, null]; const CACHE_SIZES = [0, 2147483648, 5368709120, 10737418240, null];
@ -160,7 +160,7 @@ const useStreamingOptions = (streamingServer: StreamingServer) => {
btRequestTimeout: settings.btRequestTimeout btRequestTimeout: settings.btRequestTimeout
}; };
const isCustomTorrentProfileSelected = Object.values(TORRENT_PROFILES).every((torrentProfile) => { const isCustomTorrentProfileSelected = Object.values(TORRENT_PROFILES).every((torrentProfile) => {
return !isEqual(torrentProfile, selectedTorrentProfile); return !deepEqual(torrentProfile, selectedTorrentProfile);
}); });
return { return {
options: Object.keys(TORRENT_PROFILES) options: Object.keys(TORRENT_PROFILES)