mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-06 04:52:21 -07:00
Upgrade TypeScript and core-js
(cherry picked from commit 148480909917f69ff3b2ca547ccb4716dd56606e) Closes #5306
This commit is contained in:
parent
44a5654918
commit
198a13755f
6 changed files with 37 additions and 16 deletions
|
@ -1,4 +1,5 @@
|
||||||
import { createSelector } from 'reselect';
|
import { createSelector } from 'reselect';
|
||||||
|
import AlbumAppState from 'App/State/AlbumAppState';
|
||||||
import AppState from 'App/State/AppState';
|
import AppState from 'App/State/AppState';
|
||||||
import Artist from 'Artist/Artist';
|
import Artist from 'Artist/Artist';
|
||||||
import { createArtistSelectorForHook } from './createArtistSelector';
|
import { createArtistSelectorForHook } from './createArtistSelector';
|
||||||
|
@ -7,7 +8,7 @@ function createArtistAlbumsSelector(artistId: number) {
|
||||||
return createSelector(
|
return createSelector(
|
||||||
(state: AppState) => state.albums,
|
(state: AppState) => state.albums,
|
||||||
createArtistSelectorForHook(artistId),
|
createArtistSelectorForHook(artistId),
|
||||||
(albums, artist = {} as Artist) => {
|
(albums: AlbumAppState, artist = {} as Artist) => {
|
||||||
const { isFetching, isPopulated, error, items } = albums;
|
const { isFetching, isPopulated, error, items } = albums;
|
||||||
|
|
||||||
const filteredAlbums = items.filter(
|
const filteredAlbums = items.filter(
|
||||||
|
|
|
@ -1,13 +1,14 @@
|
||||||
import { createSelector } from 'reselect';
|
import { createSelector } from 'reselect';
|
||||||
import AppState from 'App/State/AppState';
|
import AppState from 'App/State/AppState';
|
||||||
import Artist from 'Artist/Artist';
|
import Artist from 'Artist/Artist';
|
||||||
|
import MetadataProfile from 'typings/MetadataProfile';
|
||||||
import { createArtistSelectorForHook } from './createArtistSelector';
|
import { createArtistSelectorForHook } from './createArtistSelector';
|
||||||
|
|
||||||
function createArtistMetadataProfileSelector(artistId: number) {
|
function createArtistMetadataProfileSelector(artistId: number) {
|
||||||
return createSelector(
|
return createSelector(
|
||||||
(state: AppState) => state.settings.metadataProfiles.items,
|
(state: AppState) => state.settings.metadataProfiles.items,
|
||||||
createArtistSelectorForHook(artistId),
|
createArtistSelectorForHook(artistId),
|
||||||
(metadataProfiles, artist = {} as Artist) => {
|
(metadataProfiles: MetadataProfile[], artist = {} as Artist) => {
|
||||||
return metadataProfiles.find((profile) => {
|
return metadataProfiles.find((profile) => {
|
||||||
return profile.id === artist.metadataProfileId;
|
return profile.id === artist.metadataProfileId;
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,13 +1,14 @@
|
||||||
import { createSelector } from 'reselect';
|
import { createSelector } from 'reselect';
|
||||||
import AppState from 'App/State/AppState';
|
import AppState from 'App/State/AppState';
|
||||||
import Artist from 'Artist/Artist';
|
import Artist from 'Artist/Artist';
|
||||||
|
import QualityProfile from 'typings/QualityProfile';
|
||||||
import { createArtistSelectorForHook } from './createArtistSelector';
|
import { createArtistSelectorForHook } from './createArtistSelector';
|
||||||
|
|
||||||
function createArtistQualityProfileSelector(artistId: number) {
|
function createArtistQualityProfileSelector(artistId: number) {
|
||||||
return createSelector(
|
return createSelector(
|
||||||
(state: AppState) => state.settings.qualityProfiles.items,
|
(state: AppState) => state.settings.qualityProfiles.items,
|
||||||
createArtistSelectorForHook(artistId),
|
createArtistSelectorForHook(artistId),
|
||||||
(qualityProfiles, artist = {} as Artist) => {
|
(qualityProfiles: QualityProfile[], artist = {} as Artist) => {
|
||||||
return qualityProfiles.find(
|
return qualityProfiles.find(
|
||||||
(profile) => profile.id === artist.qualityProfileId
|
(profile) => profile.id === artist.qualityProfileId
|
||||||
);
|
);
|
||||||
|
|
|
@ -6,15 +6,33 @@ import isTomorrow from 'Utilities/Date/isTomorrow';
|
||||||
import isYesterday from 'Utilities/Date/isYesterday';
|
import isYesterday from 'Utilities/Date/isYesterday';
|
||||||
import translate from 'Utilities/String/translate';
|
import translate from 'Utilities/String/translate';
|
||||||
|
|
||||||
function getRelativeDate(date, shortDateFormat, showRelativeDates, { timeFormat, includeSeconds = false, timeForToday = false } = {}) {
|
interface GetRelativeDateOptions {
|
||||||
|
timeFormat?: string;
|
||||||
|
includeSeconds?: boolean;
|
||||||
|
timeForToday?: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getRelativeDate(
|
||||||
|
date: string | undefined,
|
||||||
|
shortDateFormat: string,
|
||||||
|
showRelativeDates: boolean,
|
||||||
|
{
|
||||||
|
timeFormat,
|
||||||
|
includeSeconds = false,
|
||||||
|
timeForToday = false,
|
||||||
|
}: GetRelativeDateOptions = {}
|
||||||
|
) {
|
||||||
if (!date) {
|
if (!date) {
|
||||||
return null;
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
const isTodayDate = isToday(date);
|
const isTodayDate = isToday(date);
|
||||||
|
|
||||||
if (isTodayDate && timeForToday && timeFormat) {
|
if (isTodayDate && timeForToday && timeFormat) {
|
||||||
return formatTime(date, timeFormat, { includeMinuteZero: true, includeSeconds });
|
return formatTime(date, timeFormat, {
|
||||||
|
includeMinuteZero: true,
|
||||||
|
includeSeconds,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!showRelativeDates) {
|
if (!showRelativeDates) {
|
|
@ -86,7 +86,7 @@
|
||||||
"redux-thunk": "2.4.2",
|
"redux-thunk": "2.4.2",
|
||||||
"reselect": "4.1.8",
|
"reselect": "4.1.8",
|
||||||
"stacktrace-js": "2.0.2",
|
"stacktrace-js": "2.0.2",
|
||||||
"typescript": "5.1.6"
|
"typescript": "5.7.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "7.26.0",
|
"@babel/core": "7.26.0",
|
||||||
|
@ -109,7 +109,7 @@
|
||||||
"babel-loader": "9.2.1",
|
"babel-loader": "9.2.1",
|
||||||
"babel-plugin-inline-classnames": "2.0.1",
|
"babel-plugin-inline-classnames": "2.0.1",
|
||||||
"babel-plugin-transform-react-remove-prop-types": "0.4.24",
|
"babel-plugin-transform-react-remove-prop-types": "0.4.24",
|
||||||
"core-js": "3.38.1",
|
"core-js": "3.39.0",
|
||||||
"css-loader": "6.7.3",
|
"css-loader": "6.7.3",
|
||||||
"css-modules-typescript-loader": "4.0.1",
|
"css-modules-typescript-loader": "4.0.1",
|
||||||
"eslint": "8.57.1",
|
"eslint": "8.57.1",
|
||||||
|
|
16
yarn.lock
16
yarn.lock
|
@ -2541,10 +2541,10 @@ core-js-compat@^3.38.0, core-js-compat@^3.38.1:
|
||||||
dependencies:
|
dependencies:
|
||||||
browserslist "^4.23.3"
|
browserslist "^4.23.3"
|
||||||
|
|
||||||
core-js@3.38.1:
|
core-js@3.39.0:
|
||||||
version "3.38.1"
|
version "3.39.0"
|
||||||
resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.38.1.tgz#aa375b79a286a670388a1a363363d53677c0383e"
|
resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.39.0.tgz#57f7647f4d2d030c32a72ea23a0555b2eaa30f83"
|
||||||
integrity sha512-OP35aUorbU3Zvlx7pjsFdu1rGNnD4pgw/CWoYzRY3t2EzoVT7shKHY1dlAy3f41cGIO7ZDPQimhGFTlEYkG/Hw==
|
integrity sha512-raM0ew0/jJUqkJ0E6e8UDtl+y/7ktFivgWvqw8dNSQeNWoSDLvQ1H/RN3aPXB9tBd4/FhyR4RDPGhsNIMsAn7g==
|
||||||
|
|
||||||
core-js@^2.4.0:
|
core-js@^2.4.0:
|
||||||
version "2.6.12"
|
version "2.6.12"
|
||||||
|
@ -6900,10 +6900,10 @@ typescript-plugin-css-modules@5.0.1:
|
||||||
stylus "^0.59.0"
|
stylus "^0.59.0"
|
||||||
tsconfig-paths "^4.1.2"
|
tsconfig-paths "^4.1.2"
|
||||||
|
|
||||||
typescript@5.1.6:
|
typescript@5.7.2:
|
||||||
version "5.1.6"
|
version "5.7.2"
|
||||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.1.6.tgz#02f8ac202b6dad2c0dd5e0913745b47a37998274"
|
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.7.2.tgz#3169cf8c4c8a828cde53ba9ecb3d2b1d5dd67be6"
|
||||||
integrity sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==
|
integrity sha512-i5t66RHxDvVN40HfDd1PsEThGNnlMCMT3jMUuoh9/0TaqWevNontacunWyN02LA9/fIbEWlcHZcgTKb9QoaLfg==
|
||||||
|
|
||||||
unbox-primitive@^1.0.2:
|
unbox-primitive@^1.0.2:
|
||||||
version "1.0.2"
|
version "1.0.2"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue