Browse Source
Task/migrate from lodash to lodash-es (#7850)
* Migrate from lodash to lodash-es
* Update changelog
pull/7974/head
Szymon Łągiewka
1 week ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
70 changed files with
102 additions and
72 deletions
-
CHANGELOG.md
-
apps/api/src/app/account-balance/account-balance.service.ts
-
apps/api/src/app/account/account.service.ts
-
apps/api/src/app/activities/activities-filter.dto.ts
-
apps/api/src/app/activities/activities.service.ts
-
apps/api/src/app/asset/asset.controller.ts
-
apps/api/src/app/endpoints/asset-profiles/asset-profiles.service.ts
-
apps/api/src/app/endpoints/benchmarks/benchmarks.service.ts
-
apps/api/src/app/endpoints/data-providers/ghostfolio/ghostfolio.service.ts
-
apps/api/src/app/export/export.service.ts
-
apps/api/src/app/export/get-export.dto.ts
-
apps/api/src/app/import/import.service.ts
-
apps/api/src/app/info/info.service.ts
-
apps/api/src/app/portfolio/calculator/portfolio-calculator.ts
-
apps/api/src/app/portfolio/calculator/roai/portfolio-calculator.ts
-
apps/api/src/app/portfolio/current-rate.service.ts
-
apps/api/src/app/portfolio/portfolio.service.ts
-
apps/api/src/app/symbol/symbol.controller.ts
-
apps/api/src/app/user/user.controller.ts
-
apps/api/src/app/user/user.service.ts
-
apps/api/src/dtos/filter.dto.ts
-
apps/api/src/helper/activity.helper.ts
-
apps/api/src/helper/object.helper.ts
-
apps/api/src/models/rule.ts
-
apps/api/src/services/benchmark/benchmark.service.ts
-
apps/api/src/services/data-provider/data-provider.service.ts
-
apps/api/src/services/data-provider/eod-historical-data/eod-historical-data.service.ts
-
apps/api/src/services/data-provider/financial-modeling-prep/financial-modeling-prep.service.ts
-
apps/api/src/services/data-provider/yahoo-finance/yahoo-finance.service.ts
-
apps/api/src/services/exchange-rate-data/exchange-rate-data.service.ts
-
apps/api/src/services/queues/data-gathering/data-gathering.service.ts
-
apps/api/src/services/twitter-bot/twitter-bot.service.ts
-
apps/client/jest.config.ts
-
apps/client/src/app/components/account-detail-dialog/account-detail-dialog.component.ts
-
apps/client/src/app/components/admin-jobs/admin-jobs.component.ts
-
apps/client/src/app/components/admin-market-data/asset-profile-dialog/asset-profile-dialog.component.ts
-
apps/client/src/app/components/admin-settings/admin-settings.component.ts
-
apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.component.ts
-
apps/client/src/app/components/portfolio-performance/portfolio-performance.component.ts
-
apps/client/src/app/components/portfolio-summary/portfolio-summary.component.ts
-
apps/client/src/app/pages/api/api-page.component.ts
-
apps/client/src/app/pages/portfolio/activities/import-activities-dialog/import-activities-dialog.component.ts
-
apps/client/src/app/pages/portfolio/allocations/allocations-page.component.ts
-
apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts
-
apps/client/src/app/pages/portfolio/fire/fire-page.component.ts
-
apps/client/src/app/services/import-activities.service.ts
-
eslint.config.cjs
-
jest.preset.js
-
libs/common/src/lib/calculation-helper.ts
-
libs/common/src/lib/dtos/create-account.dto.ts
-
libs/common/src/lib/dtos/create-order.dto.ts
-
libs/common/src/lib/dtos/update-account.dto.ts
-
libs/common/src/lib/dtos/update-order.dto.ts
-
libs/common/src/lib/helper.ts
-
libs/ui/jest.config.ts
-
libs/ui/src/lib/account-balances/account-balances.component.ts
-
libs/ui/src/lib/activities-filter/activities-filter.component.ts
-
libs/ui/src/lib/assistant/assistant.component.ts
-
libs/ui/src/lib/benchmark/benchmark.component.ts
-
libs/ui/src/lib/fire-calculator/fire-calculator.component.ts
-
libs/ui/src/lib/historical-market-data-editor/historical-market-data-editor-dialog/historical-market-data-editor-dialog.component.ts
-
libs/ui/src/lib/notifications/notification.service.ts
-
libs/ui/src/lib/services/admin.service.ts
-
libs/ui/src/lib/services/data.service.ts
-
libs/ui/src/lib/symbol-autocomplete/symbol-autocomplete.component.ts
-
libs/ui/src/lib/top-holdings/top-holdings.component.ts
-
libs/ui/src/lib/treemap-chart/treemap-chart.component.ts
-
libs/ui/src/lib/value/value.component.ts
-
package-lock.json
-
package.json
|
|
|
@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 |
|
|
|
|
|
|
|
- Extended the emergency fund dialog in the portfolio summary to include the currency suffix |
|
|
|
- Migrated the client to the code generated by the new `prisma-client` generator of _Prisma_ |
|
|
|
- Migrated from `lodash` to `lodash-es` |
|
|
|
|
|
|
|
### Fixed |
|
|
|
|
|
|
|
|
|
|
|
@ -24,7 +24,7 @@ import { EventEmitter2 } from '@nestjs/event-emitter'; |
|
|
|
import { AccountBalance, Prisma } from '@prisma/client'; |
|
|
|
import { Big } from 'big.js'; |
|
|
|
import { endOfToday, format, min, parseISO } from 'date-fns'; |
|
|
|
import { groupBy } from 'lodash'; |
|
|
|
import { groupBy } from 'lodash-es'; |
|
|
|
|
|
|
|
@Injectable() |
|
|
|
export class AccountBalanceService { |
|
|
|
|
|
|
|
@ -28,7 +28,7 @@ import { |
|
|
|
} from '@prisma/client'; |
|
|
|
import { Big } from 'big.js'; |
|
|
|
import { format } from 'date-fns'; |
|
|
|
import { groupBy, isNil } from 'lodash'; |
|
|
|
import { groupBy, isNil } from 'lodash-es'; |
|
|
|
|
|
|
|
import { CashDetails } from './interfaces/cash-details.interface'; |
|
|
|
|
|
|
|
|
|
|
|
@ -5,7 +5,7 @@ import { DateRange } from '@ghostfolio/common/types'; |
|
|
|
import { Type as ActivityType } from '@prisma/client'; |
|
|
|
import { Transform, TransformFnParams } from 'class-transformer'; |
|
|
|
import { IsEnum, IsOptional, Matches } from 'class-validator'; |
|
|
|
import { isString } from 'lodash'; |
|
|
|
import { isString } from 'lodash-es'; |
|
|
|
|
|
|
|
export class ActivitiesFilterDto extends FilterDto { |
|
|
|
@IsEnum(ActivityType, { each: true }) |
|
|
|
|
|
|
|
@ -60,7 +60,7 @@ import { |
|
|
|
Type as ActivityType |
|
|
|
} from '@prisma/client'; |
|
|
|
import { Big } from 'big.js'; |
|
|
|
import { groupBy, uniqBy } from 'lodash'; |
|
|
|
import { groupBy, uniqBy } from 'lodash-es'; |
|
|
|
import { randomUUID } from 'node:crypto'; |
|
|
|
|
|
|
|
@Injectable() |
|
|
|
|
|
|
|
@ -5,7 +5,7 @@ import type { AssetResponse } from '@ghostfolio/common/interfaces'; |
|
|
|
|
|
|
|
import { Controller, Get, Param, UseInterceptors } from '@nestjs/common'; |
|
|
|
import { DataSource } from '@prisma/client'; |
|
|
|
import { pick } from 'lodash'; |
|
|
|
import { pick } from 'lodash-es'; |
|
|
|
|
|
|
|
@Controller('asset') |
|
|
|
export class AssetController { |
|
|
|
|
|
|
|
@ -29,7 +29,7 @@ import { MarketDataPreset } from '@ghostfolio/common/types'; |
|
|
|
import { Injectable, Logger, NotFoundException } from '@nestjs/common'; |
|
|
|
import { EventEmitter2 } from '@nestjs/event-emitter'; |
|
|
|
import { AssetClass, AssetSubClass, DataSource, Prisma } from '@prisma/client'; |
|
|
|
import { groupBy } from 'lodash'; |
|
|
|
import { groupBy } from 'lodash-es'; |
|
|
|
|
|
|
|
@Injectable() |
|
|
|
export class AssetProfilesService { |
|
|
|
|
|
|
|
@ -14,7 +14,7 @@ import { DateRange } from '@ghostfolio/common/types'; |
|
|
|
|
|
|
|
import { Injectable, Logger } from '@nestjs/common'; |
|
|
|
import { format, isSameDay } from 'date-fns'; |
|
|
|
import { isNumber } from 'lodash'; |
|
|
|
import { isNumber } from 'lodash-es'; |
|
|
|
|
|
|
|
@Injectable() |
|
|
|
export class BenchmarksService { |
|
|
|
|
|
|
|
@ -40,7 +40,7 @@ import { Injectable, Logger } from '@nestjs/common'; |
|
|
|
import { DataSource, SymbolProfile } from '@prisma/client'; |
|
|
|
import { Big } from 'big.js'; |
|
|
|
import { addMilliseconds, isBefore } from 'date-fns'; |
|
|
|
import { isEmpty } from 'lodash'; |
|
|
|
import { isEmpty } from 'lodash-es'; |
|
|
|
|
|
|
|
@Injectable() |
|
|
|
export class GhostfolioService { |
|
|
|
|
|
|
|
@ -11,7 +11,7 @@ import { |
|
|
|
|
|
|
|
import { Injectable } from '@nestjs/common'; |
|
|
|
import { Platform, Prisma, Type as ActivityType } from '@prisma/client'; |
|
|
|
import { groupBy, uniqBy } from 'lodash'; |
|
|
|
import { groupBy, uniqBy } from 'lodash-es'; |
|
|
|
|
|
|
|
@Injectable() |
|
|
|
export class ExportService { |
|
|
|
|
|
|
|
@ -2,7 +2,7 @@ import { ActivitiesFilterDto } from '@ghostfolio/api/app/activities/activities-f |
|
|
|
|
|
|
|
import { Transform, TransformFnParams } from 'class-transformer'; |
|
|
|
import { IsOptional, IsUUID } from 'class-validator'; |
|
|
|
import { isString } from 'lodash'; |
|
|
|
import { isString } from 'lodash-es'; |
|
|
|
|
|
|
|
export class GetExportDto extends ActivitiesFilterDto { |
|
|
|
@IsOptional() |
|
|
|
|
|
|
|
@ -47,7 +47,7 @@ import { Account, DataSource, Prisma } from '@prisma/client'; |
|
|
|
import { Big } from 'big.js'; |
|
|
|
import { isISIN } from 'class-validator'; |
|
|
|
import { isSameSecond, parseISO } from 'date-fns'; |
|
|
|
import { omit, uniqBy } from 'lodash'; |
|
|
|
import { omit, uniqBy } from 'lodash-es'; |
|
|
|
import { randomUUID } from 'node:crypto'; |
|
|
|
|
|
|
|
import { ImportValidationError } from './errors/import-validation.error'; |
|
|
|
|
|
|
|
@ -26,7 +26,7 @@ import { Injectable } from '@nestjs/common'; |
|
|
|
import { JwtService } from '@nestjs/jwt'; |
|
|
|
import { MarketData } from '@prisma/client'; |
|
|
|
import { subDays } from 'date-fns'; |
|
|
|
import { isNil } from 'lodash'; |
|
|
|
import { isNil } from 'lodash-es'; |
|
|
|
|
|
|
|
@Injectable() |
|
|
|
export class InfoService { |
|
|
|
|
|
|
|
@ -72,7 +72,7 @@ import { |
|
|
|
startOfYear, |
|
|
|
subDays |
|
|
|
} from 'date-fns'; |
|
|
|
import { groupBy, sortBy, uniqBy } from 'lodash'; |
|
|
|
import { groupBy, sortBy, uniqBy } from 'lodash-es'; |
|
|
|
|
|
|
|
export abstract class PortfolioCalculator { |
|
|
|
protected static readonly ENABLE_LOGGING = false; |
|
|
|
|
|
|
|
@ -32,7 +32,7 @@ import { |
|
|
|
isBefore, |
|
|
|
isThisYear |
|
|
|
} from 'date-fns'; |
|
|
|
import { sum } from 'lodash'; |
|
|
|
import { sum } from 'lodash-es'; |
|
|
|
|
|
|
|
export class RoaiPortfolioCalculator extends PortfolioCalculator { |
|
|
|
protected calculateOverallPerformance( |
|
|
|
|
|
|
|
@ -14,7 +14,7 @@ import { |
|
|
|
|
|
|
|
import { Injectable } from '@nestjs/common'; |
|
|
|
import { isBefore, isToday } from 'date-fns'; |
|
|
|
import { isEmpty, uniqBy } from 'lodash'; |
|
|
|
import { isEmpty, uniqBy } from 'lodash-es'; |
|
|
|
|
|
|
|
import { GetValueObject } from './interfaces/get-value-object.interface'; |
|
|
|
import { GetValuesObject } from './interfaces/get-values-object.interface'; |
|
|
|
|
|
|
|
@ -104,7 +104,7 @@ import { |
|
|
|
set, |
|
|
|
startOfDay |
|
|
|
} from 'date-fns'; |
|
|
|
import { groupBy } from 'lodash'; |
|
|
|
import { groupBy } from 'lodash-es'; |
|
|
|
|
|
|
|
import { PortfolioCalculator } from './calculator/portfolio-calculator'; |
|
|
|
import { PortfolioCalculatorFactory } from './calculator/portfolio-calculator.factory'; |
|
|
|
|
|
|
|
@ -25,7 +25,7 @@ import { AuthGuard } from '@nestjs/passport'; |
|
|
|
import { DataSource } from '@prisma/client'; |
|
|
|
import { isValid, parseISO } from 'date-fns'; |
|
|
|
import { StatusCodes, getReasonPhrase } from 'http-status-codes'; |
|
|
|
import { isEmpty } from 'lodash'; |
|
|
|
import { isEmpty } from 'lodash-es'; |
|
|
|
|
|
|
|
import { GetLookupDto } from './get-lookup.dto'; |
|
|
|
import { SymbolService } from './symbol.service'; |
|
|
|
|
|
|
|
@ -53,7 +53,7 @@ import { AuthGuard } from '@nestjs/passport'; |
|
|
|
import { Throttle } from '@nestjs/throttler'; |
|
|
|
import { User as UserModel } from '@prisma/client'; |
|
|
|
import { StatusCodes, getReasonPhrase } from 'http-status-codes'; |
|
|
|
import { merge, size } from 'lodash'; |
|
|
|
import { merge, size } from 'lodash-es'; |
|
|
|
|
|
|
|
import { UserService } from './user.service'; |
|
|
|
|
|
|
|
|
|
|
|
@ -46,7 +46,7 @@ import { EventEmitter2 } from '@nestjs/event-emitter'; |
|
|
|
import { InjectThrottlerStorage, ThrottlerStorage } from '@nestjs/throttler'; |
|
|
|
import { Prisma, Role, User } from '@prisma/client'; |
|
|
|
import { differenceInDays, subDays } from 'date-fns'; |
|
|
|
import { isNil, without } from 'lodash'; |
|
|
|
import { isNil, without } from 'lodash-es'; |
|
|
|
import { createHmac } from 'node:crypto'; |
|
|
|
|
|
|
|
@Injectable() |
|
|
|
|
|
|
|
@ -9,7 +9,7 @@ import { |
|
|
|
IsUUID, |
|
|
|
MaxLength |
|
|
|
} from 'class-validator'; |
|
|
|
import { isString } from 'lodash'; |
|
|
|
import { isString } from 'lodash-es'; |
|
|
|
|
|
|
|
export class FilterDto { |
|
|
|
@IsOptional() |
|
|
|
|
|
|
|
@ -5,7 +5,7 @@ import { |
|
|
|
|
|
|
|
import { Prisma, Type as ActivityType } from '@prisma/client'; |
|
|
|
import { endOfToday, isAfter } from 'date-fns'; |
|
|
|
import { uniqBy } from 'lodash'; |
|
|
|
import { uniqBy } from 'lodash-es'; |
|
|
|
|
|
|
|
export const WHERE_ACTIVITY_NOT_DRAFT: Prisma.OrderWhereInput = { |
|
|
|
tags: { |
|
|
|
|
|
|
|
@ -1,6 +1,6 @@ |
|
|
|
import fastRedact from 'fast-redact'; |
|
|
|
import jsonpath from 'jsonpath'; |
|
|
|
import { cloneDeep, isObject } from 'lodash'; |
|
|
|
import { cloneDeep, isObject } from 'lodash-es'; |
|
|
|
|
|
|
|
export function hasNotDefinedValuesInObject(aObject: Object): boolean { |
|
|
|
for (const key in aObject) { |
|
|
|
|
|
|
|
@ -7,7 +7,7 @@ import { |
|
|
|
} from '@ghostfolio/common/interfaces'; |
|
|
|
|
|
|
|
import { Big } from 'big.js'; |
|
|
|
import { groupBy } from 'lodash'; |
|
|
|
import { groupBy } from 'lodash-es'; |
|
|
|
|
|
|
|
import { EvaluationResult } from './interfaces/evaluation-result.interface'; |
|
|
|
import { RuleInterface } from './interfaces/rule.interface'; |
|
|
|
|
|
|
|
@ -23,7 +23,7 @@ import { Injectable, Logger } from '@nestjs/common'; |
|
|
|
import { SymbolProfile } from '@prisma/client'; |
|
|
|
import { Big } from 'big.js'; |
|
|
|
import { addHours, isPast, subDays } from 'date-fns'; |
|
|
|
import { round, uniqBy } from 'lodash'; |
|
|
|
import { round, uniqBy } from 'lodash-es'; |
|
|
|
import ms from 'ms'; |
|
|
|
|
|
|
|
import { BenchmarkValue } from './interfaces/benchmark-value.interface'; |
|
|
|
|
|
|
|
@ -42,7 +42,7 @@ import { Inject, Injectable, Logger, OnModuleInit } from '@nestjs/common'; |
|
|
|
import { DataSource, MarketData, Prisma, SymbolProfile } from '@prisma/client'; |
|
|
|
import { Big } from 'big.js'; |
|
|
|
import { eachDayOfInterval, format, isValid } from 'date-fns'; |
|
|
|
import { groupBy, isEmpty, isNumber, omit, uniqWith } from 'lodash'; |
|
|
|
import { groupBy, isEmpty, isNumber, omit, uniqWith } from 'lodash-es'; |
|
|
|
import ms from 'ms'; |
|
|
|
|
|
|
|
import { AssetProfileInvalidError } from './errors/asset-profile-invalid.error'; |
|
|
|
|
|
|
|
@ -31,7 +31,7 @@ import { |
|
|
|
SymbolProfile |
|
|
|
} from '@prisma/client'; |
|
|
|
import { addDays, format, isSameDay, isToday } from 'date-fns'; |
|
|
|
import { isNumber } from 'lodash'; |
|
|
|
import { isNumber } from 'lodash-es'; |
|
|
|
|
|
|
|
@Injectable() |
|
|
|
export class EodHistoricalDataService |
|
|
|
|
|
|
|
@ -47,7 +47,7 @@ import { |
|
|
|
isSameDay, |
|
|
|
parseISO |
|
|
|
} from 'date-fns'; |
|
|
|
import { isArray, uniqBy } from 'lodash'; |
|
|
|
import { isArray, uniqBy } from 'lodash-es'; |
|
|
|
|
|
|
|
@Injectable() |
|
|
|
export class FinancialModelingPrepService |
|
|
|
|
|
|
|
@ -24,7 +24,7 @@ import { Injectable, Logger } from '@nestjs/common'; |
|
|
|
import { DataSource, SymbolProfile } from '@prisma/client'; |
|
|
|
import { addDays, format, isSameDay } from 'date-fns'; |
|
|
|
import { ReasonPhrases, StatusCodes } from 'http-status-codes'; |
|
|
|
import { uniqBy } from 'lodash'; |
|
|
|
import { uniqBy } from 'lodash-es'; |
|
|
|
import YahooFinance from 'yahoo-finance2'; |
|
|
|
import type { ChartResultArray } from 'yahoo-finance2/modules/chart'; |
|
|
|
import type { |
|
|
|
|
|
|
|
@ -26,7 +26,7 @@ import { |
|
|
|
isToday, |
|
|
|
subDays |
|
|
|
} from 'date-fns'; |
|
|
|
import { isNumber } from 'lodash'; |
|
|
|
import { isNumber } from 'lodash-es'; |
|
|
|
import ms from 'ms'; |
|
|
|
|
|
|
|
import { ExchangeRatesByCurrency } from './interfaces/exchange-rate-data.interface'; |
|
|
|
|
|
|
|
@ -33,7 +33,7 @@ import { Inject, Injectable, Logger } from '@nestjs/common'; |
|
|
|
import { Prisma } from '@prisma/client'; |
|
|
|
import { Job, JobOptions, Queue } from 'bull'; |
|
|
|
import { format, min, subDays, subMilliseconds, subYears } from 'date-fns'; |
|
|
|
import { isEmpty } from 'lodash'; |
|
|
|
import { isEmpty } from 'lodash-es'; |
|
|
|
import ms, { StringValue } from 'ms'; |
|
|
|
|
|
|
|
@Injectable() |
|
|
|
|
|
|
|
@ -10,7 +10,7 @@ import { |
|
|
|
|
|
|
|
import { Injectable, Logger, OnModuleInit } from '@nestjs/common'; |
|
|
|
import { isWeekend } from 'date-fns'; |
|
|
|
import { round } from 'lodash'; |
|
|
|
import { round } from 'lodash-es'; |
|
|
|
import { TwitterApi, TwitterApiReadWrite } from 'twitter-api-v2'; |
|
|
|
|
|
|
|
@Injectable() |
|
|
|
|
|
|
|
@ -18,6 +18,6 @@ export default { |
|
|
|
} |
|
|
|
] |
|
|
|
}, |
|
|
|
transformIgnorePatterns: ['node_modules/(?!.*.mjs$)'], |
|
|
|
transformIgnorePatterns: ['node_modules/(?!.*.mjs$|lodash-es/)'], |
|
|
|
preset: '../../jest.preset.js' |
|
|
|
}; |
|
|
|
|
|
|
|
@ -55,7 +55,7 @@ import { |
|
|
|
readerOutline, |
|
|
|
swapVerticalOutline |
|
|
|
} from 'ionicons/icons'; |
|
|
|
import { isNumber } from 'lodash'; |
|
|
|
import { isNumber } from 'lodash-es'; |
|
|
|
import { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader'; |
|
|
|
import { filter, forkJoin } from 'rxjs'; |
|
|
|
|
|
|
|
|
|
|
|
@ -49,7 +49,7 @@ import { |
|
|
|
removeCircleOutline, |
|
|
|
timeOutline |
|
|
|
} from 'ionicons/icons'; |
|
|
|
import { get } from 'lodash'; |
|
|
|
import { get } from 'lodash-es'; |
|
|
|
import { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader'; |
|
|
|
|
|
|
|
@Component({ |
|
|
|
|
|
|
|
@ -106,7 +106,7 @@ import { |
|
|
|
serverOutline, |
|
|
|
trashOutline |
|
|
|
} from 'ionicons/icons'; |
|
|
|
import { isBoolean } from 'lodash'; |
|
|
|
import { isBoolean } from 'lodash-es'; |
|
|
|
import ms from 'ms'; |
|
|
|
import { EMPTY } from 'rxjs'; |
|
|
|
import { catchError } from 'rxjs/operators'; |
|
|
|
|
|
|
|
@ -42,7 +42,7 @@ import { RouterModule } from '@angular/router'; |
|
|
|
import { IonIcon } from '@ionic/angular/standalone'; |
|
|
|
import { addIcons } from 'ionicons'; |
|
|
|
import { ellipsisHorizontal, trashOutline } from 'ionicons/icons'; |
|
|
|
import { get } from 'lodash'; |
|
|
|
import { get } from 'lodash-es'; |
|
|
|
import { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader'; |
|
|
|
import { catchError, filter, of } from 'rxjs'; |
|
|
|
|
|
|
|
|
|
|
|
@ -82,7 +82,7 @@ import { |
|
|
|
swapVerticalOutline, |
|
|
|
walletOutline |
|
|
|
} from 'ionicons/icons'; |
|
|
|
import { isNumber, round, uniqBy } from 'lodash'; |
|
|
|
import { isNumber, round, uniqBy } from 'lodash-es'; |
|
|
|
import { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader'; |
|
|
|
import { filter, switchMap } from 'rxjs/operators'; |
|
|
|
|
|
|
|
|
|
|
|
@ -23,7 +23,7 @@ import { IonIcon } from '@ionic/angular/standalone'; |
|
|
|
import { CountUp } from 'countup.js'; |
|
|
|
import { addIcons } from 'ionicons'; |
|
|
|
import { timeOutline } from 'ionicons/icons'; |
|
|
|
import { isNumber } from 'lodash'; |
|
|
|
import { isNumber } from 'lodash-es'; |
|
|
|
import { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader'; |
|
|
|
|
|
|
|
@Component({ |
|
|
|
|
|
|
|
@ -23,7 +23,7 @@ import { |
|
|
|
ellipsisHorizontalCircleOutline, |
|
|
|
informationCircleOutline |
|
|
|
} from 'ionicons/icons'; |
|
|
|
import { isNumber } from 'lodash'; |
|
|
|
import { isNumber } from 'lodash-es'; |
|
|
|
import { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader'; |
|
|
|
|
|
|
|
@Component({ |
|
|
|
|
|
|
|
@ -32,7 +32,7 @@ import { |
|
|
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; |
|
|
|
import { MatCardModule } from '@angular/material/card'; |
|
|
|
import { format, startOfYear } from 'date-fns'; |
|
|
|
import { isObject } from 'lodash'; |
|
|
|
import { isObject } from 'lodash-es'; |
|
|
|
import { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader'; |
|
|
|
import { catchError, map, Observable, of, OperatorFunction } from 'rxjs'; |
|
|
|
|
|
|
|
|
|
|
|
@ -51,7 +51,7 @@ import { MatTableDataSource } from '@angular/material/table'; |
|
|
|
import { IonIcon } from '@ionic/angular/standalone'; |
|
|
|
import { addIcons } from 'ionicons'; |
|
|
|
import { cloudUploadOutline, warningOutline } from 'ionicons/icons'; |
|
|
|
import { isArray, sortBy } from 'lodash'; |
|
|
|
import { isArray, sortBy } from 'lodash-es'; |
|
|
|
import ms from 'ms'; |
|
|
|
|
|
|
|
import { ImportStep } from './enums/import-step'; |
|
|
|
|
|
|
|
@ -53,7 +53,7 @@ import { MatCardModule } from '@angular/material/card'; |
|
|
|
import { MatDialog } from '@angular/material/dialog'; |
|
|
|
import { MatProgressBarModule } from '@angular/material/progress-bar'; |
|
|
|
import { ActivatedRoute, Router } from '@angular/router'; |
|
|
|
import { isNumber } from 'lodash'; |
|
|
|
import { isNumber } from 'lodash-es'; |
|
|
|
import { DeviceDetectorService } from 'ngx-device-detector'; |
|
|
|
import { filter, switchMap, tap } from 'rxjs'; |
|
|
|
|
|
|
|
|
|
|
|
@ -51,7 +51,7 @@ import { RouterModule } from '@angular/router'; |
|
|
|
import { IonIcon } from '@ionic/angular/standalone'; |
|
|
|
import { addIcons } from 'ionicons'; |
|
|
|
import { copyOutline, ellipsisVertical } from 'ionicons/icons'; |
|
|
|
import { isNumber, keyBy, sortBy, union } from 'lodash'; |
|
|
|
import { isNumber, keyBy, sortBy, union } from 'lodash-es'; |
|
|
|
import ms from 'ms'; |
|
|
|
import { DeviceDetectorService } from 'ngx-device-detector'; |
|
|
|
import { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader'; |
|
|
|
|
|
|
|
@ -27,7 +27,7 @@ import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; |
|
|
|
import { FormsModule, ReactiveFormsModule } from '@angular/forms'; |
|
|
|
import { FormControl } from '@angular/forms'; |
|
|
|
import { Big } from 'big.js'; |
|
|
|
import { isFinite, isNumber } from 'lodash'; |
|
|
|
import { isFinite, isNumber } from 'lodash-es'; |
|
|
|
import { DeviceDetectorService } from 'ngx-device-detector'; |
|
|
|
import { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader'; |
|
|
|
|
|
|
|
|
|
|
|
@ -16,7 +16,7 @@ import { DataSource, Type as ActivityType } from '@ghostfolio/prisma/enums'; |
|
|
|
|
|
|
|
import { HttpClient } from '@angular/common/http'; |
|
|
|
import { inject, Service } from '@angular/core'; |
|
|
|
import { isFinite, isNumber, isString } from 'lodash'; |
|
|
|
import { isFinite, isNumber, isString } from 'lodash-es'; |
|
|
|
import { parse as csvToJson } from 'papaparse'; |
|
|
|
import { firstValueFrom } from 'rxjs'; |
|
|
|
import { v4 as uuidv4 } from 'uuid'; |
|
|
|
|
|
|
|
@ -116,7 +116,24 @@ module.exports = [ |
|
|
|
'no-eval': 'error', |
|
|
|
'no-fallthrough': 'error', |
|
|
|
'no-new-wrappers': 'error', |
|
|
|
'no-restricted-imports': ['error', 'rxjs/Rx'], |
|
|
|
'no-restricted-imports': [ |
|
|
|
'error', |
|
|
|
{ |
|
|
|
paths: [ |
|
|
|
'rxjs/Rx', |
|
|
|
{ |
|
|
|
message: 'Import from lodash-es instead.', |
|
|
|
name: 'lodash' |
|
|
|
} |
|
|
|
], |
|
|
|
patterns: [ |
|
|
|
{ |
|
|
|
group: ['lodash/*'], |
|
|
|
message: 'Import from lodash-es instead.' |
|
|
|
} |
|
|
|
] |
|
|
|
} |
|
|
|
], |
|
|
|
'no-undef-init': 'error', |
|
|
|
'no-underscore-dangle': 'off', |
|
|
|
'no-var': 'error', |
|
|
|
|
|
|
|
@ -1,3 +1,6 @@ |
|
|
|
const nxPreset = require('@nx/jest/preset').default; |
|
|
|
|
|
|
|
module.exports = { ...nxPreset }; |
|
|
|
module.exports = { |
|
|
|
...nxPreset, |
|
|
|
transformIgnorePatterns: ['node_modules/(?!lodash-es/)'] |
|
|
|
}; |
|
|
|
|
|
|
|
@ -10,7 +10,7 @@ import { |
|
|
|
subMilliseconds, |
|
|
|
subYears |
|
|
|
} from 'date-fns'; |
|
|
|
import { isFinite, isNumber } from 'lodash'; |
|
|
|
import { isFinite, isNumber } from 'lodash-es'; |
|
|
|
|
|
|
|
import { resetHours } from './helper'; |
|
|
|
import { DateRange } from './types'; |
|
|
|
|
|
|
|
@ -11,7 +11,7 @@ import { |
|
|
|
MaxLength, |
|
|
|
ValidateIf |
|
|
|
} from 'class-validator'; |
|
|
|
import { isString } from 'lodash'; |
|
|
|
import { isString } from 'lodash-es'; |
|
|
|
|
|
|
|
export class CreateAccountDto { |
|
|
|
/** |
|
|
|
|
|
|
|
@ -25,7 +25,7 @@ import { |
|
|
|
Min, |
|
|
|
Validate |
|
|
|
} from 'class-validator'; |
|
|
|
import { isString } from 'lodash'; |
|
|
|
import { isString } from 'lodash-es'; |
|
|
|
|
|
|
|
export class CreateOrderDto { |
|
|
|
@IsOptional() |
|
|
|
|
|
|
|
@ -11,7 +11,7 @@ import { |
|
|
|
MaxLength, |
|
|
|
ValidateIf |
|
|
|
} from 'class-validator'; |
|
|
|
import { isString } from 'lodash'; |
|
|
|
import { isString } from 'lodash-es'; |
|
|
|
|
|
|
|
export class UpdateAccountDto { |
|
|
|
/** |
|
|
|
|
|
|
|
@ -24,7 +24,7 @@ import { |
|
|
|
Min, |
|
|
|
Validate |
|
|
|
} from 'class-validator'; |
|
|
|
import { isString } from 'lodash'; |
|
|
|
import { isString } from 'lodash-es'; |
|
|
|
|
|
|
|
export class UpdateOrderDto { |
|
|
|
@IsOptional() |
|
|
|
|
|
|
|
@ -42,7 +42,7 @@ import { |
|
|
|
uk, |
|
|
|
zhCN |
|
|
|
} from 'date-fns/locale'; |
|
|
|
import { get, isNil, isString } from 'lodash'; |
|
|
|
import { get, isNil, isString } from 'lodash-es'; |
|
|
|
|
|
|
|
import { |
|
|
|
DEFAULT_CURRENCY, |
|
|
|
|
|
|
|
@ -14,7 +14,7 @@ export default { |
|
|
|
} |
|
|
|
] |
|
|
|
}, |
|
|
|
transformIgnorePatterns: ['node_modules/(?!.*.mjs$)'], |
|
|
|
transformIgnorePatterns: ['node_modules/(?!.*.mjs$|lodash-es/)'], |
|
|
|
snapshotSerializers: [ |
|
|
|
'jest-preset-angular/build/serializers/no-ng-attributes', |
|
|
|
'jest-preset-angular/build/serializers/ng-snapshot', |
|
|
|
|
|
|
|
@ -40,7 +40,7 @@ import { |
|
|
|
ellipsisHorizontal, |
|
|
|
trashOutline |
|
|
|
} from 'ionicons/icons'; |
|
|
|
import { get, isNil } from 'lodash'; |
|
|
|
import { get, isNil } from 'lodash-es'; |
|
|
|
|
|
|
|
import { GfValueComponent } from '../value'; |
|
|
|
|
|
|
|
|
|
|
|
@ -29,7 +29,7 @@ import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; |
|
|
|
import { IonIcon } from '@ionic/angular/standalone'; |
|
|
|
import { addIcons } from 'ionicons'; |
|
|
|
import { closeOutline, searchOutline } from 'ionicons/icons'; |
|
|
|
import { groupBy } from 'lodash'; |
|
|
|
import { groupBy } from 'lodash-es'; |
|
|
|
import { BehaviorSubject } from 'rxjs'; |
|
|
|
|
|
|
|
import { translate } from '../i18n'; |
|
|
|
|
|
|
|
@ -39,7 +39,7 @@ import { |
|
|
|
closeOutline, |
|
|
|
searchOutline |
|
|
|
} from 'ionicons/icons'; |
|
|
|
import { isFunction, sample } from 'lodash'; |
|
|
|
import { isFunction, sample } from 'lodash-es'; |
|
|
|
import { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader'; |
|
|
|
import { EMPTY, Observable, merge, of } from 'rxjs'; |
|
|
|
import { |
|
|
|
|
|
|
|
@ -33,7 +33,7 @@ import { ActivatedRoute, Router, RouterModule } from '@angular/router'; |
|
|
|
import { IonIcon } from '@ionic/angular/standalone'; |
|
|
|
import { addIcons } from 'ionicons'; |
|
|
|
import { ellipsisHorizontal, trashOutline } from 'ionicons/icons'; |
|
|
|
import { isNumber, round } from 'lodash'; |
|
|
|
import { isNumber, round } from 'lodash-es'; |
|
|
|
import { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader'; |
|
|
|
|
|
|
|
import { GfEntityLogoComponent } from '../entity-logo/entity-logo.component'; |
|
|
|
|
|
|
|
@ -59,7 +59,7 @@ import { |
|
|
|
} from 'date-fns'; |
|
|
|
import { addIcons } from 'ionicons'; |
|
|
|
import { calendarClearOutline } from 'ionicons/icons'; |
|
|
|
import { isNumber } from 'lodash'; |
|
|
|
import { isNumber } from 'lodash-es'; |
|
|
|
import { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader'; |
|
|
|
import { debounceTime } from 'rxjs'; |
|
|
|
|
|
|
|
|
|
|
|
@ -29,7 +29,7 @@ import { MatInputModule } from '@angular/material/input'; |
|
|
|
import { IonIcon } from '@ionic/angular/standalone'; |
|
|
|
import { addIcons } from 'ionicons'; |
|
|
|
import { calendarClearOutline, refreshOutline } from 'ionicons/icons'; |
|
|
|
import { isNil } from 'lodash'; |
|
|
|
import { isNil } from 'lodash-es'; |
|
|
|
|
|
|
|
import { HistoricalMarketDataEditorDialogParams } from './interfaces/interfaces'; |
|
|
|
|
|
|
|
|
|
|
|
@ -3,7 +3,7 @@ import { translate } from '@ghostfolio/ui/i18n'; |
|
|
|
|
|
|
|
import { inject, Service } from '@angular/core'; |
|
|
|
import { MatDialog } from '@angular/material/dialog'; |
|
|
|
import { isFunction } from 'lodash'; |
|
|
|
import { isFunction } from 'lodash-es'; |
|
|
|
|
|
|
|
import { GfAlertDialogComponent } from './alert-dialog/alert-dialog.component'; |
|
|
|
import { GfConfirmationDialogComponent } from './confirmation-dialog/confirmation-dialog.component'; |
|
|
|
|
|
|
|
@ -31,7 +31,7 @@ import { GF_ENVIRONMENT } from '@ghostfolio/ui/environment'; |
|
|
|
import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http'; |
|
|
|
import { inject, Service } from '@angular/core'; |
|
|
|
import { JobStatus } from 'bull'; |
|
|
|
import { isNumber } from 'lodash'; |
|
|
|
import { isNumber } from 'lodash-es'; |
|
|
|
|
|
|
|
@Service() |
|
|
|
export class AdminService { |
|
|
|
|
|
|
|
@ -82,7 +82,7 @@ import { inject, Service } from '@angular/core'; |
|
|
|
import { SortDirection } from '@angular/material/sort'; |
|
|
|
import { utc } from '@date-fns/utc'; |
|
|
|
import { format, parseISO } from 'date-fns'; |
|
|
|
import { cloneDeep, groupBy, isNumber } from 'lodash'; |
|
|
|
import { cloneDeep, groupBy, isNumber } from 'lodash-es'; |
|
|
|
import { Observable } from 'rxjs'; |
|
|
|
import { map } from 'rxjs/operators'; |
|
|
|
|
|
|
|
|
|
|
|
@ -36,7 +36,7 @@ import { |
|
|
|
} from '@angular/material/form-field'; |
|
|
|
import { MatInput, MatInputModule } from '@angular/material/input'; |
|
|
|
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; |
|
|
|
import { isString } from 'lodash'; |
|
|
|
import { isString } from 'lodash-es'; |
|
|
|
import { tap } from 'rxjs'; |
|
|
|
import { |
|
|
|
debounceTime, |
|
|
|
|
|
|
|
@ -18,7 +18,7 @@ import { |
|
|
|
import { MatButtonModule } from '@angular/material/button'; |
|
|
|
import { MatPaginator, MatPaginatorModule } from '@angular/material/paginator'; |
|
|
|
import { MatTableDataSource, MatTableModule } from '@angular/material/table'; |
|
|
|
import { capitalize } from 'lodash'; |
|
|
|
import { capitalize } from 'lodash-es'; |
|
|
|
import { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader'; |
|
|
|
|
|
|
|
import { GfValueComponent } from '../value/value.component'; |
|
|
|
|
|
|
|
@ -32,7 +32,7 @@ import { Chart, LinearScale, Tooltip } from 'chart.js'; |
|
|
|
import { TreemapController, TreemapElement } from 'chartjs-chart-treemap'; |
|
|
|
import { isUUID } from 'class-validator'; |
|
|
|
import { differenceInDays, max } from 'date-fns'; |
|
|
|
import { orderBy, round } from 'lodash'; |
|
|
|
import { orderBy, round } from 'lodash-es'; |
|
|
|
import { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader'; |
|
|
|
import OpenColor from 'open-color'; |
|
|
|
|
|
|
|
|
|
|
|
@ -21,7 +21,7 @@ import { MatSnackBar } from '@angular/material/snack-bar'; |
|
|
|
import { IonIcon } from '@ionic/angular/standalone'; |
|
|
|
import { addIcons } from 'ionicons'; |
|
|
|
import { checkmarkOutline, copyOutline } from 'ionicons/icons'; |
|
|
|
import { isNumber } from 'lodash'; |
|
|
|
import { isNumber } from 'lodash-es'; |
|
|
|
import ms from 'ms'; |
|
|
|
import { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader'; |
|
|
|
|
|
|
|
|
|
|
|
@ -83,7 +83,7 @@ |
|
|
|
"ionicons": "8.0.13", |
|
|
|
"jsonpath": "1.3.0", |
|
|
|
"katex": "0.16.47", |
|
|
|
"lodash": "4.18.1", |
|
|
|
"lodash-es": "4.18.1", |
|
|
|
"marked": "18.0.12", |
|
|
|
"marked-katex-extension": "5.1.12", |
|
|
|
"ms": "3.0.0-canary.1", |
|
|
|
@ -147,7 +147,7 @@ |
|
|
|
"@types/google-spreadsheet": "3.1.5", |
|
|
|
"@types/jest": "30.0.0", |
|
|
|
"@types/jsonpath": "0.2.4", |
|
|
|
"@types/lodash": "4.17.25", |
|
|
|
"@types/lodash-es": "4.17.12", |
|
|
|
"@types/node": "22.20.1", |
|
|
|
"@types/papaparse": "5.5.2", |
|
|
|
"@types/passport-google-oauth20": "2.0.17", |
|
|
|
@ -15221,6 +15221,16 @@ |
|
|
|
"devOptional": true, |
|
|
|
"license": "MIT" |
|
|
|
}, |
|
|
|
"node_modules/@types/lodash-es": { |
|
|
|
"version": "4.17.12", |
|
|
|
"resolved": "https://registry.npmjs.org/@types/lodash-es/-/lodash-es-4.17.12.tgz", |
|
|
|
"integrity": "sha512-0NgftHUcV4v34VhXm8QBSftKVXtbkBG3ViCjs6+eJ5a6y6Mi/jiFGPc1sC7QK+9BFhWrURE3EOggmWaSxL9OzQ==", |
|
|
|
"dev": true, |
|
|
|
"license": "MIT", |
|
|
|
"dependencies": { |
|
|
|
"@types/lodash": "*" |
|
|
|
} |
|
|
|
}, |
|
|
|
"node_modules/@types/luxon": { |
|
|
|
"version": "3.7.1", |
|
|
|
"resolved": "https://registry.npmjs.org/@types/luxon/-/luxon-3.7.1.tgz", |
|
|
|
@ -27042,7 +27052,6 @@ |
|
|
|
"version": "4.18.1", |
|
|
|
"resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.18.1.tgz", |
|
|
|
"integrity": "sha512-J8xewKD/Gk22OZbhpOVSwcs60zhd95ESDwezOFuA3/099925PdHJ7OFHNTGtajL3AlZkykD32HykiMo+BIBI8A==", |
|
|
|
"dev": true, |
|
|
|
"license": "MIT" |
|
|
|
}, |
|
|
|
"node_modules/lodash.debounce": { |
|
|
|
|
|
|
|
@ -127,7 +127,7 @@ |
|
|
|
"ionicons": "8.0.13", |
|
|
|
"jsonpath": "1.3.0", |
|
|
|
"katex": "0.16.47", |
|
|
|
"lodash": "4.18.1", |
|
|
|
"lodash-es": "4.18.1", |
|
|
|
"marked": "18.0.12", |
|
|
|
"marked-katex-extension": "5.1.12", |
|
|
|
"ms": "3.0.0-canary.1", |
|
|
|
@ -191,7 +191,7 @@ |
|
|
|
"@types/google-spreadsheet": "3.1.5", |
|
|
|
"@types/jest": "30.0.0", |
|
|
|
"@types/jsonpath": "0.2.4", |
|
|
|
"@types/lodash": "4.17.25", |
|
|
|
"@types/lodash-es": "4.17.12", |
|
|
|
"@types/node": "22.20.1", |
|
|
|
"@types/papaparse": "5.5.2", |
|
|
|
"@types/passport-google-oauth20": "2.0.17", |
|
|
|
|