@cranberry-money/shared-utils 8.23.411 → 8.23.413
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/formatting.d.ts +0 -130
- package/dist/formatting.d.ts.map +1 -1
- package/dist/formatting.js +4 -203
- package/dist/formatting.js.map +1 -1
- package/dist/index.d.ts +6 -13
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -35
- package/dist/index.js.map +1 -1
- package/dist/validation.d.ts +0 -5
- package/dist/validation.d.ts.map +1 -1
- package/dist/validation.js +3 -62
- package/dist/validation.js.map +1 -1
- package/package.json +3 -3
- package/dist/address.d.ts +0 -7
- package/dist/address.d.ts.map +0 -1
- package/dist/address.js +0 -104
- package/dist/address.js.map +0 -1
- package/dist/badges.d.ts +0 -2
- package/dist/badges.d.ts.map +0 -1
- package/dist/badges.js +0 -2
- package/dist/badges.js.map +0 -1
- package/dist/phoneFormatting.d.ts +0 -21
- package/dist/phoneFormatting.d.ts.map +0 -1
- package/dist/phoneFormatting.js +0 -146
- package/dist/phoneFormatting.js.map +0 -1
- package/dist/portfolio.d.ts +0 -12
- package/dist/portfolio.d.ts.map +0 -1
- package/dist/portfolio.js +0 -37
- package/dist/portfolio.js.map +0 -1
- package/dist/user-preferences.d.ts +0 -28
- package/dist/user-preferences.d.ts.map +0 -1
- package/dist/user-preferences.js +0 -88
- package/dist/user-preferences.js.map +0 -1
- package/dist/user-validation.d.ts +0 -3
- package/dist/user-validation.d.ts.map +0 -1
- package/dist/user-validation.js +0 -60
- package/dist/user-validation.js.map +0 -1
- package/dist/user-verification.d.ts +0 -40
- package/dist/user-verification.d.ts.map +0 -1
- package/dist/user-verification.js +0 -60
- package/dist/user-verification.js.map +0 -1
package/dist/formatting.d.ts
CHANGED
|
@@ -1,142 +1,12 @@
|
|
|
1
|
-
export declare const NUMBER_FORMAT_OPTIONS_CURRENCY: {
|
|
2
|
-
readonly style: "currency";
|
|
3
|
-
readonly minimumFractionDigits: 2;
|
|
4
|
-
readonly maximumFractionDigits: 2;
|
|
5
|
-
};
|
|
6
|
-
export declare const NUMBER_FORMAT_OPTIONS_CURRENCY_SIGNED: {
|
|
7
|
-
readonly signDisplay: "always";
|
|
8
|
-
readonly style: "currency";
|
|
9
|
-
readonly minimumFractionDigits: 2;
|
|
10
|
-
readonly maximumFractionDigits: 2;
|
|
11
|
-
};
|
|
12
|
-
export declare function parseCurrencyInput(value: string): number;
|
|
13
|
-
/**
|
|
14
|
-
* Currency formatting options
|
|
15
|
-
*/
|
|
16
1
|
export interface FormatCurrencyOptions {
|
|
17
|
-
/** Currency code (default: AUD) */
|
|
18
2
|
currency?: string;
|
|
19
|
-
/** Locale for formatting (default: en-AU) */
|
|
20
3
|
locale?: string;
|
|
21
|
-
/** Number of decimal places (default: 2) */
|
|
22
4
|
decimals?: number;
|
|
23
|
-
/** Minimum decimal places - overrides decimals if set */
|
|
24
5
|
minimumFractionDigits?: number;
|
|
25
|
-
/** Maximum decimal places - overrides decimals if set */
|
|
26
6
|
maximumFractionDigits?: number;
|
|
27
7
|
}
|
|
28
|
-
/**
|
|
29
|
-
* Main currency formatting function - use this for ALL currency display needs.
|
|
30
|
-
*
|
|
31
|
-
* @param value - The numeric value to format
|
|
32
|
-
* @param options - Optional formatting options
|
|
33
|
-
* @returns Formatted currency string (e.g., "$29.50")
|
|
34
|
-
*
|
|
35
|
-
* @example
|
|
36
|
-
* // Standard usage (most cases)
|
|
37
|
-
* formatCurrency(29.50) // "$29.50"
|
|
38
|
-
* formatCurrency(0.29) // "$0.29"
|
|
39
|
-
*
|
|
40
|
-
* // With options
|
|
41
|
-
* formatCurrency(29.50, { decimals: 0 }) // "$30"
|
|
42
|
-
* formatCurrency(29.50, { currency: 'USD' }) // "US$29.50"
|
|
43
|
-
* formatCurrency(1234.5, { decimals: 0 }) // "$1,235"
|
|
44
|
-
*/
|
|
45
8
|
export declare function formatCurrency(value?: number, options?: FormatCurrencyOptions): string;
|
|
46
|
-
export declare function formatQuantityWithSuffix(quantity: number, decimals?: number): string;
|
|
47
|
-
export declare function truncateText(text: string, maxLength?: number): string;
|
|
48
|
-
export declare const formatTransactionAmount: (amount: string | number) => string;
|
|
49
|
-
/**
|
|
50
|
-
* Formats a BSB number with a hyphen for better readability (e.g., "123456" -> "123-456")
|
|
51
|
-
* @param bsb - The BSB number as a string
|
|
52
|
-
* @returns Formatted BSB string with hyphen, or original string if invalid format
|
|
53
|
-
*/
|
|
54
|
-
export declare function formatBSB(bsb: string | null | undefined): string;
|
|
55
|
-
/**
|
|
56
|
-
* Formats an account number with spaces for better readability
|
|
57
|
-
* For account numbers, we'll add spaces every 4 digits from the right (e.g., "12345678" -> "1234 5678")
|
|
58
|
-
* @param accountNumber - The account number as a string
|
|
59
|
-
* @returns Formatted account number with spaces
|
|
60
|
-
*/
|
|
61
|
-
export declare function formatAccountNumber(accountNumber: string | null | undefined): string;
|
|
62
|
-
/**
|
|
63
|
-
* Formats cryptocurrency balance with appropriate precision
|
|
64
|
-
* @param balance - The balance amount (string or number)
|
|
65
|
-
* @param symbol - The crypto symbol (e.g., 'BTC', 'ETH')
|
|
66
|
-
* @param decimals - Number of decimal places (default: 4)
|
|
67
|
-
* @returns Formatted balance string
|
|
68
|
-
*
|
|
69
|
-
* @example
|
|
70
|
-
* formatCryptoBalance(1.23456789, 'BTC') // "1.2346 BTC"
|
|
71
|
-
* formatCryptoBalance(0, 'ETH') // "0 ETH"
|
|
72
|
-
* formatCryptoBalance(0.0001, 'BTC') // "<0.001 BTC"
|
|
73
|
-
* formatCryptoBalance('2.5', 'ETH', 6) // "2.500000 ETH"
|
|
74
|
-
*/
|
|
75
9
|
export declare function formatCryptoBalance(balance: string | number, symbol: string, decimals?: number): string;
|
|
76
|
-
/**
|
|
77
|
-
* Maps blockchain chain names to their native asset symbols.
|
|
78
|
-
* Uses getChainShortCode from shared-constants to ensure consistency.
|
|
79
|
-
*
|
|
80
|
-
* @param chainName - The chain name (case-insensitive)
|
|
81
|
-
* @returns Native asset symbol (e.g., 'ETH', 'BTC', 'MATIC')
|
|
82
|
-
*
|
|
83
|
-
* @example
|
|
84
|
-
* getBlockchainShortName('ethereum') // "ETH"
|
|
85
|
-
* getBlockchainShortName('ETHEREUM') // "ETH"
|
|
86
|
-
* getBlockchainShortName('polygon') // "MATIC"
|
|
87
|
-
* getBlockchainShortName('arbitrum') // "ETH" (uses ETH as native token)
|
|
88
|
-
*/
|
|
89
10
|
export declare function getBlockchainShortName(chainName: string): string;
|
|
90
|
-
/**
|
|
91
|
-
* Formats source of funds codes into human-readable labels.
|
|
92
|
-
* Converts an array of source of funds codes (e.g., ['employment_income', 'savings'])
|
|
93
|
-
* into a comma-separated string of labels (e.g., "Employment income, Savings")
|
|
94
|
-
*
|
|
95
|
-
* @param funds - Array of source of funds codes
|
|
96
|
-
* @returns Comma-separated string of formatted labels
|
|
97
|
-
*
|
|
98
|
-
* @example
|
|
99
|
-
* formatSourceOfFunds(['employment_income', 'savings']) // "Employment income, Savings"
|
|
100
|
-
* formatSourceOfFunds(['investment_income']) // "Investment income"
|
|
101
|
-
*/
|
|
102
|
-
export declare function formatSourceOfFunds(funds: string[]): string;
|
|
103
|
-
/**
|
|
104
|
-
* Formats an intended use code into a human-readable label.
|
|
105
|
-
* Converts a code (e.g., 'long_term') into a label (e.g., "Long-term investment")
|
|
106
|
-
*
|
|
107
|
-
* @param use - The intended use code
|
|
108
|
-
* @returns Human-readable label
|
|
109
|
-
*
|
|
110
|
-
* @example
|
|
111
|
-
* formatIntendedUse('long_term') // "Long-term investment"
|
|
112
|
-
* formatIntendedUse('trading') // "Active trading"
|
|
113
|
-
*/
|
|
114
|
-
export declare function formatIntendedUse(use: string): string;
|
|
115
|
-
/**
|
|
116
|
-
* Formats a number as a percentage string.
|
|
117
|
-
*
|
|
118
|
-
* @param value - The numeric value to format (e.g., 45.5 for 45.5%)
|
|
119
|
-
* @param decimals - Number of decimal places (default: 2)
|
|
120
|
-
* @returns Formatted percentage string (e.g., "45.50%")
|
|
121
|
-
*
|
|
122
|
-
* @example
|
|
123
|
-
* formatPercentage(45.5) // "45.50%"
|
|
124
|
-
* formatPercentage(100) // "100.00%"
|
|
125
|
-
* formatPercentage(33.333, 1) // "33.3%"
|
|
126
|
-
* formatPercentage(0) // "0.00%"
|
|
127
|
-
*/
|
|
128
11
|
export declare function formatPercentage(value: number, decimals?: number): string;
|
|
129
|
-
/**
|
|
130
|
-
* Formats a number as an allocation percentage (always shows 2 decimals, no negative).
|
|
131
|
-
* Specialized for asset allocation displays.
|
|
132
|
-
*
|
|
133
|
-
* @param value - The allocation percentage value
|
|
134
|
-
* @returns Formatted allocation string (e.g., "45.50%")
|
|
135
|
-
*
|
|
136
|
-
* @example
|
|
137
|
-
* formatAllocationPercentage(45.5) // "45.50%"
|
|
138
|
-
* formatAllocationPercentage(-5) // "0.00%" (clamps to 0)
|
|
139
|
-
* formatAllocationPercentage(150) // "100.00%" (clamps to 100)
|
|
140
|
-
*/
|
|
141
|
-
export declare function formatAllocationPercentage(value: number): string;
|
|
142
12
|
//# sourceMappingURL=formatting.d.ts.map
|
package/dist/formatting.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formatting.d.ts","sourceRoot":"","sources":["../src/formatting.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"formatting.d.ts","sourceRoot":"","sources":["../src/formatting.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,qBAAqB,CAAC,EAAE,MAAM,CAAC;CAChC;AAED,wBAAgB,cAAc,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,OAAO,GAAE,qBAA0B,GAAG,MAAM,CAI1F;AAED,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,GAAE,MAAU,GAAG,MAAM,CAK1G;AAED,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAEhE;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,GAAE,MAAU,GAAG,MAAM,CAG5E"}
|
package/dist/formatting.js
CHANGED
|
@@ -1,124 +1,10 @@
|
|
|
1
|
-
import { AUD,
|
|
2
|
-
export const NUMBER_FORMAT_OPTIONS_CURRENCY = {
|
|
3
|
-
style: 'currency',
|
|
4
|
-
minimumFractionDigits: DECIMAL_PLACES,
|
|
5
|
-
maximumFractionDigits: DECIMAL_PLACES,
|
|
6
|
-
};
|
|
7
|
-
export const NUMBER_FORMAT_OPTIONS_CURRENCY_SIGNED = {
|
|
8
|
-
...NUMBER_FORMAT_OPTIONS_CURRENCY,
|
|
9
|
-
signDisplay: 'always',
|
|
10
|
-
};
|
|
11
|
-
export function parseCurrencyInput(value) {
|
|
12
|
-
const cleanValue = value.replace(/[^0-9.]/g, '');
|
|
13
|
-
const parts = cleanValue.split('.');
|
|
14
|
-
const formattedValue = parts[0] + (parts.length > 1 && parts[1] ? '.' + parts[1].slice(0, 2) : '');
|
|
15
|
-
return parseFloat(formattedValue) || 0;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Main currency formatting function - use this for ALL currency display needs.
|
|
19
|
-
*
|
|
20
|
-
* @param value - The numeric value to format
|
|
21
|
-
* @param options - Optional formatting options
|
|
22
|
-
* @returns Formatted currency string (e.g., "$29.50")
|
|
23
|
-
*
|
|
24
|
-
* @example
|
|
25
|
-
* // Standard usage (most cases)
|
|
26
|
-
* formatCurrency(29.50) // "$29.50"
|
|
27
|
-
* formatCurrency(0.29) // "$0.29"
|
|
28
|
-
*
|
|
29
|
-
* // With options
|
|
30
|
-
* formatCurrency(29.50, { decimals: 0 }) // "$30"
|
|
31
|
-
* formatCurrency(29.50, { currency: 'USD' }) // "US$29.50"
|
|
32
|
-
* formatCurrency(1234.5, { decimals: 0 }) // "$1,235"
|
|
33
|
-
*/
|
|
1
|
+
import { AUD, getChainShortCode } from '@cranberry-money/shared-constants';
|
|
34
2
|
export function formatCurrency(value, options = {}) {
|
|
35
|
-
if (value === undefined || value === null)
|
|
36
|
-
return '—';
|
|
37
|
-
if (isNaN(value))
|
|
3
|
+
if (value === undefined || value === null || isNaN(value))
|
|
38
4
|
return '—';
|
|
39
|
-
const { currency = AUD, locale = 'en-AU', decimals = 2, minimumFractionDigits = decimals, maximumFractionDigits = decimals
|
|
40
|
-
return new Intl.NumberFormat(locale, {
|
|
41
|
-
style: 'currency',
|
|
42
|
-
currency,
|
|
43
|
-
minimumFractionDigits,
|
|
44
|
-
maximumFractionDigits,
|
|
45
|
-
}).format(value);
|
|
46
|
-
}
|
|
47
|
-
export function formatQuantityWithSuffix(quantity, decimals = 1) {
|
|
48
|
-
const million = 1000000;
|
|
49
|
-
const thousand = 1000;
|
|
50
|
-
const absQuantity = Math.abs(quantity);
|
|
51
|
-
const sign = quantity < 0 ? '-' : '';
|
|
52
|
-
if (absQuantity >= million) {
|
|
53
|
-
return `${sign}${(absQuantity / million).toFixed(decimals)}M`;
|
|
54
|
-
}
|
|
55
|
-
else if (absQuantity >= thousand) {
|
|
56
|
-
return `${sign}${(absQuantity / thousand).toFixed(decimals)}K`;
|
|
57
|
-
}
|
|
58
|
-
else {
|
|
59
|
-
return quantity.toString();
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
export function truncateText(text, maxLength = 30) {
|
|
63
|
-
if (text.length <= maxLength)
|
|
64
|
-
return text;
|
|
65
|
-
return `${text.substring(0, maxLength)}...`;
|
|
66
|
-
}
|
|
67
|
-
export const formatTransactionAmount = (amount) => {
|
|
68
|
-
const numAmount = typeof amount === 'string' ? parseFloat(amount) : amount;
|
|
69
|
-
return new Intl.NumberFormat(LOCALE_AUSTRALIA, {
|
|
70
|
-
...NUMBER_FORMAT_OPTIONS_CURRENCY_SIGNED,
|
|
71
|
-
currency: AUD,
|
|
72
|
-
}).format(numAmount);
|
|
73
|
-
};
|
|
74
|
-
/**
|
|
75
|
-
* Formats a BSB number with a hyphen for better readability (e.g., "123456" -> "123-456")
|
|
76
|
-
* @param bsb - The BSB number as a string
|
|
77
|
-
* @returns Formatted BSB string with hyphen, or original string if invalid format
|
|
78
|
-
*/
|
|
79
|
-
export function formatBSB(bsb) {
|
|
80
|
-
if (!bsb)
|
|
81
|
-
return 'N/A';
|
|
82
|
-
// Remove any existing hyphens and whitespace
|
|
83
|
-
const cleanBsb = bsb.replace(/[-\s]/g, '');
|
|
84
|
-
// Check if it's a valid 6-digit BSB
|
|
85
|
-
if (!/^\d{6}$/.test(cleanBsb)) {
|
|
86
|
-
return bsb; // Return original if not valid format
|
|
87
|
-
}
|
|
88
|
-
// Format as XXX-XXX
|
|
89
|
-
return `${cleanBsb.substring(0, 3)}-${cleanBsb.substring(3, 6)}`;
|
|
5
|
+
const { currency = AUD, locale = 'en-AU', decimals = 2, minimumFractionDigits = decimals, maximumFractionDigits = decimals } = options;
|
|
6
|
+
return new Intl.NumberFormat(locale, { style: 'currency', currency, minimumFractionDigits, maximumFractionDigits }).format(value);
|
|
90
7
|
}
|
|
91
|
-
/**
|
|
92
|
-
* Formats an account number with spaces for better readability
|
|
93
|
-
* For account numbers, we'll add spaces every 4 digits from the right (e.g., "12345678" -> "1234 5678")
|
|
94
|
-
* @param accountNumber - The account number as a string
|
|
95
|
-
* @returns Formatted account number with spaces
|
|
96
|
-
*/
|
|
97
|
-
export function formatAccountNumber(accountNumber) {
|
|
98
|
-
if (!accountNumber)
|
|
99
|
-
return 'N/A';
|
|
100
|
-
// Remove any existing spaces
|
|
101
|
-
const cleanNumber = accountNumber.replace(/\s/g, '');
|
|
102
|
-
// Check if it's a valid account number (digits only, 4-10 chars)
|
|
103
|
-
if (!/^\d{4,10}$/.test(cleanNumber)) {
|
|
104
|
-
return accountNumber; // Return original if not valid format
|
|
105
|
-
}
|
|
106
|
-
// Add space every 4 digits from the right
|
|
107
|
-
return cleanNumber.replace(/(\d{4})/g, '$1 ').trim();
|
|
108
|
-
}
|
|
109
|
-
/**
|
|
110
|
-
* Formats cryptocurrency balance with appropriate precision
|
|
111
|
-
* @param balance - The balance amount (string or number)
|
|
112
|
-
* @param symbol - The crypto symbol (e.g., 'BTC', 'ETH')
|
|
113
|
-
* @param decimals - Number of decimal places (default: 4)
|
|
114
|
-
* @returns Formatted balance string
|
|
115
|
-
*
|
|
116
|
-
* @example
|
|
117
|
-
* formatCryptoBalance(1.23456789, 'BTC') // "1.2346 BTC"
|
|
118
|
-
* formatCryptoBalance(0, 'ETH') // "0 ETH"
|
|
119
|
-
* formatCryptoBalance(0.0001, 'BTC') // "<0.001 BTC"
|
|
120
|
-
* formatCryptoBalance('2.5', 'ETH', 6) // "2.500000 ETH"
|
|
121
|
-
*/
|
|
122
8
|
export function formatCryptoBalance(balance, symbol, decimals = 4) {
|
|
123
9
|
const balanceNum = typeof balance === 'string' ? parseFloat(balance) : balance;
|
|
124
10
|
if (balanceNum === 0)
|
|
@@ -127,97 +13,12 @@ export function formatCryptoBalance(balance, symbol, decimals = 4) {
|
|
|
127
13
|
return `<0.001 ${symbol}`;
|
|
128
14
|
return `${balanceNum.toFixed(decimals)} ${symbol}`;
|
|
129
15
|
}
|
|
130
|
-
/**
|
|
131
|
-
* Maps blockchain chain names to their native asset symbols.
|
|
132
|
-
* Uses getChainShortCode from shared-constants to ensure consistency.
|
|
133
|
-
*
|
|
134
|
-
* @param chainName - The chain name (case-insensitive)
|
|
135
|
-
* @returns Native asset symbol (e.g., 'ETH', 'BTC', 'MATIC')
|
|
136
|
-
*
|
|
137
|
-
* @example
|
|
138
|
-
* getBlockchainShortName('ethereum') // "ETH"
|
|
139
|
-
* getBlockchainShortName('ETHEREUM') // "ETH"
|
|
140
|
-
* getBlockchainShortName('polygon') // "MATIC"
|
|
141
|
-
* getBlockchainShortName('arbitrum') // "ETH" (uses ETH as native token)
|
|
142
|
-
*/
|
|
143
16
|
export function getBlockchainShortName(chainName) {
|
|
144
17
|
return getChainShortCode(chainName);
|
|
145
18
|
}
|
|
146
|
-
// ============================================
|
|
147
|
-
// Label Formatting Utilities
|
|
148
|
-
// ============================================
|
|
149
|
-
/**
|
|
150
|
-
* Formats source of funds codes into human-readable labels.
|
|
151
|
-
* Converts an array of source of funds codes (e.g., ['employment_income', 'savings'])
|
|
152
|
-
* into a comma-separated string of labels (e.g., "Employment income, Savings")
|
|
153
|
-
*
|
|
154
|
-
* @param funds - Array of source of funds codes
|
|
155
|
-
* @returns Comma-separated string of formatted labels
|
|
156
|
-
*
|
|
157
|
-
* @example
|
|
158
|
-
* formatSourceOfFunds(['employment_income', 'savings']) // "Employment income, Savings"
|
|
159
|
-
* formatSourceOfFunds(['investment_income']) // "Investment income"
|
|
160
|
-
*/
|
|
161
|
-
export function formatSourceOfFunds(funds) {
|
|
162
|
-
if (!funds || funds.length === 0)
|
|
163
|
-
return '';
|
|
164
|
-
return funds
|
|
165
|
-
.map((fund) => SOURCE_OF_FUNDS_LABELS[fund] || fund)
|
|
166
|
-
.join(', ');
|
|
167
|
-
}
|
|
168
|
-
/**
|
|
169
|
-
* Formats an intended use code into a human-readable label.
|
|
170
|
-
* Converts a code (e.g., 'long_term') into a label (e.g., "Long-term investment")
|
|
171
|
-
*
|
|
172
|
-
* @param use - The intended use code
|
|
173
|
-
* @returns Human-readable label
|
|
174
|
-
*
|
|
175
|
-
* @example
|
|
176
|
-
* formatIntendedUse('long_term') // "Long-term investment"
|
|
177
|
-
* formatIntendedUse('trading') // "Active trading"
|
|
178
|
-
*/
|
|
179
|
-
export function formatIntendedUse(use) {
|
|
180
|
-
if (!use)
|
|
181
|
-
return '';
|
|
182
|
-
return INTENDED_USE_LABELS[use] || use;
|
|
183
|
-
}
|
|
184
|
-
// ============================================
|
|
185
|
-
// Percentage Formatting
|
|
186
|
-
// ============================================
|
|
187
|
-
/**
|
|
188
|
-
* Formats a number as a percentage string.
|
|
189
|
-
*
|
|
190
|
-
* @param value - The numeric value to format (e.g., 45.5 for 45.5%)
|
|
191
|
-
* @param decimals - Number of decimal places (default: 2)
|
|
192
|
-
* @returns Formatted percentage string (e.g., "45.50%")
|
|
193
|
-
*
|
|
194
|
-
* @example
|
|
195
|
-
* formatPercentage(45.5) // "45.50%"
|
|
196
|
-
* formatPercentage(100) // "100.00%"
|
|
197
|
-
* formatPercentage(33.333, 1) // "33.3%"
|
|
198
|
-
* formatPercentage(0) // "0.00%"
|
|
199
|
-
*/
|
|
200
19
|
export function formatPercentage(value, decimals = 2) {
|
|
201
20
|
if (value === undefined || value === null || isNaN(value))
|
|
202
21
|
return '—';
|
|
203
22
|
return `${value.toFixed(decimals)}%`;
|
|
204
23
|
}
|
|
205
|
-
/**
|
|
206
|
-
* Formats a number as an allocation percentage (always shows 2 decimals, no negative).
|
|
207
|
-
* Specialized for asset allocation displays.
|
|
208
|
-
*
|
|
209
|
-
* @param value - The allocation percentage value
|
|
210
|
-
* @returns Formatted allocation string (e.g., "45.50%")
|
|
211
|
-
*
|
|
212
|
-
* @example
|
|
213
|
-
* formatAllocationPercentage(45.5) // "45.50%"
|
|
214
|
-
* formatAllocationPercentage(-5) // "0.00%" (clamps to 0)
|
|
215
|
-
* formatAllocationPercentage(150) // "100.00%" (clamps to 100)
|
|
216
|
-
*/
|
|
217
|
-
export function formatAllocationPercentage(value) {
|
|
218
|
-
if (value === undefined || value === null || isNaN(value))
|
|
219
|
-
return '0.00%';
|
|
220
|
-
const clamped = Math.max(0, Math.min(100, value));
|
|
221
|
-
return `${clamped.toFixed(2)}%`;
|
|
222
|
-
}
|
|
223
24
|
//# sourceMappingURL=formatting.js.map
|
package/dist/formatting.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formatting.js","sourceRoot":"","sources":["../src/formatting.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"formatting.js","sourceRoot":"","sources":["../src/formatting.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAU3E,MAAM,UAAU,cAAc,CAAC,KAAc,EAAE,UAAiC,EAAE;IAChF,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,CAAC,KAAK,CAAC;QAAE,OAAO,GAAG,CAAC;IACtE,MAAM,EAAE,QAAQ,GAAG,GAAG,EAAE,MAAM,GAAG,OAAO,EAAE,QAAQ,GAAG,CAAC,EAAE,qBAAqB,GAAG,QAAQ,EAAE,qBAAqB,GAAG,QAAQ,EAAE,GAAG,OAAO,CAAC;IACvI,OAAO,IAAI,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AACpI,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,OAAwB,EAAE,MAAc,EAAE,WAAmB,CAAC;IAChG,MAAM,UAAU,GAAG,OAAO,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;IAC/E,IAAI,UAAU,KAAK,CAAC;QAAE,OAAO,KAAK,MAAM,EAAE,CAAC;IAC3C,IAAI,UAAU,GAAG,KAAK;QAAE,OAAO,UAAU,MAAM,EAAE,CAAC;IAClD,OAAO,GAAG,UAAU,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,MAAM,EAAE,CAAC;AACrD,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,SAAiB;IACtD,OAAO,iBAAiB,CAAC,SAAS,CAAC,CAAC;AACtC,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,KAAa,EAAE,WAAmB,CAAC;IAClE,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,CAAC,KAAK,CAAC;QAAE,OAAO,GAAG,CAAC;IACtE,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC;AACvC,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,14 +1,7 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
7
|
-
export { isValidEthereumAddress, isValidBitcoinAddress, validateWalletAddress, detectChainFromAddress, formatWalletAddress, formatWalletAddressShort, formatWalletAddressMedium, formatWalletAddressLong, getBlockchainExplorerUrl, getTransactionExplorerUrl, isEVMCompatible, isBitcoinBased, } from './validation/wallets';
|
|
8
|
-
export { validateUserProfileField } from './user-validation';
|
|
9
|
-
export { hasActiveFilters, countActiveFilters, hasActiveTransactionFilters, countActiveTransactionFilters, } from './filters';
|
|
10
|
-
export { validateUserPreferences, hasUserPreferences, getUserPreferencesSummary, formatUserPreferencesForDisplay, getAvailablePortfoliosForAccount, isValidUserPreferencesUpdate, getUserPreferencesCacheKey, sanitizeUserPreferencesInput, } from './user-preferences';
|
|
11
|
-
export { formatPhoneForDisplay, cleanPhoneNumber, getExpectedPhoneLength } from './phoneFormatting';
|
|
12
|
-
export { getAssetType, getAssetTypeVariant, ASSET_TYPE_NATIVE_CRYPTO, ASSET_TYPE_STABLECOIN, ASSET_TYPE_TOKENIZED_SECURITY, ASSET_TYPE_TOKENIZED_RWA, ASSET_TYPE_SYNTHETIC, type AllAssetTypes, } from './assets';
|
|
13
|
-
export { getUserVerificationStatus, isUserVerified, isVerificationPending, isVerificationRejected, type VerificationStatusType, type VerificationStatus, } from './user-verification';
|
|
1
|
+
export { formatFullDate, formatShortDate, formatTime, getDateRange, type DateRange, } from './date';
|
|
2
|
+
export { formatCurrency, type FormatCurrencyOptions, formatCryptoBalance, formatPercentage, } from './formatting';
|
|
3
|
+
export { isNumericOnly, validatePassword, formatVerificationToken, validateEmailConfirmation, } from './validation';
|
|
4
|
+
export { validateWalletAddress, detectChainFromAddress, formatWalletAddressShort, formatWalletAddressMedium, } from './validation/wallets';
|
|
5
|
+
export { hasActiveFilters, countActiveFilters } from './filters';
|
|
6
|
+
export { getAssetType, getAssetTypeVariant } from './assets';
|
|
14
7
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,eAAe,EACf,UAAU,EACV,YAAY,EACZ,KAAK,SAAS,GACf,MAAM,QAAQ,CAAC;AAEhB,OAAO,EACL,cAAc,EACd,KAAK,qBAAqB,EAC1B,mBAAmB,EACnB,gBAAgB,GACjB,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,uBAAuB,EACvB,yBAAyB,GAC1B,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACtB,wBAAwB,EACxB,yBAAyB,GAC1B,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAEjE,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,36 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
export {
|
|
3
|
-
|
|
4
|
-
export {
|
|
5
|
-
|
|
6
|
-
export {
|
|
7
|
-
// Currency and number formatting utilities
|
|
8
|
-
export { NUMBER_FORMAT_OPTIONS_CURRENCY, NUMBER_FORMAT_OPTIONS_CURRENCY_SIGNED, parseCurrencyInput, formatCurrency, formatQuantityWithSuffix, formatTransactionAmount, formatBSB, formatAccountNumber, formatCryptoBalance, getBlockchainShortName,
|
|
9
|
-
// Label formatting
|
|
10
|
-
formatSourceOfFunds, formatIntendedUse,
|
|
11
|
-
// Percentage formatting
|
|
12
|
-
formatPercentage, formatAllocationPercentage, } from './formatting';
|
|
13
|
-
// Portfolio utilities
|
|
14
|
-
export { formatPortfolioValue, calculateReturnPercentage, parseNumericValue, validateAllocations } from './portfolio';
|
|
15
|
-
// Validation utilities
|
|
16
|
-
export { isNumericOnly, validatePassword, formatVerificationToken, validateEmailConfirmation, isValidPhoneFormat, isValidFullName, formatPhoneNumber, isValidSourceOfFunds, isValidOccupation, } from './validation';
|
|
17
|
-
// Wallet validation utilities
|
|
18
|
-
export { isValidEthereumAddress, isValidBitcoinAddress, validateWalletAddress, detectChainFromAddress, formatWalletAddress, formatWalletAddressShort, formatWalletAddressMedium, formatWalletAddressLong, getBlockchainExplorerUrl, getTransactionExplorerUrl, isEVMCompatible, isBitcoinBased, } from './validation/wallets';
|
|
19
|
-
// User profile validation utilities
|
|
20
|
-
export { validateUserProfileField } from './user-validation';
|
|
21
|
-
// Filter utilities
|
|
22
|
-
export { hasActiveFilters, countActiveFilters, hasActiveTransactionFilters, countActiveTransactionFilters, } from './filters';
|
|
23
|
-
// User preferences utilities
|
|
24
|
-
export { validateUserPreferences, hasUserPreferences, getUserPreferencesSummary, formatUserPreferencesForDisplay, getAvailablePortfoliosForAccount, isValidUserPreferencesUpdate, getUserPreferencesCacheKey, sanitizeUserPreferencesInput, } from './user-preferences';
|
|
25
|
-
// Phone formatting utilities
|
|
26
|
-
export { formatPhoneForDisplay, cleanPhoneNumber, getExpectedPhoneLength } from './phoneFormatting';
|
|
27
|
-
// Asset utilities (Phase 7)
|
|
28
|
-
export {
|
|
29
|
-
// Asset functions
|
|
30
|
-
getAssetType, getAssetTypeVariant,
|
|
31
|
-
// Phase 7 Constants
|
|
32
|
-
ASSET_TYPE_NATIVE_CRYPTO, ASSET_TYPE_STABLECOIN, ASSET_TYPE_TOKENIZED_SECURITY, ASSET_TYPE_TOKENIZED_RWA, ASSET_TYPE_SYNTHETIC, } from './assets';
|
|
33
|
-
// User verification utilities
|
|
34
|
-
export { getUserVerificationStatus, isUserVerified, isVerificationPending, isVerificationRejected, } from './user-verification';
|
|
35
|
-
// No re-exports - consumers should import directly from @cranberry-money/shared-types
|
|
1
|
+
export { formatFullDate, formatShortDate, formatTime, getDateRange, } from './date';
|
|
2
|
+
export { formatCurrency, formatCryptoBalance, formatPercentage, } from './formatting';
|
|
3
|
+
export { isNumericOnly, validatePassword, formatVerificationToken, validateEmailConfirmation, } from './validation';
|
|
4
|
+
export { validateWalletAddress, detectChainFromAddress, formatWalletAddressShort, formatWalletAddressMedium, } from './validation/wallets';
|
|
5
|
+
export { hasActiveFilters, countActiveFilters } from './filters';
|
|
6
|
+
export { getAssetType, getAssetTypeVariant } from './assets';
|
|
36
7
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,eAAe,EACf,UAAU,EACV,YAAY,GAEb,MAAM,QAAQ,CAAC;AAEhB,OAAO,EACL,cAAc,EAEd,mBAAmB,EACnB,gBAAgB,GACjB,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,uBAAuB,EACvB,yBAAyB,GAC1B,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACtB,wBAAwB,EACxB,yBAAyB,GAC1B,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAEjE,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC"}
|
package/dist/validation.d.ts
CHANGED
|
@@ -3,9 +3,4 @@ export declare function isNumericOnly(str: string): boolean;
|
|
|
3
3
|
export declare function validatePassword(password: string, minLength?: number): PasswordValidation;
|
|
4
4
|
export declare function formatVerificationToken(token: string): string;
|
|
5
5
|
export declare function validateEmailConfirmation(token: string, exactLength?: number): EmailConfirmationValidation;
|
|
6
|
-
export declare function isValidPhoneFormat(phoneNumber: string, minLength?: number): boolean;
|
|
7
|
-
export declare function isValidFullName(fullName: string, minParts?: 2): boolean;
|
|
8
|
-
export declare function formatPhoneNumber(phoneNumber: string): string;
|
|
9
|
-
export declare function isValidSourceOfFunds(sources: string[], minSources?: 1): boolean;
|
|
10
|
-
export declare function isValidOccupation(occupation: string, minLength?: 2, maxLength?: 200): boolean;
|
|
11
6
|
//# sourceMappingURL=validation.d.ts.map
|
package/dist/validation.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../src/validation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../src/validation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAErG,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAElD;AAED,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,SAAI,GAAG,kBAAkB,CAIpF;AAED,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAE7D;AAED,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,SAAI,GAAG,2BAA2B,CAIrG"}
|
package/dist/validation.js
CHANGED
|
@@ -1,76 +1,17 @@
|
|
|
1
|
-
import { USER_PROFILE_VALIDATION, FINANCIAL_PROFILE_VALIDATION } from '@cranberry-money/shared-constants';
|
|
2
1
|
export function isNumericOnly(str) {
|
|
3
2
|
return /^\d+$/.test(str);
|
|
4
3
|
}
|
|
5
4
|
export function validatePassword(password, minLength = 8) {
|
|
6
5
|
const lengthValid = password.length >= minLength;
|
|
7
6
|
const notNumeric = !isNumericOnly(password);
|
|
8
|
-
|
|
9
|
-
return {
|
|
10
|
-
isValid,
|
|
11
|
-
lengthValid,
|
|
12
|
-
notNumeric,
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
function isValidTokenFormat(token, exactLength = 6) {
|
|
16
|
-
const trimmedToken = token.trim();
|
|
17
|
-
// Validate for exactly N digits (default 6)
|
|
18
|
-
const pattern = new RegExp(`^[0-9]{${exactLength}}$`);
|
|
19
|
-
return pattern.test(trimmedToken);
|
|
7
|
+
return { isValid: lengthValid && notNumeric, lengthValid, notNumeric };
|
|
20
8
|
}
|
|
21
9
|
export function formatVerificationToken(token) {
|
|
22
|
-
// Only keep digits for numeric tokens
|
|
23
10
|
return token.trim().replace(/[^0-9]/g, '');
|
|
24
11
|
}
|
|
25
12
|
export function validateEmailConfirmation(token, exactLength = 6) {
|
|
26
13
|
const formattedToken = formatVerificationToken(token);
|
|
27
|
-
const isValidFormat =
|
|
28
|
-
|
|
29
|
-
const isValid = formattedToken.length === exactLength && isValidFormat;
|
|
30
|
-
return {
|
|
31
|
-
isValid,
|
|
32
|
-
isEmpty,
|
|
33
|
-
isValidFormat,
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
export function isValidPhoneFormat(phoneNumber, minLength = 8) {
|
|
37
|
-
const trimmedPhone = phoneNumber.trim();
|
|
38
|
-
return trimmedPhone.length >= minLength && /^[+\-\s\d()]+$/.test(trimmedPhone);
|
|
39
|
-
}
|
|
40
|
-
export function isValidFullName(fullName, minParts = USER_PROFILE_VALIDATION.MIN_NAME_PARTS) {
|
|
41
|
-
const trimmedName = fullName.trim();
|
|
42
|
-
const nameParts = trimmedName.split(/\s+/);
|
|
43
|
-
return nameParts.length >= minParts && nameParts.every((part) => part.length > 0);
|
|
44
|
-
}
|
|
45
|
-
export function formatPhoneNumber(phoneNumber) {
|
|
46
|
-
if (!phoneNumber)
|
|
47
|
-
return '';
|
|
48
|
-
const cleaned = phoneNumber.replace(/\D/g, '');
|
|
49
|
-
if (cleaned.startsWith('1') && cleaned.length === 11) {
|
|
50
|
-
return `+1 (${cleaned.slice(1, 4)}) ${cleaned.slice(4, 7)}-${cleaned.slice(7)}`;
|
|
51
|
-
}
|
|
52
|
-
if (cleaned.length === 10) {
|
|
53
|
-
return `(${cleaned.slice(0, 3)}) ${cleaned.slice(3, 6)}-${cleaned.slice(6)}`;
|
|
54
|
-
}
|
|
55
|
-
if (cleaned.startsWith('61') && cleaned.length === 11) {
|
|
56
|
-
const mobile = cleaned.slice(2);
|
|
57
|
-
return `+61 ${mobile.slice(0, 3)} ${mobile.slice(3, 6)} ${mobile.slice(6)}`;
|
|
58
|
-
}
|
|
59
|
-
if (cleaned.length > 10) {
|
|
60
|
-
const countryCode = cleaned.slice(0, -10);
|
|
61
|
-
const number = cleaned.slice(-10);
|
|
62
|
-
if (countryCode === '61') {
|
|
63
|
-
return `+61 ${number.slice(0, 3)} ${number.slice(3, 6)} ${number.slice(6)}`;
|
|
64
|
-
}
|
|
65
|
-
return `+${countryCode} (${number.slice(0, 3)}) ${number.slice(3, 6)}-${number.slice(6)}`;
|
|
66
|
-
}
|
|
67
|
-
return phoneNumber.trim();
|
|
68
|
-
}
|
|
69
|
-
export function isValidSourceOfFunds(sources, minSources = FINANCIAL_PROFILE_VALIDATION.MIN_SOURCE_OF_FUNDS) {
|
|
70
|
-
return sources && sources.length >= minSources;
|
|
71
|
-
}
|
|
72
|
-
export function isValidOccupation(occupation, minLength = FINANCIAL_PROFILE_VALIDATION.MIN_OCCUPATION_LENGTH, maxLength = FINANCIAL_PROFILE_VALIDATION.MAX_OCCUPATION_LENGTH) {
|
|
73
|
-
const trimmed = occupation.trim();
|
|
74
|
-
return trimmed.length >= minLength && trimmed.length <= maxLength;
|
|
14
|
+
const isValidFormat = new RegExp(`^[0-9]{${exactLength}}$`).test(formattedToken);
|
|
15
|
+
return { isValid: formattedToken.length === exactLength && isValidFormat, isEmpty: formattedToken.length === 0, isValidFormat };
|
|
75
16
|
}
|
|
76
17
|
//# sourceMappingURL=validation.js.map
|
package/dist/validation.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validation.js","sourceRoot":"","sources":["../src/validation.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"validation.js","sourceRoot":"","sources":["../src/validation.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,aAAa,CAAC,GAAW;IACvC,OAAO,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC3B,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,QAAgB,EAAE,SAAS,GAAG,CAAC;IAC9D,MAAM,WAAW,GAAG,QAAQ,CAAC,MAAM,IAAI,SAAS,CAAC;IACjD,MAAM,UAAU,GAAG,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;IAC5C,OAAO,EAAE,OAAO,EAAE,WAAW,IAAI,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,CAAC;AACzE,CAAC;AAED,MAAM,UAAU,uBAAuB,CAAC,KAAa;IACnD,OAAO,KAAK,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;AAC7C,CAAC;AAED,MAAM,UAAU,yBAAyB,CAAC,KAAa,EAAE,WAAW,GAAG,CAAC;IACtE,MAAM,cAAc,GAAG,uBAAuB,CAAC,KAAK,CAAC,CAAC;IACtD,MAAM,aAAa,GAAG,IAAI,MAAM,CAAC,UAAU,WAAW,IAAI,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IACjF,OAAO,EAAE,OAAO,EAAE,cAAc,CAAC,MAAM,KAAK,WAAW,IAAI,aAAa,EAAE,OAAO,EAAE,cAAc,CAAC,MAAM,KAAK,CAAC,EAAE,aAAa,EAAE,CAAC;AAClI,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cranberry-money/shared-utils",
|
|
3
|
-
"version": "8.23.
|
|
3
|
+
"version": "8.23.413",
|
|
4
4
|
"description": "Shared utility functions for Blueberry platform",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"prepublishOnly": "npm run clean && npm run typecheck && npm test && npm run build"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@cranberry-money/shared-constants": "^8.15.
|
|
33
|
-
"@cranberry-money/shared-types": "^8.22.
|
|
32
|
+
"@cranberry-money/shared-constants": "^8.15.438",
|
|
33
|
+
"@cranberry-money/shared-types": "^8.22.413"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@types/jest": "^30.0.0",
|
package/dist/address.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { ParsedAddress } from '@cranberry-money/shared-types';
|
|
2
|
-
export declare function parseAddress(address: string): ParsedAddress;
|
|
3
|
-
export declare function getAddressDisplayLines(parsed: ParsedAddress): Array<{
|
|
4
|
-
label: string;
|
|
5
|
-
value: string;
|
|
6
|
-
}>;
|
|
7
|
-
//# sourceMappingURL=address.d.ts.map
|
package/dist/address.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"address.d.ts","sourceRoot":"","sources":["../src/address.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAEnE,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,aAAa,CAoF3D;AAED,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,aAAa,GAAG,KAAK,CAAC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,CAwBrG"}
|