mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-15 23:47:33 +08:00
use for-of statements to replace for and for-in
This commit is contained in:
@@ -6,6 +6,7 @@ import { useTransactionsStore } from '@/stores/transaction.ts';
|
||||
import { useStatisticsStore } from '@/stores/statistics.ts';
|
||||
import { useOverviewStore } from '@/stores/overview.ts';
|
||||
|
||||
import { keys, keysIfValueEquals, values } from '@/core/base.ts';
|
||||
import type { Account, AccountCategoriesWithVisibleCount } from '@/models/account.ts';
|
||||
|
||||
import {
|
||||
@@ -65,13 +66,7 @@ export function useAccountFilterSettingPageBase(type?: AccountFilterType) {
|
||||
function loadFilterAccountIds(): boolean {
|
||||
const allAccountIds: Record<string, boolean> = {};
|
||||
|
||||
for (const accountId in accountsStore.allAccountsMap) {
|
||||
if (!Object.prototype.hasOwnProperty.call(accountsStore.allAccountsMap, accountId)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
const account = accountsStore.allAccountsMap[accountId];
|
||||
|
||||
for (const account of values(accountsStore.allAccountsMap)) {
|
||||
if (!allowHiddenAccount.value && account.hidden) {
|
||||
continue;
|
||||
}
|
||||
@@ -93,11 +88,7 @@ export function useAccountFilterSettingPageBase(type?: AccountFilterType) {
|
||||
filterAccountIds.value = Object.assign(allAccountIds, settingsStore.appSettings.overviewAccountFilterInHomePage);
|
||||
return true;
|
||||
} else if (type === 'transactionListCurrent') {
|
||||
for (const accountId in transactionsStore.allFilterAccountIds) {
|
||||
if (!Object.prototype.hasOwnProperty.call(transactionsStore.allFilterAccountIds, accountId)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
for (const accountId of keysIfValueEquals(transactionsStore.allFilterAccountIds, true)) {
|
||||
const account = accountsStore.allAccountsMap[accountId];
|
||||
|
||||
if (account) {
|
||||
@@ -120,11 +111,7 @@ export function useAccountFilterSettingPageBase(type?: AccountFilterType) {
|
||||
let finalAccountIds = '';
|
||||
let changed = true;
|
||||
|
||||
for (const accountId in filterAccountIds.value) {
|
||||
if (!Object.prototype.hasOwnProperty.call(filterAccountIds.value, accountId)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
for (const accountId of keys(filterAccountIds.value)) {
|
||||
const account = accountsStore.allAccountsMap[accountId];
|
||||
|
||||
if (!account) {
|
||||
|
||||
@@ -2,6 +2,7 @@ import { ref, computed } from 'vue';
|
||||
|
||||
import { useSettingsStore } from '@/stores/setting.ts';
|
||||
|
||||
import { keysIfValueEquals } from '@/core/base.ts';
|
||||
import type { ApplicationCloudSetting } from '@/core/setting.ts';
|
||||
|
||||
export interface CategorizedApplicationCloudSettingItems {
|
||||
@@ -101,14 +102,8 @@ export function useAppCloudSyncBase() {
|
||||
const isEnableCloudSync = computed<boolean>(() => settingsStore.enableApplicationCloudSync);
|
||||
|
||||
const hasEnabledApplicationCloudSettings = computed<boolean>(() => {
|
||||
for (const key in enabledApplicationCloudSettings.value) {
|
||||
if (!Object.prototype.hasOwnProperty.call(enabledApplicationCloudSettings.value, key)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (enabledApplicationCloudSettings.value[key]) {
|
||||
return true;
|
||||
}
|
||||
for (const _ of keysIfValueEquals(enabledApplicationCloudSettings.value, true)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
@@ -117,22 +112,15 @@ export function useAppCloudSyncBase() {
|
||||
const enabledApplicationCloudSettingKeys = computed<string[]>(() => {
|
||||
const keys: string[] = [];
|
||||
|
||||
for (const key in enabledApplicationCloudSettings.value) {
|
||||
if (!Object.prototype.hasOwnProperty.call(enabledApplicationCloudSettings.value, key)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (enabledApplicationCloudSettings.value[key]) {
|
||||
keys.push(key);
|
||||
}
|
||||
for (const key of keysIfValueEquals(enabledApplicationCloudSettings.value, true)) {
|
||||
keys.push(key);
|
||||
}
|
||||
|
||||
return keys;
|
||||
});
|
||||
|
||||
function isAllSettingsSelected(categorizedItems: CategorizedApplicationCloudSettingItems): boolean {
|
||||
for (let i = 0; i < categorizedItems.items.length; i++) {
|
||||
const item = categorizedItems.items[i];
|
||||
for (const item of categorizedItems.items) {
|
||||
if (!enabledApplicationCloudSettings.value[item.settingKey]) {
|
||||
return false;
|
||||
}
|
||||
@@ -144,8 +132,7 @@ export function useAppCloudSyncBase() {
|
||||
function hasSettingSelectedButNotAllChecked(categorizedItems: CategorizedApplicationCloudSettingItems): boolean {
|
||||
let checkedCount = 0;
|
||||
|
||||
for (let i = 0; i < categorizedItems.items.length; i++) {
|
||||
const item = categorizedItems.items[i];
|
||||
for (const item of categorizedItems.items) {
|
||||
if (!enabledApplicationCloudSettings.value[item.settingKey]) {
|
||||
checkedCount++;
|
||||
}
|
||||
@@ -155,40 +142,30 @@ export function useAppCloudSyncBase() {
|
||||
}
|
||||
|
||||
function updateSettingsSelected(categorizedItems: CategorizedApplicationCloudSettingItems, value: boolean): void {
|
||||
for (let i = 0; i < categorizedItems.items.length; i++) {
|
||||
const item = categorizedItems.items[i];
|
||||
for (const item of categorizedItems.items) {
|
||||
enabledApplicationCloudSettings.value[item.settingKey] = value;
|
||||
}
|
||||
}
|
||||
|
||||
function selectAllSettings(): void {
|
||||
for (let i = 0; i < ALL_APPLICATION_CLOUD_SETTINGS.length; i++) {
|
||||
const categorizedItems = ALL_APPLICATION_CLOUD_SETTINGS[i];
|
||||
|
||||
for (let j = 0; j < categorizedItems.items.length; j++) {
|
||||
const item = categorizedItems.items[j];
|
||||
for (const categorizedItems of ALL_APPLICATION_CLOUD_SETTINGS) {
|
||||
for (const item of categorizedItems.items) {
|
||||
enabledApplicationCloudSettings.value[item.settingKey] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function selectNoneSettings(): void {
|
||||
for (let i = 0; i < ALL_APPLICATION_CLOUD_SETTINGS.length; i++) {
|
||||
const categorizedItems = ALL_APPLICATION_CLOUD_SETTINGS[i];
|
||||
|
||||
for (let j = 0; j < categorizedItems.items.length; j++) {
|
||||
const item = categorizedItems.items[j];
|
||||
for (const categorizedItems of ALL_APPLICATION_CLOUD_SETTINGS) {
|
||||
for (const item of categorizedItems.items) {
|
||||
enabledApplicationCloudSettings.value[item.settingKey] = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function selectInvertSettings(): void {
|
||||
for (let i = 0; i < ALL_APPLICATION_CLOUD_SETTINGS.length; i++) {
|
||||
const categorizedItems = ALL_APPLICATION_CLOUD_SETTINGS[i];
|
||||
|
||||
for (let j = 0; j < categorizedItems.items.length; j++) {
|
||||
const item = categorizedItems.items[j];
|
||||
for (const categorizedItems of ALL_APPLICATION_CLOUD_SETTINGS) {
|
||||
for (const item of categorizedItems.items) {
|
||||
enabledApplicationCloudSettings.value[item.settingKey] = !enabledApplicationCloudSettings.value[item.settingKey];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ import { useTransactionCategoriesStore } from '@/stores/transactionCategory.ts';
|
||||
import { useOverviewStore } from '@/stores/overview.ts';
|
||||
import { useStatisticsStore } from '@/stores/statistics.ts';
|
||||
|
||||
import type { NameValue, TypeAndDisplayName } from '@/core/base.ts';
|
||||
import { type NameValue, type TypeAndDisplayName, keysIfValueEquals, values } from '@/core/base.ts';
|
||||
import type { LocalizedTimezoneInfo } from '@/core/timezone.ts';
|
||||
import { CategoryType } from '@/core/category.ts';
|
||||
import type { Account } from '@/models/account.ts';
|
||||
@@ -145,12 +145,8 @@ export function useAppSettingPageBase() {
|
||||
|
||||
let hasExcludeAccount = false;
|
||||
|
||||
for (const accountId in excludeAccountIds) {
|
||||
if (!Object.prototype.hasOwnProperty.call(excludeAccountIds, accountId)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (excludeAccountIds[accountId] && accountsStore.allAccountsMap[accountId]) {
|
||||
for (const accountId of keysIfValueEquals(excludeAccountIds, true)) {
|
||||
if (accountsStore.allAccountsMap[accountId]) {
|
||||
hasExcludeAccount = true;
|
||||
break;
|
||||
}
|
||||
@@ -162,9 +158,7 @@ export function useAppSettingPageBase() {
|
||||
|
||||
let allAccountExcluded = true;
|
||||
|
||||
for (let i = 0; i < allAccounts.length; i++) {
|
||||
const account = allAccounts[i];
|
||||
|
||||
for (const account of allAccounts) {
|
||||
if (!excludeAccountIds[account.id]) {
|
||||
allAccountExcluded = false;
|
||||
break;
|
||||
@@ -185,12 +179,8 @@ export function useAppSettingPageBase() {
|
||||
|
||||
let hasExcludeTransactionCategory = false;
|
||||
|
||||
for (const transactionCategoryId in excludeTransactionCategoryIds) {
|
||||
if (!Object.prototype.hasOwnProperty.call(excludeTransactionCategoryIds, transactionCategoryId)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (excludeTransactionCategoryIds[transactionCategoryId] && transactionCategoriesStore.allTransactionCategoriesMap[transactionCategoryId]) {
|
||||
for (const transactionCategoryId of keysIfValueEquals(excludeTransactionCategoryIds, true)) {
|
||||
if (transactionCategoriesStore.allTransactionCategoriesMap[transactionCategoryId]) {
|
||||
hasExcludeTransactionCategory = true;
|
||||
break;
|
||||
}
|
||||
@@ -202,13 +192,7 @@ export function useAppSettingPageBase() {
|
||||
|
||||
let allTransactionCategoryExcluded = true;
|
||||
|
||||
for (const transactionCategoryId in transactionCategoriesStore.allTransactionCategoriesMap) {
|
||||
if (!Object.prototype.hasOwnProperty.call(transactionCategoriesStore.allTransactionCategoriesMap, transactionCategoryId)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
const transactionCategory = transactionCategoriesStore.allTransactionCategoriesMap[transactionCategoryId];
|
||||
|
||||
for (const transactionCategory of values(transactionCategoriesStore.allTransactionCategoriesMap)) {
|
||||
if (transactionCategory.type !== CategoryType.Income && transactionCategory.type !== CategoryType.Expense) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import { useTransactionTagsStore } from '@/stores/transactionTag.ts';
|
||||
import { useTransactionsStore } from '@/stores/transaction.ts';
|
||||
import { useStatisticsStore } from '@/stores/statistics.ts';
|
||||
|
||||
import type { TypeAndDisplayName } from '@/core/base.ts';
|
||||
import { type TypeAndDisplayName, keys, keysIfValueEquals, values } from '@/core/base.ts';
|
||||
import { TransactionTagFilterType } from '@/core/transaction.ts';
|
||||
import type { TransactionTag } from '@/models/transaction_tag.ts';
|
||||
|
||||
@@ -44,20 +44,14 @@ export function useTransactionTagFilterSettingPageBase(type?: string) {
|
||||
function loadFilterTagIds(): boolean {
|
||||
const allTransactionTagIds: Record<string, boolean> = {};
|
||||
|
||||
for (const transactionTagId in transactionTagsStore.allTransactionTagsMap) {
|
||||
if (!Object.prototype.hasOwnProperty.call(transactionTagsStore.allTransactionTagsMap, transactionTagId)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
const transactionTag = transactionTagsStore.allTransactionTagsMap[transactionTagId];
|
||||
for (const transactionTag of values(transactionTagsStore.allTransactionTagsMap)) {
|
||||
allTransactionTagIds[transactionTag.id] = true;
|
||||
}
|
||||
|
||||
if (type === 'statisticsCurrent') {
|
||||
const transactionTagIds = statisticsStore.transactionStatisticsFilter.tagIds ? statisticsStore.transactionStatisticsFilter.tagIds.split(',') : [];
|
||||
|
||||
for (let i = 0; i < transactionTagIds.length; i++) {
|
||||
const transactionTagId = transactionTagIds[i];
|
||||
for (const transactionTagId of transactionTagIds) {
|
||||
const transactionTag = transactionTagsStore.allTransactionTagsMap[transactionTagId];
|
||||
|
||||
if (transactionTag) {
|
||||
@@ -68,11 +62,7 @@ export function useTransactionTagFilterSettingPageBase(type?: string) {
|
||||
tagFilterType.value = statisticsStore.transactionStatisticsFilter.tagFilterType;
|
||||
return true;
|
||||
} else if (type === 'transactionListCurrent') {
|
||||
for (const transactionTagId in transactionsStore.allFilterTagIds) {
|
||||
if (!Object.prototype.hasOwnProperty.call(transactionsStore.allFilterTagIds, transactionTagId)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
for (const transactionTagId of keysIfValueEquals(transactionsStore.allFilterTagIds, true)) {
|
||||
const transactionTag = transactionTagsStore.allTransactionTagsMap[transactionTagId];
|
||||
|
||||
if (transactionTag) {
|
||||
@@ -91,11 +81,7 @@ export function useTransactionTagFilterSettingPageBase(type?: string) {
|
||||
let finalTagIds = '';
|
||||
let changed = true;
|
||||
|
||||
for (const transactionTagId in filterTagIds.value) {
|
||||
if (!Object.prototype.hasOwnProperty.call(filterTagIds.value, transactionTagId)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
for (const transactionTagId of keys(filterTagIds.value)) {
|
||||
const transactionTag = transactionTagsStore.allTransactionTagsMap[transactionTagId];
|
||||
|
||||
if (!transactionTag) {
|
||||
|
||||
@@ -9,7 +9,7 @@ import { useTransactionCategoriesStore } from '@/stores/transactionCategory.ts';
|
||||
import { useTransactionTagsStore } from '@/stores/transactionTag.ts';
|
||||
import { type TransactionListFilter, type TransactionMonthList, useTransactionsStore } from '@/stores/transaction.ts';
|
||||
|
||||
import type { TypeAndName } from '@/core/base.ts';
|
||||
import { type TypeAndName, entries } from '@/core/base.ts';
|
||||
import type { NumeralSystem } from '@/core/numeral.ts';
|
||||
import { type TextualYearMonthDay, type Year0BasedMonth, type LocalizedDateRange, type WeekDayValue, DateRange, DateRangeScene } from '@/core/datetime.ts';
|
||||
import { AccountType } from '@/core/account.ts';
|
||||
@@ -113,16 +113,12 @@ export function useTransactionListPageBase() {
|
||||
const allPrimaryCategories = computed<Record<string, TransactionCategory[]>>(() => {
|
||||
const primaryCategories: Record<string, TransactionCategory[]> = {};
|
||||
|
||||
for (const categoryType in transactionCategoriesStore.allTransactionCategories) {
|
||||
if (!Object.prototype.hasOwnProperty.call(transactionCategoriesStore.allTransactionCategories, categoryType)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
for (const [categoryType, categories] of entries(transactionCategoriesStore.allTransactionCategories)) {
|
||||
if (query.value.type && categoryTypeToTransactionType(parseInt(categoryType)) !== query.value.type) {
|
||||
continue;
|
||||
}
|
||||
|
||||
primaryCategories[categoryType] = transactionCategoriesStore.allTransactionCategories[categoryType];
|
||||
primaryCategories[categoryType] = categories;
|
||||
}
|
||||
|
||||
return primaryCategories;
|
||||
@@ -131,17 +127,13 @@ export function useTransactionListPageBase() {
|
||||
const allAvailableCategoriesCount = computed<number>(() => {
|
||||
let totalCount = 0;
|
||||
|
||||
for (const categoryType in transactionCategoriesStore.allTransactionCategories) {
|
||||
if (!Object.prototype.hasOwnProperty.call(transactionCategoriesStore.allTransactionCategories, categoryType)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
for (const [categoryType, categories] of entries(transactionCategoriesStore.allTransactionCategories)) {
|
||||
if (query.value.type && categoryTypeToTransactionType(parseInt(categoryType)) !== query.value.type) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (transactionCategoriesStore.allTransactionCategories[categoryType]) {
|
||||
totalCount += transactionCategoriesStore.allTransactionCategories[categoryType].length;
|
||||
if (categories) {
|
||||
totalCount += categories.length;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -229,7 +221,7 @@ export function useTransactionListPageBase() {
|
||||
const displayAmount: string[] = [];
|
||||
|
||||
for (let i = 1; i < amountFilterItems.length; i++) {
|
||||
displayAmount.push(formatAmountToLocalizedNumeralsWithCurrency(parseInt(amountFilterItems[i]), false));
|
||||
displayAmount.push(formatAmountToLocalizedNumeralsWithCurrency(parseInt(amountFilterItems[i] as string), false));
|
||||
}
|
||||
|
||||
return displayAmount.join(' ~ ');
|
||||
@@ -249,9 +241,9 @@ export function useTransactionListPageBase() {
|
||||
const currentYear = currentMonthMinDate.getGregorianCalendarYear();
|
||||
const currentMonth = currentMonthMinDate.getGregorianCalendarMonth();
|
||||
|
||||
for (let i = 0; i < allTransactions.length; i++) {
|
||||
if (allTransactions[i].year === currentYear && allTransactions[i].month === currentMonth) {
|
||||
return allTransactions[i];
|
||||
for (const transactionMonth of allTransactions) {
|
||||
if (transactionMonth.year === currentYear && transactionMonth.month === currentMonth) {
|
||||
return transactionMonth;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -111,7 +111,7 @@
|
||||
v-if="(showHidden || !account.hidden) && account.type === AccountType.MultiSubAccounts.type && ((showHidden && accountCategory.allSubAccounts[account.id]) || accountCategory.allVisibleSubAccountCounts[account.id])">
|
||||
<template :key="subAccount.id"
|
||||
v-for="(subAccount, subIdx) in accountCategory.allSubAccounts[account.id]">
|
||||
<v-divider v-if="showHidden ? subIdx > 0 : (!subAccount.hidden ? subIdx > accountCategory.allFirstVisibleSubAccountIndexes[account.id] : false)"/>
|
||||
<v-divider v-if="showHidden ? subIdx > 0 : (!subAccount.hidden ? subIdx > (accountCategory.allFirstVisibleSubAccountIndexes[account.id] as number) : false)"/>
|
||||
|
||||
<v-list-item v-if="showHidden || !subAccount.hidden">
|
||||
<template #prepend>
|
||||
|
||||
@@ -108,7 +108,7 @@
|
||||
v-if="(showHidden || !category.hidden) && ((showHidden && transactionType.allSubCategories[category.id]) || transactionType.allVisibleSubCategoryCounts[category.id])">
|
||||
<template :key="subCategory.id"
|
||||
v-for="(subCategory, subIdx) in transactionType.allSubCategories[category.id]">
|
||||
<v-divider v-if="showHidden ? subIdx > 0 : (!subCategory.hidden ? subIdx > transactionType.allFirstVisibleSubCategoryIndexes[category.id] : false)"/>
|
||||
<v-divider v-if="showHidden ? subIdx > 0 : (!subCategory.hidden ? subIdx > (transactionType.allFirstVisibleSubCategoryIndexes[category.id] as number) : false)"/>
|
||||
|
||||
<v-list-item v-if="showHidden || !subCategory.hidden">
|
||||
<template #prepend>
|
||||
|
||||
@@ -227,8 +227,7 @@ function reload(force: boolean): void {
|
||||
const exchangeRates = exchangeRatesData.value.exchangeRates;
|
||||
let foundDefaultCurrency = false;
|
||||
|
||||
for (let i = 0; i < exchangeRates.length; i++) {
|
||||
const exchangeRate = exchangeRates[i];
|
||||
for (const exchangeRate of exchangeRates) {
|
||||
if (exchangeRate.currency === baseCurrency.value) {
|
||||
foundDefaultCurrency = true;
|
||||
break;
|
||||
|
||||
@@ -696,7 +696,7 @@ function close(completed: boolean): void {
|
||||
|
||||
watch(fileType, () => {
|
||||
if (allFileSubTypes.value && allFileSubTypes.value.length) {
|
||||
fileSubType.value = allFileSubTypes.value[0].type;
|
||||
fileSubType.value = allFileSubTypes.value[0]!.type;
|
||||
}
|
||||
|
||||
importFile.value = null;
|
||||
|
||||
@@ -145,6 +145,7 @@ import { useRootStore } from '@/stores/index.ts';
|
||||
import { useSettingsStore } from '@/stores/setting.ts';
|
||||
import { useTokensStore } from '@/stores/token.ts';
|
||||
|
||||
import { itemAndIndex, reversedItemAndIndex } from '@/core/base.ts';
|
||||
import { type TokenInfoResponse, SessionInfo } from '@/models/token.ts';
|
||||
|
||||
import { isEquals } from '@/lib/common.ts';
|
||||
@@ -203,8 +204,7 @@ const sessions = computed<DesktopPageSessionInfo[]>(() => {
|
||||
return sessions;
|
||||
}
|
||||
|
||||
for (let i = 0; i < tokens.value.length; i++) {
|
||||
const token = tokens.value[i];
|
||||
for (const token of tokens.value) {
|
||||
const sessionInfo = parseSessionInfo(token);
|
||||
sessions.push(new DesktopPageSessionInfo(sessionInfo));
|
||||
}
|
||||
@@ -336,9 +336,9 @@ function revokeSession(session: SessionInfo): void {
|
||||
}).then(() => {
|
||||
loadingSession.value = false;
|
||||
|
||||
for (let i = 0; i < tokens.value.length; i++) {
|
||||
if (tokens.value[i].tokenId === session.tokenId) {
|
||||
tokens.value.splice(i, 1);
|
||||
for (const [token, index] of itemAndIndex(tokens.value)) {
|
||||
if (token.tokenId === session.tokenId) {
|
||||
tokens.value.splice(index, 1);
|
||||
}
|
||||
}
|
||||
}).catch(error => {
|
||||
@@ -362,9 +362,9 @@ function revokeAllSessions(): void {
|
||||
tokensStore.revokeAllTokens().then(() => {
|
||||
loadingSession.value = false;
|
||||
|
||||
for (let i = tokens.value.length - 1; i >= 0; i--) {
|
||||
if (!tokens.value[i].isCurrent) {
|
||||
tokens.value.splice(i, 1);
|
||||
for (const [token, index] of reversedItemAndIndex(tokens.value)) {
|
||||
if (!token.isCurrent) {
|
||||
tokens.value.splice(index, 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -309,8 +309,7 @@ exchangeRatesStore.getLatestExchangeRates({
|
||||
const exchangeRates = exchangeRatesData.value.exchangeRates;
|
||||
let hasBaseCurrency = false;
|
||||
|
||||
for (let i = 0; i < exchangeRates.length; i++) {
|
||||
const exchangeRate = exchangeRates[i];
|
||||
for (const exchangeRate of exchangeRates) {
|
||||
if (exchangeRate.currency === baseCurrency.value) {
|
||||
hasBaseCurrency = true;
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user