@sudobility/types 1.9.53 → 1.9.55
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/types/blockchain/index.cjs +30 -0
- package/dist/types/blockchain/index.d.ts +14 -0
- package/dist/types/blockchain/index.d.ts.map +1 -0
- package/dist/types/blockchain/index.js +30 -0
- package/dist/types/blockchain/index.js.map +1 -0
- package/dist/types/blockchain/validation.cjs +57 -1
- package/dist/types/blockchain/validation.d.ts +57 -1
- package/dist/types/blockchain/validation.d.ts.map +1 -1
- package/dist/types/blockchain/validation.js +57 -1
- package/dist/types/blockchain/validation.js.map +1 -1
- package/dist/types/business/enums.cjs +110 -25
- package/dist/types/business/enums.d.ts +110 -2
- package/dist/types/business/enums.d.ts.map +1 -1
- package/dist/types/business/enums.js +110 -25
- package/dist/types/business/enums.js.map +1 -1
- package/dist/types/common.cjs +7 -1
- package/dist/types/common.d.ts +134 -20
- package/dist/types/common.d.ts.map +1 -1
- package/dist/types/common.js +7 -1
- package/dist/types/common.js.map +1 -1
- package/dist/utils/async-helpers.cjs +124 -10
- package/dist/utils/async-helpers.d.ts +129 -8
- package/dist/utils/async-helpers.d.ts.map +1 -1
- package/dist/utils/async-helpers.js +124 -10
- package/dist/utils/async-helpers.js.map +1 -1
- package/dist/utils/formatting/currency.cjs +5 -2
- package/dist/utils/formatting/currency.d.ts +5 -1
- package/dist/utils/formatting/currency.d.ts.map +1 -1
- package/dist/utils/formatting/currency.js +5 -2
- package/dist/utils/formatting/currency.js.map +1 -1
- package/dist/utils/formatting/date.cjs +67 -8
- package/dist/utils/formatting/date.d.ts +67 -8
- package/dist/utils/formatting/date.d.ts.map +1 -1
- package/dist/utils/formatting/date.js +67 -8
- package/dist/utils/formatting/date.js.map +1 -1
- package/dist/utils/formatting/string.cjs +150 -17
- package/dist/utils/formatting/string.d.ts +150 -17
- package/dist/utils/formatting/string.d.ts.map +1 -1
- package/dist/utils/formatting/string.js +150 -17
- package/dist/utils/formatting/string.js.map +1 -1
- package/dist/utils/validation/type-validation.cjs +94 -11
- package/dist/utils/validation/type-validation.d.ts +94 -11
- package/dist/utils/validation/type-validation.d.ts.map +1 -1
- package/dist/utils/validation/type-validation.js +94 -11
- package/dist/utils/validation/type-validation.js.map +1 -1
- package/package.json +6 -1
|
@@ -1,14 +1,32 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
* Common async operation patterns and helpers
|
|
4
|
-
* Reduces boilerplate code for common async operations
|
|
3
|
+
* Common async operation patterns and helpers.
|
|
4
|
+
* Reduces boilerplate code for common async operations.
|
|
5
|
+
*
|
|
6
|
+
* @since 1.0.0
|
|
5
7
|
*/
|
|
6
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
9
|
exports.debounceAsync = exports.clearExpiredCache = exports.withCache = exports.withTimeout = exports.safeParallel = exports.withLoadingState = exports.safeAsync = void 0;
|
|
8
10
|
const logger_1 = require("./logging/logger");
|
|
9
11
|
/**
|
|
10
|
-
* Safely execute an async operation with error handling
|
|
11
|
-
* Returns a result object instead of throwing
|
|
12
|
+
* Safely execute an async operation with error handling.
|
|
13
|
+
* Returns a result object instead of throwing.
|
|
14
|
+
*
|
|
15
|
+
* @template T - The success data type
|
|
16
|
+
* @param operation - Async function to execute
|
|
17
|
+
* @param context - Optional context string for logging
|
|
18
|
+
* @returns A promise resolving to an {@link AsyncResult}
|
|
19
|
+
* @since 1.0.0
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```typescript
|
|
23
|
+
* const result = await safeAsync(() => fetchUser(id), 'fetchUser');
|
|
24
|
+
* if (result.success) {
|
|
25
|
+
* console.log(result.data);
|
|
26
|
+
* } else {
|
|
27
|
+
* console.error(result.error?.message);
|
|
28
|
+
* }
|
|
29
|
+
* ```
|
|
12
30
|
*/
|
|
13
31
|
const safeAsync = async (operation, context) => {
|
|
14
32
|
try {
|
|
@@ -23,7 +41,26 @@ const safeAsync = async (operation, context) => {
|
|
|
23
41
|
};
|
|
24
42
|
exports.safeAsync = safeAsync;
|
|
25
43
|
/**
|
|
26
|
-
* Execute async operation with loading state tracking
|
|
44
|
+
* Execute async operation with loading state tracking.
|
|
45
|
+
* Manages `setLoading` and `setError` callbacks automatically.
|
|
46
|
+
*
|
|
47
|
+
* @template T - The success data type
|
|
48
|
+
* @param operation - Async function to execute
|
|
49
|
+
* @param setLoading - Callback to update loading state
|
|
50
|
+
* @param setError - Callback to update error state
|
|
51
|
+
* @param context - Optional context string for logging
|
|
52
|
+
* @returns The operation result, or undefined on error
|
|
53
|
+
* @since 1.0.0
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* ```typescript
|
|
57
|
+
* const data = await withLoadingState(
|
|
58
|
+
* () => api.getUsers(),
|
|
59
|
+
* setIsLoading,
|
|
60
|
+
* setErrorMsg,
|
|
61
|
+
* 'getUsers'
|
|
62
|
+
* );
|
|
63
|
+
* ```
|
|
27
64
|
*/
|
|
28
65
|
const withLoadingState = async (operation, setLoading, setError, context) => {
|
|
29
66
|
setLoading(true);
|
|
@@ -44,7 +81,22 @@ const withLoadingState = async (operation, setLoading, setError, context) => {
|
|
|
44
81
|
};
|
|
45
82
|
exports.withLoadingState = withLoadingState;
|
|
46
83
|
/**
|
|
47
|
-
* Execute multiple async operations in parallel with error handling
|
|
84
|
+
* Execute multiple async operations in parallel with error handling.
|
|
85
|
+
* All operations run concurrently via `Promise.all`.
|
|
86
|
+
*
|
|
87
|
+
* @template T - Tuple of result types
|
|
88
|
+
* @param operations - Array of async functions to execute in parallel
|
|
89
|
+
* @param context - Optional context string for logging
|
|
90
|
+
* @returns A promise resolving to an {@link AsyncResult} of the tuple
|
|
91
|
+
* @since 1.0.0
|
|
92
|
+
*
|
|
93
|
+
* @example
|
|
94
|
+
* ```typescript
|
|
95
|
+
* const result = await safeParallel(
|
|
96
|
+
* [() => fetchUser(1), () => fetchPosts(1)] as const,
|
|
97
|
+
* 'loadProfile'
|
|
98
|
+
* );
|
|
99
|
+
* ```
|
|
48
100
|
*/
|
|
49
101
|
const safeParallel = async (operations, context) => {
|
|
50
102
|
try {
|
|
@@ -59,7 +111,25 @@ const safeParallel = async (operations, context) => {
|
|
|
59
111
|
};
|
|
60
112
|
exports.safeParallel = safeParallel;
|
|
61
113
|
/**
|
|
62
|
-
* Execute async operation with timeout
|
|
114
|
+
* Execute async operation with a timeout.
|
|
115
|
+
* Rejects if the operation does not complete within `timeoutMs`.
|
|
116
|
+
*
|
|
117
|
+
* @template T - The success data type
|
|
118
|
+
* @param operation - Async function to execute
|
|
119
|
+
* @param timeoutMs - Maximum time in milliseconds
|
|
120
|
+
* @param context - Optional context string for logging
|
|
121
|
+
* @returns The operation result
|
|
122
|
+
* @throws Error if the operation times out
|
|
123
|
+
* @since 1.0.0
|
|
124
|
+
*
|
|
125
|
+
* @example
|
|
126
|
+
* ```typescript
|
|
127
|
+
* const data = await withTimeout(
|
|
128
|
+
* () => fetch('/api/data').then((r) => r.json()),
|
|
129
|
+
* 5000,
|
|
130
|
+
* 'fetchData'
|
|
131
|
+
* );
|
|
132
|
+
* ```
|
|
63
133
|
*/
|
|
64
134
|
const withTimeout = async (operation, timeoutMs, context) => {
|
|
65
135
|
const timeoutPromise = new Promise((_, reject) => setTimeout(() => reject(new Error(`Operation timed out after ${timeoutMs}ms`)), timeoutMs));
|
|
@@ -73,9 +143,30 @@ const withTimeout = async (operation, timeoutMs, context) => {
|
|
|
73
143
|
};
|
|
74
144
|
exports.withTimeout = withTimeout;
|
|
75
145
|
/**
|
|
76
|
-
*
|
|
146
|
+
* In-memory cache for {@link withCache}.
|
|
77
147
|
*/
|
|
78
148
|
const cache = new Map();
|
|
149
|
+
/**
|
|
150
|
+
* Cache async operation results with TTL (time-to-live).
|
|
151
|
+
* Returns cached data if still valid; otherwise executes the operation
|
|
152
|
+
* and stores the result.
|
|
153
|
+
*
|
|
154
|
+
* @template T - The cached data type
|
|
155
|
+
* @param key - Unique cache key
|
|
156
|
+
* @param operation - Async function whose result is cached
|
|
157
|
+
* @param ttlMs - Cache TTL in milliseconds (default: 5 minutes)
|
|
158
|
+
* @returns The cached or freshly fetched data
|
|
159
|
+
* @since 1.0.0
|
|
160
|
+
*
|
|
161
|
+
* @example
|
|
162
|
+
* ```typescript
|
|
163
|
+
* const user = await withCache(
|
|
164
|
+
* `user-${id}`,
|
|
165
|
+
* () => api.getUser(id),
|
|
166
|
+
* 60_000 // 1 minute
|
|
167
|
+
* );
|
|
168
|
+
* ```
|
|
169
|
+
*/
|
|
79
170
|
const withCache = async (key, operation, ttlMs = 5 * 60 * 1000 // 5 minutes default
|
|
80
171
|
) => {
|
|
81
172
|
const cached = cache.get(key);
|
|
@@ -89,7 +180,8 @@ const withCache = async (key, operation, ttlMs = 5 * 60 * 1000 // 5 minutes defa
|
|
|
89
180
|
};
|
|
90
181
|
exports.withCache = withCache;
|
|
91
182
|
/**
|
|
92
|
-
* Clear expired cache entries
|
|
183
|
+
* Clear expired cache entries from the in-memory cache.
|
|
184
|
+
* @since 1.0.0
|
|
93
185
|
*/
|
|
94
186
|
const clearExpiredCache = () => {
|
|
95
187
|
const now = Date.now();
|
|
@@ -101,9 +193,31 @@ const clearExpiredCache = () => {
|
|
|
101
193
|
};
|
|
102
194
|
exports.clearExpiredCache = clearExpiredCache;
|
|
103
195
|
/**
|
|
104
|
-
*
|
|
196
|
+
* Active debounce timers keyed by operation key.
|
|
105
197
|
*/
|
|
106
198
|
const debounceMap = new Map();
|
|
199
|
+
/**
|
|
200
|
+
* Debounce async function calls by key.
|
|
201
|
+
* Only the last call within the delay window will execute.
|
|
202
|
+
*
|
|
203
|
+
* @template T - Argument types
|
|
204
|
+
* @template R - Return type
|
|
205
|
+
* @param fn - The async function to debounce
|
|
206
|
+
* @param delay - Debounce delay in milliseconds
|
|
207
|
+
* @param key - Unique key identifying this debounced operation
|
|
208
|
+
* @returns A debounced version of `fn`
|
|
209
|
+
* @since 1.0.0
|
|
210
|
+
*
|
|
211
|
+
* @example
|
|
212
|
+
* ```typescript
|
|
213
|
+
* const debouncedSearch = debounceAsync(
|
|
214
|
+
* (query: string) => api.search(query),
|
|
215
|
+
* 300,
|
|
216
|
+
* 'search'
|
|
217
|
+
* );
|
|
218
|
+
* await debouncedSearch('hello');
|
|
219
|
+
* ```
|
|
220
|
+
*/
|
|
107
221
|
const debounceAsync = (fn, delay, key) => {
|
|
108
222
|
return (...args) => {
|
|
109
223
|
return new Promise(resolve => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"async-helpers.js","sourceRoot":"","sources":["../../src/utils/async-helpers.ts"],"names":[],"mappings":";AAAA;;;
|
|
1
|
+
{"version":3,"file":"async-helpers.js","sourceRoot":"","sources":["../../src/utils/async-helpers.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,6CAA0C;AAgB1C;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,SAAS,GAAG,KAAK,EACrB,SAA2B,EAC3B,OAAgB,EACS,EAAE;IAC3B,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,MAAM,SAAS,EAAE,CAAC;QAC/B,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IACjC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,QAAQ,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QAC3E,eAAM,CAAC,KAAK,CAAC,2BAA2B,QAAQ,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;QAC5E,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IAC7C,CAAC;AACH,CAAC,CAAC;AA2OA,8BAAS;AAzOX;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,gBAAgB,GAAG,KAAK,EAC5B,SAA2B,EAC3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,CAAC,CAAC;gBAClB,CAAC;gBAAC,OAAO,KAAK,EAAE,CAAC;oBACf,eAAM,CAAC,KAAK,CAAC,4BAA4B,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;oBACvD,OAAO,CAAC,SAAS,CAAC,CAAC;gBACrB,CAAC;YACH,CAAC,EAAE,KAAK,CAAC,CAAC;YAEV,WAAW,CAAC,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QAChC,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC,CAAC;AASA,sCAAa"}
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
* Currency formatting utilities for USDC and other tokens
|
|
3
|
+
* Currency formatting utilities for USDC and other tokens.
|
|
4
|
+
*
|
|
5
|
+
* @since 1.0.0
|
|
4
6
|
*/
|
|
5
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
8
|
exports.CLAIM_PERIOD_DAYS = exports.USDC_DECIMALS = void 0;
|
|
7
9
|
exports.formatUSDC = formatUSDC;
|
|
8
10
|
exports.parseUSDC = parseUSDC;
|
|
9
|
-
|
|
11
|
+
/** Number of decimal places for USDC token amounts. */
|
|
10
12
|
exports.USDC_DECIMALS = 6;
|
|
13
|
+
/** Revenue claim expiration period in days. */
|
|
11
14
|
exports.CLAIM_PERIOD_DAYS = 60;
|
|
12
15
|
/**
|
|
13
16
|
* Format USDC amount from smallest unit to human-readable string
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Currency formatting utilities for USDC and other tokens
|
|
2
|
+
* Currency formatting utilities for USDC and other tokens.
|
|
3
|
+
*
|
|
4
|
+
* @since 1.0.0
|
|
3
5
|
*/
|
|
6
|
+
/** Number of decimal places for USDC token amounts. */
|
|
4
7
|
export declare const USDC_DECIMALS = 6;
|
|
8
|
+
/** Revenue claim expiration period in days. */
|
|
5
9
|
export declare const CLAIM_PERIOD_DAYS = 60;
|
|
6
10
|
/**
|
|
7
11
|
* Format USDC amount from smallest unit to human-readable string
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"currency.d.ts","sourceRoot":"","sources":["../../../src/utils/formatting/currency.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"currency.d.ts","sourceRoot":"","sources":["../../../src/utils/formatting/currency.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,uDAAuD;AACvD,eAAO,MAAM,aAAa,IAAI,CAAC;AAE/B,+CAA+C;AAC/C,eAAO,MAAM,iBAAiB,KAAK,CAAC;AAEpC;;;;;;;;GAQG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAEjD;AAED;;;;;;;;GAQG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAEhD"}
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
* Currency formatting utilities for USDC and other tokens
|
|
3
|
+
* Currency formatting utilities for USDC and other tokens.
|
|
4
|
+
*
|
|
5
|
+
* @since 1.0.0
|
|
4
6
|
*/
|
|
5
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
8
|
exports.CLAIM_PERIOD_DAYS = exports.USDC_DECIMALS = void 0;
|
|
7
9
|
exports.formatUSDC = formatUSDC;
|
|
8
10
|
exports.parseUSDC = parseUSDC;
|
|
9
|
-
|
|
11
|
+
/** Number of decimal places for USDC token amounts. */
|
|
10
12
|
exports.USDC_DECIMALS = 6;
|
|
13
|
+
/** Revenue claim expiration period in days. */
|
|
11
14
|
exports.CLAIM_PERIOD_DAYS = 60;
|
|
12
15
|
/**
|
|
13
16
|
* Format USDC amount from smallest unit to human-readable string
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"currency.js","sourceRoot":"","sources":["../../../src/utils/formatting/currency.ts"],"names":[],"mappings":";AAAA
|
|
1
|
+
{"version":3,"file":"currency.js","sourceRoot":"","sources":["../../../src/utils/formatting/currency.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAiBH,gCAEC;AAWD,8BAEC;AA9BD,uDAAuD;AAC1C,QAAA,aAAa,GAAG,CAAC,CAAC;AAE/B,+CAA+C;AAClC,QAAA,iBAAiB,GAAG,EAAE,CAAC;AAEpC;;;;;;;;GAQG;AACH,SAAgB,UAAU,CAAC,MAAc;IACvC,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,qBAAa,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;AAC3D,CAAC;AAED;;;;;;;;GAQG;AACH,SAAgB,SAAS,CAAC,MAAc;IACtC,OAAO,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,qBAAa,CAAC,CAAC,CAAC;AACtE,CAAC"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
* Date formatting utilities
|
|
3
|
+
* Date formatting utilities.
|
|
4
|
+
*
|
|
5
|
+
* @since 1.0.0
|
|
4
6
|
*/
|
|
5
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
8
|
exports.formatEmailDate = formatEmailDate;
|
|
@@ -11,7 +13,19 @@ exports.isDateInRange = isDateInRange;
|
|
|
11
13
|
exports.addDays = addDays;
|
|
12
14
|
exports.addHours = addHours;
|
|
13
15
|
/**
|
|
14
|
-
* Format a date for display in email list
|
|
16
|
+
* Format a date for display in email list.
|
|
17
|
+
* Returns time for today, "Yesterday", day name for the past week,
|
|
18
|
+
* or a short date for older messages.
|
|
19
|
+
*
|
|
20
|
+
* @param date - Date object or ISO date string
|
|
21
|
+
* @returns Formatted date string
|
|
22
|
+
* @since 1.0.0
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```typescript
|
|
26
|
+
* formatEmailDate(new Date()); // "3:45 PM"
|
|
27
|
+
* formatEmailDate('2024-01-15'); // "Jan 15"
|
|
28
|
+
* ```
|
|
15
29
|
*/
|
|
16
30
|
function formatEmailDate(date) {
|
|
17
31
|
const dateObj = typeof date === 'string' ? new Date(date) : date;
|
|
@@ -54,13 +68,32 @@ function formatEmailDate(date) {
|
|
|
54
68
|
});
|
|
55
69
|
}
|
|
56
70
|
/**
|
|
57
|
-
* Format a timestamp to ISO string
|
|
71
|
+
* Format a Unix timestamp (ms) to an ISO 8601 string.
|
|
72
|
+
*
|
|
73
|
+
* @param timestamp - Unix timestamp in milliseconds
|
|
74
|
+
* @returns ISO 8601 date string
|
|
75
|
+
* @since 1.0.0
|
|
76
|
+
*
|
|
77
|
+
* @example
|
|
78
|
+
* ```typescript
|
|
79
|
+
* formatTimestamp(1700000000000); // "2023-11-14T22:13:20.000Z"
|
|
80
|
+
* ```
|
|
58
81
|
*/
|
|
59
82
|
function formatTimestamp(timestamp) {
|
|
60
83
|
return new Date(timestamp).toISOString();
|
|
61
84
|
}
|
|
62
85
|
/**
|
|
63
|
-
* Format a date to a relative time string (e.g., "2 hours ago")
|
|
86
|
+
* Format a date to a relative time string (e.g., "2 hours ago").
|
|
87
|
+
*
|
|
88
|
+
* @param date - Date object, ISO string, or Unix timestamp (ms)
|
|
89
|
+
* @returns Human-readable relative time string
|
|
90
|
+
* @since 1.0.0
|
|
91
|
+
*
|
|
92
|
+
* @example
|
|
93
|
+
* ```typescript
|
|
94
|
+
* formatRelativeTime(Date.now() - 3600000); // "1 hour ago"
|
|
95
|
+
* formatRelativeTime('2024-01-01'); // "1 year ago"
|
|
96
|
+
* ```
|
|
64
97
|
*/
|
|
65
98
|
function formatRelativeTime(date) {
|
|
66
99
|
const dateObj = typeof date === 'string' || typeof date === 'number'
|
|
@@ -99,7 +132,17 @@ function formatRelativeTime(date) {
|
|
|
99
132
|
return diffYears === 1 ? '1 year ago' : `${diffYears} years ago`;
|
|
100
133
|
}
|
|
101
134
|
/**
|
|
102
|
-
* Parse a date string safely
|
|
135
|
+
* Parse a date string safely, returning null on invalid input.
|
|
136
|
+
*
|
|
137
|
+
* @param dateString - Date string to parse
|
|
138
|
+
* @returns Parsed Date or null if invalid
|
|
139
|
+
* @since 1.0.0
|
|
140
|
+
*
|
|
141
|
+
* @example
|
|
142
|
+
* ```typescript
|
|
143
|
+
* parseDate('2024-01-15'); // Date object
|
|
144
|
+
* parseDate('not-a-date'); // null
|
|
145
|
+
* ```
|
|
103
146
|
*/
|
|
104
147
|
function parseDate(dateString) {
|
|
105
148
|
try {
|
|
@@ -114,13 +157,24 @@ function parseDate(dateString) {
|
|
|
114
157
|
}
|
|
115
158
|
}
|
|
116
159
|
/**
|
|
117
|
-
* Check if a date
|
|
160
|
+
* Check if a date falls within an inclusive range.
|
|
161
|
+
*
|
|
162
|
+
* @param date - Date to check
|
|
163
|
+
* @param startDate - Range start (inclusive)
|
|
164
|
+
* @param endDate - Range end (inclusive)
|
|
165
|
+
* @returns True if date is within the range
|
|
166
|
+
* @since 1.0.0
|
|
118
167
|
*/
|
|
119
168
|
function isDateInRange(date, startDate, endDate) {
|
|
120
169
|
return date >= startDate && date <= endDate;
|
|
121
170
|
}
|
|
122
171
|
/**
|
|
123
|
-
* Add days
|
|
172
|
+
* Add (or subtract) days from a date. Returns a new Date instance.
|
|
173
|
+
*
|
|
174
|
+
* @param date - Starting date
|
|
175
|
+
* @param days - Number of days to add (negative to subtract)
|
|
176
|
+
* @returns New Date with days added
|
|
177
|
+
* @since 1.0.0
|
|
124
178
|
*/
|
|
125
179
|
function addDays(date, days) {
|
|
126
180
|
const result = new Date(date);
|
|
@@ -128,7 +182,12 @@ function addDays(date, days) {
|
|
|
128
182
|
return result;
|
|
129
183
|
}
|
|
130
184
|
/**
|
|
131
|
-
* Add hours
|
|
185
|
+
* Add (or subtract) hours from a date. Returns a new Date instance.
|
|
186
|
+
*
|
|
187
|
+
* @param date - Starting date
|
|
188
|
+
* @param hours - Number of hours to add (negative to subtract)
|
|
189
|
+
* @returns New Date with hours added
|
|
190
|
+
* @since 1.0.0
|
|
132
191
|
*/
|
|
133
192
|
function addHours(date, hours) {
|
|
134
193
|
const result = new Date(date);
|
|
@@ -1,33 +1,92 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Date formatting utilities
|
|
2
|
+
* Date formatting utilities.
|
|
3
|
+
*
|
|
4
|
+
* @since 1.0.0
|
|
3
5
|
*/
|
|
4
6
|
import { Optional } from '../../types/common';
|
|
5
7
|
/**
|
|
6
|
-
* Format a date for display in email list
|
|
8
|
+
* Format a date for display in email list.
|
|
9
|
+
* Returns time for today, "Yesterday", day name for the past week,
|
|
10
|
+
* or a short date for older messages.
|
|
11
|
+
*
|
|
12
|
+
* @param date - Date object or ISO date string
|
|
13
|
+
* @returns Formatted date string
|
|
14
|
+
* @since 1.0.0
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```typescript
|
|
18
|
+
* formatEmailDate(new Date()); // "3:45 PM"
|
|
19
|
+
* formatEmailDate('2024-01-15'); // "Jan 15"
|
|
20
|
+
* ```
|
|
7
21
|
*/
|
|
8
22
|
export declare function formatEmailDate(date: Date | string): string;
|
|
9
23
|
/**
|
|
10
|
-
* Format a timestamp to ISO string
|
|
24
|
+
* Format a Unix timestamp (ms) to an ISO 8601 string.
|
|
25
|
+
*
|
|
26
|
+
* @param timestamp - Unix timestamp in milliseconds
|
|
27
|
+
* @returns ISO 8601 date string
|
|
28
|
+
* @since 1.0.0
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```typescript
|
|
32
|
+
* formatTimestamp(1700000000000); // "2023-11-14T22:13:20.000Z"
|
|
33
|
+
* ```
|
|
11
34
|
*/
|
|
12
35
|
export declare function formatTimestamp(timestamp: number): string;
|
|
13
36
|
/**
|
|
14
|
-
* Format a date to a relative time string (e.g., "2 hours ago")
|
|
37
|
+
* Format a date to a relative time string (e.g., "2 hours ago").
|
|
38
|
+
*
|
|
39
|
+
* @param date - Date object, ISO string, or Unix timestamp (ms)
|
|
40
|
+
* @returns Human-readable relative time string
|
|
41
|
+
* @since 1.0.0
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```typescript
|
|
45
|
+
* formatRelativeTime(Date.now() - 3600000); // "1 hour ago"
|
|
46
|
+
* formatRelativeTime('2024-01-01'); // "1 year ago"
|
|
47
|
+
* ```
|
|
15
48
|
*/
|
|
16
49
|
export declare function formatRelativeTime(date: Date | string | number): string;
|
|
17
50
|
/**
|
|
18
|
-
* Parse a date string safely
|
|
51
|
+
* Parse a date string safely, returning null on invalid input.
|
|
52
|
+
*
|
|
53
|
+
* @param dateString - Date string to parse
|
|
54
|
+
* @returns Parsed Date or null if invalid
|
|
55
|
+
* @since 1.0.0
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* ```typescript
|
|
59
|
+
* parseDate('2024-01-15'); // Date object
|
|
60
|
+
* parseDate('not-a-date'); // null
|
|
61
|
+
* ```
|
|
19
62
|
*/
|
|
20
63
|
export declare function parseDate(dateString: string): Optional<Date>;
|
|
21
64
|
/**
|
|
22
|
-
* Check if a date
|
|
65
|
+
* Check if a date falls within an inclusive range.
|
|
66
|
+
*
|
|
67
|
+
* @param date - Date to check
|
|
68
|
+
* @param startDate - Range start (inclusive)
|
|
69
|
+
* @param endDate - Range end (inclusive)
|
|
70
|
+
* @returns True if date is within the range
|
|
71
|
+
* @since 1.0.0
|
|
23
72
|
*/
|
|
24
73
|
export declare function isDateInRange(date: Date, startDate: Date, endDate: Date): boolean;
|
|
25
74
|
/**
|
|
26
|
-
* Add days
|
|
75
|
+
* Add (or subtract) days from a date. Returns a new Date instance.
|
|
76
|
+
*
|
|
77
|
+
* @param date - Starting date
|
|
78
|
+
* @param days - Number of days to add (negative to subtract)
|
|
79
|
+
* @returns New Date with days added
|
|
80
|
+
* @since 1.0.0
|
|
27
81
|
*/
|
|
28
82
|
export declare function addDays(date: Date, days: number): Date;
|
|
29
83
|
/**
|
|
30
|
-
* Add hours
|
|
84
|
+
* Add (or subtract) hours from a date. Returns a new Date instance.
|
|
85
|
+
*
|
|
86
|
+
* @param date - Starting date
|
|
87
|
+
* @param hours - Number of hours to add (negative to subtract)
|
|
88
|
+
* @returns New Date with hours added
|
|
89
|
+
* @since 1.0.0
|
|
31
90
|
*/
|
|
32
91
|
export declare function addHours(date: Date, hours: number): Date;
|
|
33
92
|
//# sourceMappingURL=date.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date.d.ts","sourceRoot":"","sources":["../../../src/utils/formatting/date.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"date.d.ts","sourceRoot":"","sources":["../../../src/utils/formatting/date.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,CA8C3D;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAEzD;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CA6CvE;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,SAAS,CAAC,UAAU,EAAE,MAAM,GAAG,QAAQ,CAAC,IAAI,CAAC,CAU5D;AAED;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAC3B,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,IAAI,EACf,OAAO,EAAE,IAAI,GACZ,OAAO,CAET;AAED;;;;;;;GAOG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAItD;AAED;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAIxD"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
* Date formatting utilities
|
|
3
|
+
* Date formatting utilities.
|
|
4
|
+
*
|
|
5
|
+
* @since 1.0.0
|
|
4
6
|
*/
|
|
5
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
8
|
exports.formatEmailDate = formatEmailDate;
|
|
@@ -11,7 +13,19 @@ exports.isDateInRange = isDateInRange;
|
|
|
11
13
|
exports.addDays = addDays;
|
|
12
14
|
exports.addHours = addHours;
|
|
13
15
|
/**
|
|
14
|
-
* Format a date for display in email list
|
|
16
|
+
* Format a date for display in email list.
|
|
17
|
+
* Returns time for today, "Yesterday", day name for the past week,
|
|
18
|
+
* or a short date for older messages.
|
|
19
|
+
*
|
|
20
|
+
* @param date - Date object or ISO date string
|
|
21
|
+
* @returns Formatted date string
|
|
22
|
+
* @since 1.0.0
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```typescript
|
|
26
|
+
* formatEmailDate(new Date()); // "3:45 PM"
|
|
27
|
+
* formatEmailDate('2024-01-15'); // "Jan 15"
|
|
28
|
+
* ```
|
|
15
29
|
*/
|
|
16
30
|
function formatEmailDate(date) {
|
|
17
31
|
const dateObj = typeof date === 'string' ? new Date(date) : date;
|
|
@@ -54,13 +68,32 @@ function formatEmailDate(date) {
|
|
|
54
68
|
});
|
|
55
69
|
}
|
|
56
70
|
/**
|
|
57
|
-
* Format a timestamp to ISO string
|
|
71
|
+
* Format a Unix timestamp (ms) to an ISO 8601 string.
|
|
72
|
+
*
|
|
73
|
+
* @param timestamp - Unix timestamp in milliseconds
|
|
74
|
+
* @returns ISO 8601 date string
|
|
75
|
+
* @since 1.0.0
|
|
76
|
+
*
|
|
77
|
+
* @example
|
|
78
|
+
* ```typescript
|
|
79
|
+
* formatTimestamp(1700000000000); // "2023-11-14T22:13:20.000Z"
|
|
80
|
+
* ```
|
|
58
81
|
*/
|
|
59
82
|
function formatTimestamp(timestamp) {
|
|
60
83
|
return new Date(timestamp).toISOString();
|
|
61
84
|
}
|
|
62
85
|
/**
|
|
63
|
-
* Format a date to a relative time string (e.g., "2 hours ago")
|
|
86
|
+
* Format a date to a relative time string (e.g., "2 hours ago").
|
|
87
|
+
*
|
|
88
|
+
* @param date - Date object, ISO string, or Unix timestamp (ms)
|
|
89
|
+
* @returns Human-readable relative time string
|
|
90
|
+
* @since 1.0.0
|
|
91
|
+
*
|
|
92
|
+
* @example
|
|
93
|
+
* ```typescript
|
|
94
|
+
* formatRelativeTime(Date.now() - 3600000); // "1 hour ago"
|
|
95
|
+
* formatRelativeTime('2024-01-01'); // "1 year ago"
|
|
96
|
+
* ```
|
|
64
97
|
*/
|
|
65
98
|
function formatRelativeTime(date) {
|
|
66
99
|
const dateObj = typeof date === 'string' || typeof date === 'number'
|
|
@@ -99,7 +132,17 @@ function formatRelativeTime(date) {
|
|
|
99
132
|
return diffYears === 1 ? '1 year ago' : `${diffYears} years ago`;
|
|
100
133
|
}
|
|
101
134
|
/**
|
|
102
|
-
* Parse a date string safely
|
|
135
|
+
* Parse a date string safely, returning null on invalid input.
|
|
136
|
+
*
|
|
137
|
+
* @param dateString - Date string to parse
|
|
138
|
+
* @returns Parsed Date or null if invalid
|
|
139
|
+
* @since 1.0.0
|
|
140
|
+
*
|
|
141
|
+
* @example
|
|
142
|
+
* ```typescript
|
|
143
|
+
* parseDate('2024-01-15'); // Date object
|
|
144
|
+
* parseDate('not-a-date'); // null
|
|
145
|
+
* ```
|
|
103
146
|
*/
|
|
104
147
|
function parseDate(dateString) {
|
|
105
148
|
try {
|
|
@@ -114,13 +157,24 @@ function parseDate(dateString) {
|
|
|
114
157
|
}
|
|
115
158
|
}
|
|
116
159
|
/**
|
|
117
|
-
* Check if a date
|
|
160
|
+
* Check if a date falls within an inclusive range.
|
|
161
|
+
*
|
|
162
|
+
* @param date - Date to check
|
|
163
|
+
* @param startDate - Range start (inclusive)
|
|
164
|
+
* @param endDate - Range end (inclusive)
|
|
165
|
+
* @returns True if date is within the range
|
|
166
|
+
* @since 1.0.0
|
|
118
167
|
*/
|
|
119
168
|
function isDateInRange(date, startDate, endDate) {
|
|
120
169
|
return date >= startDate && date <= endDate;
|
|
121
170
|
}
|
|
122
171
|
/**
|
|
123
|
-
* Add days
|
|
172
|
+
* Add (or subtract) days from a date. Returns a new Date instance.
|
|
173
|
+
*
|
|
174
|
+
* @param date - Starting date
|
|
175
|
+
* @param days - Number of days to add (negative to subtract)
|
|
176
|
+
* @returns New Date with days added
|
|
177
|
+
* @since 1.0.0
|
|
124
178
|
*/
|
|
125
179
|
function addDays(date, days) {
|
|
126
180
|
const result = new Date(date);
|
|
@@ -128,7 +182,12 @@ function addDays(date, days) {
|
|
|
128
182
|
return result;
|
|
129
183
|
}
|
|
130
184
|
/**
|
|
131
|
-
* Add hours
|
|
185
|
+
* Add (or subtract) hours from a date. Returns a new Date instance.
|
|
186
|
+
*
|
|
187
|
+
* @param date - Starting date
|
|
188
|
+
* @param hours - Number of hours to add (negative to subtract)
|
|
189
|
+
* @returns New Date with hours added
|
|
190
|
+
* @since 1.0.0
|
|
132
191
|
*/
|
|
133
192
|
function addHours(date, hours) {
|
|
134
193
|
const result = new Date(date);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date.js","sourceRoot":"","sources":["../../../src/utils/formatting/date.ts"],"names":[],"mappings":";AAAA;;
|
|
1
|
+
{"version":3,"file":"date.js","sourceRoot":"","sources":["../../../src/utils/formatting/date.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;AAmBH,0CA8CC;AAcD,0CAEC;AAeD,gDA6CC;AAeD,8BAUC;AAWD,sCAMC;AAUD,0BAIC;AAUD,4BAIC;AA/MD;;;;;;;;;;;;;;GAcG;AACH,SAAgB,eAAe,CAAC,IAAmB;IACjD,MAAM,OAAO,GAAG,OAAO,IAAI,KAAK,QAAQ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