@cranberry-money/shared-utils 8.17.8 → 8.17.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/allocations.d.ts +0 -1
- package/dist/auth.d.ts +0 -1
- package/dist/badge-status.d.ts +0 -1
- package/dist/badge.d.ts +0 -1
- package/dist/cash-account.d.ts +0 -1
- package/dist/collections.d.ts +0 -1
- package/dist/country.d.ts +0 -1
- package/dist/currency.d.ts +4 -5
- package/dist/dashboard.d.ts +0 -1
- package/dist/date.d.ts +0 -1
- package/dist/document.d.ts +0 -1
- package/dist/downloads.d.ts +0 -1
- package/dist/filters.d.ts +0 -1
- package/dist/formatting.d.ts +0 -1
- package/dist/holdings.d.ts +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/industry.d.ts +0 -1
- package/dist/instruments.d.ts +0 -1
- package/dist/investment-preference.d.ts +0 -1
- package/dist/numbers.d.ts +0 -1
- package/dist/portfolio-template.d.ts +0 -1
- package/dist/portfolio-validation.d.ts +0 -1
- package/dist/portfolio.d.ts +0 -1
- package/dist/sector.d.ts +0 -1
- package/dist/stock-exchange.d.ts +0 -1
- package/dist/tax-residency.d.ts +0 -1
- package/dist/text.d.ts +0 -1
- package/dist/validation.d.ts +4 -5
- package/dist/withdrawal-status.d.ts +0 -1
- package/dist/withdrawal.d.ts +0 -1
- package/package.json +1 -1
package/dist/allocations.d.ts
CHANGED
|
@@ -15,4 +15,3 @@ import type { AssetAllocation } from '@cranberry-money/shared-types';
|
|
|
15
15
|
* validateAllocations(allocations); // returns true
|
|
16
16
|
*/
|
|
17
17
|
export declare const validateAllocations: (allocations: readonly AssetAllocation[]) => boolean;
|
|
18
|
-
//# sourceMappingURL=allocations.d.ts.map
|
package/dist/auth.d.ts
CHANGED
|
@@ -52,4 +52,3 @@ export declare function getRefreshErrorMessage(error: TokenRefreshError): string
|
|
|
52
52
|
* @returns Auto refresh handler with start/stop methods
|
|
53
53
|
*/
|
|
54
54
|
export declare function createAutoRefreshHandler(refreshCallback: () => Promise<void>, checkInterval?: number): AutoRefreshHandler;
|
|
55
|
-
//# sourceMappingURL=auth.d.ts.map
|
package/dist/badge-status.d.ts
CHANGED
package/dist/badge.d.ts
CHANGED
package/dist/cash-account.d.ts
CHANGED
|
@@ -40,4 +40,3 @@ export declare const formatTransactionAmount: (amount: string | number) => strin
|
|
|
40
40
|
* getTransactionTypeLabel('WITHDRAWAL'); // returns transaction type label from constants
|
|
41
41
|
*/
|
|
42
42
|
export declare const getTransactionTypeLabel: <T extends string>(transactionType: T, labels?: Record<T, string>) => string;
|
|
43
|
-
//# sourceMappingURL=cash-account.d.ts.map
|
package/dist/collections.d.ts
CHANGED
|
@@ -78,4 +78,3 @@ export declare function hasItemWithFieldValue<T>(items: T[], fieldName: keyof T,
|
|
|
78
78
|
* @returns Number of matching items
|
|
79
79
|
*/
|
|
80
80
|
export declare function countByFieldValue<T>(items: T[], fieldName: keyof T, value: unknown): number;
|
|
81
|
-
//# sourceMappingURL=collections.d.ts.map
|
package/dist/country.d.ts
CHANGED
|
@@ -105,4 +105,3 @@ export declare const formatCountryWithDialCode: <T extends BaseCountry>(country:
|
|
|
105
105
|
* const available = isCountryAvailable(country);
|
|
106
106
|
*/
|
|
107
107
|
export declare const isCountryAvailable: <T extends BaseCountry>(country: T) => boolean;
|
|
108
|
-
//# sourceMappingURL=country.d.ts.map
|
package/dist/currency.d.ts
CHANGED
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
*/
|
|
10
10
|
export declare const NUMBER_FORMAT_OPTIONS_CURRENCY: {
|
|
11
11
|
readonly style: "currency";
|
|
12
|
-
readonly minimumFractionDigits:
|
|
13
|
-
readonly maximumFractionDigits:
|
|
12
|
+
readonly minimumFractionDigits: any;
|
|
13
|
+
readonly maximumFractionDigits: any;
|
|
14
14
|
};
|
|
15
15
|
/**
|
|
16
16
|
* Number formatting options for currency with explicit sign display
|
|
@@ -18,8 +18,8 @@ export declare const NUMBER_FORMAT_OPTIONS_CURRENCY: {
|
|
|
18
18
|
export declare const NUMBER_FORMAT_OPTIONS_CURRENCY_SIGNED: {
|
|
19
19
|
readonly signDisplay: "always";
|
|
20
20
|
readonly style: "currency";
|
|
21
|
-
readonly minimumFractionDigits:
|
|
22
|
-
readonly maximumFractionDigits:
|
|
21
|
+
readonly minimumFractionDigits: any;
|
|
22
|
+
readonly maximumFractionDigits: any;
|
|
23
23
|
};
|
|
24
24
|
/**
|
|
25
25
|
* Formats a number as currency with commas and 2 decimal places
|
|
@@ -96,4 +96,3 @@ export declare function formatDefaultCurrency(value: number, minimumFractionDigi
|
|
|
96
96
|
* ```
|
|
97
97
|
*/
|
|
98
98
|
export declare function formatShares(shares: number, locale?: string): string;
|
|
99
|
-
//# sourceMappingURL=currency.d.ts.map
|
package/dist/dashboard.d.ts
CHANGED
package/dist/date.d.ts
CHANGED
package/dist/document.d.ts
CHANGED
package/dist/downloads.d.ts
CHANGED
|
@@ -43,4 +43,3 @@ export declare function downloadDataUrl(dataUrl: string, filename: string): void
|
|
|
43
43
|
* @param headers - Optional custom headers (uses object keys if not provided)
|
|
44
44
|
*/
|
|
45
45
|
export declare function downloadCsvFile<T extends Record<string, unknown>>(data: T[], filename: string, headers?: string[]): void;
|
|
46
|
-
//# sourceMappingURL=downloads.d.ts.map
|
package/dist/filters.d.ts
CHANGED
|
@@ -118,4 +118,3 @@ export declare function hasActiveTargetTradeFilters<T extends Record<string, unk
|
|
|
118
118
|
* @returns number of active non-search filters
|
|
119
119
|
*/
|
|
120
120
|
export declare function countActiveTargetTradeFilters<T extends Record<string, unknown>>(filters: T): number;
|
|
121
|
-
//# sourceMappingURL=filters.d.ts.map
|
package/dist/formatting.d.ts
CHANGED
package/dist/holdings.d.ts
CHANGED
|
@@ -76,4 +76,3 @@ export declare const filterHoldingsByMinQuantity: (holdings: readonly AssetHoldi
|
|
|
76
76
|
* sortHoldings(holdings, 'symbol', 'asc'); // Sort by symbol ascending
|
|
77
77
|
*/
|
|
78
78
|
export declare const sortHoldings: (holdings: readonly AssetHolding[], sortBy: "quantity" | "symbol" | "name" | "createdAt", direction?: SortDirection) => AssetHolding[];
|
|
79
|
-
//# sourceMappingURL=holdings.d.ts.map
|
package/dist/index.d.ts
CHANGED
|
@@ -33,4 +33,3 @@ export { sortCountriesByName, filterCountriesByName, filterAvailableCountries, f
|
|
|
33
33
|
export { calculateTotalAllocation, validateAllocationPercentages, formatRiskLevelDisplay, type BaseAllocation, } from './portfolio-template';
|
|
34
34
|
export { validateInvestmentAmount, formatInvestmentAmount } from './investment-preference';
|
|
35
35
|
export { formatBalance, formatTransactionAmount, getTransactionTypeLabel, type BaseTransactionType, } from './cash-account';
|
|
36
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/industry.d.ts
CHANGED
|
@@ -125,4 +125,3 @@ export declare const countIndustriesBySector: <T extends BaseIndustry>(industrie
|
|
|
125
125
|
* const belongsToSector = isIndustryInSector(industry, 'sector-123');
|
|
126
126
|
*/
|
|
127
127
|
export declare const isIndustryInSector: <T extends BaseIndustry>(industry: T, sectorUuid: string) => boolean;
|
|
128
|
-
//# sourceMappingURL=industry.d.ts.map
|
package/dist/instruments.d.ts
CHANGED
|
@@ -22,4 +22,3 @@ export declare const validateInvestmentAmount: (amount: number) => boolean;
|
|
|
22
22
|
* formatInvestmentAmount('1500.50'); // returns '$1,500.50 USD'
|
|
23
23
|
*/
|
|
24
24
|
export declare const formatInvestmentAmount: (amount: string) => string;
|
|
25
|
-
//# sourceMappingURL=investment-preference.d.ts.map
|
package/dist/numbers.d.ts
CHANGED
|
@@ -54,4 +54,3 @@ export declare const validateAllocationPercentages: <T extends BaseAllocation>(a
|
|
|
54
54
|
* formatRiskLevelDisplay('moderate'); // returns 'Moderate'
|
|
55
55
|
*/
|
|
56
56
|
export declare const formatRiskLevelDisplay: (riskLevel: string) => string;
|
|
57
|
-
//# sourceMappingURL=portfolio-template.d.ts.map
|
package/dist/portfolio.d.ts
CHANGED
package/dist/sector.d.ts
CHANGED
|
@@ -121,4 +121,3 @@ export declare const sectorExists: <T extends BaseSector>(sectors: readonly T[],
|
|
|
121
121
|
* // returns [Technology, Biotechnology, Healthcare Technology]
|
|
122
122
|
*/
|
|
123
123
|
export declare const findSectorsByPartialName: <T extends BaseSector>(sectors: readonly T[], partialName: string) => T[];
|
|
124
|
-
//# sourceMappingURL=sector.d.ts.map
|
package/dist/stock-exchange.d.ts
CHANGED
|
@@ -86,4 +86,3 @@ export declare const sortExchangesByName: <T extends BaseStockExchange>(exchange
|
|
|
86
86
|
* filterExchangesByCountry(exchanges, 'US'); // returns [NYSE exchange]
|
|
87
87
|
*/
|
|
88
88
|
export declare const filterExchangesByCountry: <T extends BaseStockExchange>(exchanges: readonly T[], countryCode: string) => T[];
|
|
89
|
-
//# sourceMappingURL=stock-exchange.d.ts.map
|
package/dist/tax-residency.d.ts
CHANGED
|
@@ -64,4 +64,3 @@ export declare const hasTaxResidencyInCountry: <T extends BaseTaxResidency>(taxR
|
|
|
64
64
|
* getNonExemptedTaxResidencies(residencies); // returns US and UK residencies
|
|
65
65
|
*/
|
|
66
66
|
export declare const getNonExemptedTaxResidencies: <T extends BaseTaxResidency>(taxResidencies: readonly T[]) => T[];
|
|
67
|
-
//# sourceMappingURL=tax-residency.d.ts.map
|
package/dist/text.d.ts
CHANGED
package/dist/validation.d.ts
CHANGED
|
@@ -143,7 +143,7 @@ export declare function isNonNegativeNumber(value: number): boolean;
|
|
|
143
143
|
* @param minParts - Minimum number of name parts required (default: 2)
|
|
144
144
|
* @returns true if appears to contain required name parts, false otherwise
|
|
145
145
|
*/
|
|
146
|
-
export declare function isValidFullName(fullName: string, minParts?:
|
|
146
|
+
export declare function isValidFullName(fullName: string, minParts?: any): boolean;
|
|
147
147
|
/**
|
|
148
148
|
* Validates if a date is a valid date of birth (not in future, reasonable age range)
|
|
149
149
|
* @param dateOfBirth - The date string in YYYY-MM-DD format
|
|
@@ -151,7 +151,7 @@ export declare function isValidFullName(fullName: string, minParts?: 2): boolean
|
|
|
151
151
|
* @param maxAge - Maximum reasonable age (default: 120)
|
|
152
152
|
* @returns true if valid date of birth, false otherwise
|
|
153
153
|
*/
|
|
154
|
-
export declare function isValidDateOfBirth(dateOfBirth: string, minAge?:
|
|
154
|
+
export declare function isValidDateOfBirth(dateOfBirth: string, minAge?: any, maxAge?: any): boolean;
|
|
155
155
|
/**
|
|
156
156
|
* Formats a phone number by removing extra spaces and standardizing format
|
|
157
157
|
* @param phoneNumber - The phone number to format
|
|
@@ -165,7 +165,7 @@ export declare function formatPhoneNumber(phoneNumber: string): string;
|
|
|
165
165
|
* @param maxAmount - Maximum investment amount (default: 10000000)
|
|
166
166
|
* @returns true if amount is within range, false otherwise
|
|
167
167
|
*/
|
|
168
|
-
export declare function isValidInvestmentAmount(amount: number, minAmount?:
|
|
168
|
+
export declare function isValidInvestmentAmount(amount: number, minAmount?: any, maxAmount?: any): boolean;
|
|
169
169
|
/**
|
|
170
170
|
* Validates if at least one source of funds is selected
|
|
171
171
|
* @param sources - Array of selected source of funds
|
|
@@ -177,7 +177,7 @@ export declare function isValidInvestmentAmount(amount: number, minAmount?: 100,
|
|
|
177
177
|
* isValidSourceOfFunds([]); // returns false
|
|
178
178
|
* isValidSourceOfFunds(['salary', 'savings']); // returns true
|
|
179
179
|
*/
|
|
180
|
-
export declare function isValidSourceOfFunds(sources: string[], minSources?:
|
|
180
|
+
export declare function isValidSourceOfFunds(sources: string[], minSources?: any): boolean;
|
|
181
181
|
/**
|
|
182
182
|
* Validates if at least minimum number of items are selected
|
|
183
183
|
* @param items - Array of selected items
|
|
@@ -235,4 +235,3 @@ export declare function isInNumberRange(value: number, min: number, max: number)
|
|
|
235
235
|
* isValidPercentage(-10) // false
|
|
236
236
|
*/
|
|
237
237
|
export declare function isValidPercentage(percentage: number): boolean;
|
|
238
|
-
//# sourceMappingURL=validation.d.ts.map
|
|
@@ -69,4 +69,3 @@ export declare const getLiquidationStatusColor: (status: LiquidationStatus) => s
|
|
|
69
69
|
* getLiquidationStatusLabel('executed'); // returns 'Executed'
|
|
70
70
|
*/
|
|
71
71
|
export declare const getLiquidationStatusLabel: (status: LiquidationStatus) => string;
|
|
72
|
-
//# sourceMappingURL=withdrawal-status.d.ts.map
|
package/dist/withdrawal.d.ts
CHANGED