@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.
Files changed (46) hide show
  1. package/dist/types/blockchain/index.cjs +30 -0
  2. package/dist/types/blockchain/index.d.ts +14 -0
  3. package/dist/types/blockchain/index.d.ts.map +1 -0
  4. package/dist/types/blockchain/index.js +30 -0
  5. package/dist/types/blockchain/index.js.map +1 -0
  6. package/dist/types/blockchain/validation.cjs +57 -1
  7. package/dist/types/blockchain/validation.d.ts +57 -1
  8. package/dist/types/blockchain/validation.d.ts.map +1 -1
  9. package/dist/types/blockchain/validation.js +57 -1
  10. package/dist/types/blockchain/validation.js.map +1 -1
  11. package/dist/types/business/enums.cjs +110 -25
  12. package/dist/types/business/enums.d.ts +110 -2
  13. package/dist/types/business/enums.d.ts.map +1 -1
  14. package/dist/types/business/enums.js +110 -25
  15. package/dist/types/business/enums.js.map +1 -1
  16. package/dist/types/common.cjs +7 -1
  17. package/dist/types/common.d.ts +134 -20
  18. package/dist/types/common.d.ts.map +1 -1
  19. package/dist/types/common.js +7 -1
  20. package/dist/types/common.js.map +1 -1
  21. package/dist/utils/async-helpers.cjs +124 -10
  22. package/dist/utils/async-helpers.d.ts +129 -8
  23. package/dist/utils/async-helpers.d.ts.map +1 -1
  24. package/dist/utils/async-helpers.js +124 -10
  25. package/dist/utils/async-helpers.js.map +1 -1
  26. package/dist/utils/formatting/currency.cjs +5 -2
  27. package/dist/utils/formatting/currency.d.ts +5 -1
  28. package/dist/utils/formatting/currency.d.ts.map +1 -1
  29. package/dist/utils/formatting/currency.js +5 -2
  30. package/dist/utils/formatting/currency.js.map +1 -1
  31. package/dist/utils/formatting/date.cjs +67 -8
  32. package/dist/utils/formatting/date.d.ts +67 -8
  33. package/dist/utils/formatting/date.d.ts.map +1 -1
  34. package/dist/utils/formatting/date.js +67 -8
  35. package/dist/utils/formatting/date.js.map +1 -1
  36. package/dist/utils/formatting/string.cjs +150 -17
  37. package/dist/utils/formatting/string.d.ts +150 -17
  38. package/dist/utils/formatting/string.d.ts.map +1 -1
  39. package/dist/utils/formatting/string.js +150 -17
  40. package/dist/utils/formatting/string.js.map +1 -1
  41. package/dist/utils/validation/type-validation.cjs +94 -11
  42. package/dist/utils/validation/type-validation.d.ts +94 -11
  43. package/dist/utils/validation/type-validation.d.ts.map +1 -1
  44. package/dist/utils/validation/type-validation.js +94 -11
  45. package/dist/utils/validation/type-validation.js.map +1 -1
  46. package/package.json +6 -1
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
  /**
3
- * String formatting and manipulation utilities
3
+ * String formatting and manipulation utilities.
4
+ *
5
+ * @since 1.0.0
4
6
  */
5
7
  Object.defineProperty(exports, "__esModule", { value: true });
6
8
  exports.truncate = truncate;
@@ -20,7 +22,18 @@ exports.randomString = randomString;
20
22
  exports.pluralize = pluralize;
21
23
  exports.formatNumber = formatNumber;
22
24
  /**
23
- * Truncate a string to a maximum length with ellipsis
25
+ * Truncate a string to a maximum length with a suffix (default `...`).
26
+ *
27
+ * @param str - Input string
28
+ * @param maxLength - Maximum allowed length including suffix
29
+ * @param suffix - Truncation suffix (default: `'...'`)
30
+ * @returns Truncated string or original if within limit
31
+ * @since 1.0.0
32
+ *
33
+ * @example
34
+ * ```typescript
35
+ * truncate('Hello, World!', 8); // "Hello..."
36
+ * ```
24
37
  */
25
38
  function truncate(str, maxLength, suffix = '...') {
26
39
  if (!str || str.length <= maxLength) {
@@ -29,7 +42,16 @@ function truncate(str, maxLength, suffix = '...') {
29
42
  return str.slice(0, maxLength - suffix.length) + suffix;
30
43
  }
31
44
  /**
32
- * Capitalize the first letter of a string
45
+ * Capitalize the first letter of a string.
46
+ *
47
+ * @param str - Input string
48
+ * @returns String with first character uppercased
49
+ * @since 1.0.0
50
+ *
51
+ * @example
52
+ * ```typescript
53
+ * capitalize('hello'); // "Hello"
54
+ * ```
33
55
  */
34
56
  function capitalize(str) {
35
57
  if (!str)
@@ -37,7 +59,16 @@ function capitalize(str) {
37
59
  return str.charAt(0).toUpperCase() + str.slice(1);
38
60
  }
39
61
  /**
40
- * Convert a string to title case
62
+ * Convert a string to title case (capitalize each word).
63
+ *
64
+ * @param str - Input string
65
+ * @returns Title-cased string
66
+ * @since 1.0.0
67
+ *
68
+ * @example
69
+ * ```typescript
70
+ * toTitleCase('hello world'); // "Hello World"
71
+ * ```
41
72
  */
42
73
  function toTitleCase(str) {
43
74
  if (!str)
@@ -49,7 +80,16 @@ function toTitleCase(str) {
49
80
  .join(' ');
50
81
  }
51
82
  /**
52
- * Convert a string to kebab case
83
+ * Convert a string to kebab-case.
84
+ *
85
+ * @param str - Input string (camelCase, PascalCase, spaces, or underscores)
86
+ * @returns Kebab-cased string
87
+ * @since 1.0.0
88
+ *
89
+ * @example
90
+ * ```typescript
91
+ * toKebabCase('helloWorld'); // "hello-world"
92
+ * ```
53
93
  */
54
94
  function toKebabCase(str) {
55
95
  if (!str)
@@ -60,7 +100,16 @@ function toKebabCase(str) {
60
100
  .toLowerCase();
61
101
  }
62
102
  /**
63
- * Convert a string to camel case
103
+ * Convert a string to camelCase.
104
+ *
105
+ * @param str - Input string (kebab-case, snake_case, or spaces)
106
+ * @returns camelCased string
107
+ * @since 1.0.0
108
+ *
109
+ * @example
110
+ * ```typescript
111
+ * toCamelCase('hello-world'); // "helloWorld"
112
+ * ```
64
113
  */
65
114
  function toCamelCase(str) {
66
115
  if (!str)
@@ -70,7 +119,16 @@ function toCamelCase(str) {
70
119
  .replace(/^./, (char) => char.toLowerCase());
71
120
  }
72
121
  /**
73
- * Convert a string to snake case
122
+ * Convert a string to snake_case.
123
+ *
124
+ * @param str - Input string (camelCase, kebab-case, or spaces)
125
+ * @returns snake_cased string
126
+ * @since 1.0.0
127
+ *
128
+ * @example
129
+ * ```typescript
130
+ * toSnakeCase('helloWorld'); // "hello_world"
131
+ * ```
74
132
  */
75
133
  function toSnakeCase(str) {
76
134
  if (!str)
@@ -81,7 +139,11 @@ function toSnakeCase(str) {
81
139
  .toLowerCase();
82
140
  }
83
141
  /**
84
- * Remove extra whitespace from a string
142
+ * Collapse consecutive whitespace to a single space and trim.
143
+ *
144
+ * @param str - Input string
145
+ * @returns Normalized string
146
+ * @since 1.0.0
85
147
  */
86
148
  function normalizeWhitespace(str) {
87
149
  if (!str)
@@ -89,19 +151,36 @@ function normalizeWhitespace(str) {
89
151
  return str.replace(/\s+/g, ' ').trim();
90
152
  }
91
153
  /**
92
- * Check if a string is empty or only whitespace
154
+ * Check if a string is empty, undefined, null, or only whitespace.
155
+ *
156
+ * @param str - Input string (may be nullish)
157
+ * @returns True if blank
158
+ * @since 1.0.0
93
159
  */
94
160
  function isBlank(str) {
95
161
  return !str || str.trim().length === 0;
96
162
  }
97
163
  /**
98
- * Check if a string is not empty and not only whitespace
164
+ * Type guard: check if a string is not empty and not only whitespace.
165
+ *
166
+ * @param str - Input string (may be nullish)
167
+ * @returns True (and narrows to `string`) if not blank
168
+ * @since 1.0.0
99
169
  */
100
170
  function isNotBlank(str) {
101
171
  return !isBlank(str);
102
172
  }
103
173
  /**
104
- * Escape HTML special characters
174
+ * Escape HTML special characters (`&`, `<`, `>`, `"`, `'`).
175
+ *
176
+ * @param str - Input string
177
+ * @returns HTML-escaped string
178
+ * @since 1.0.0
179
+ *
180
+ * @example
181
+ * ```typescript
182
+ * escapeHtml('<b>Hi</b>'); // "&lt;b&gt;Hi&lt;/b&gt;"
183
+ * ```
105
184
  */
106
185
  function escapeHtml(str) {
107
186
  if (!str)
@@ -116,7 +195,16 @@ function escapeHtml(str) {
116
195
  return str.replace(/[&<>"']/g, (char) => htmlEscapes[char]);
117
196
  }
118
197
  /**
119
- * Remove HTML tags from a string
198
+ * Remove all HTML tags from a string.
199
+ *
200
+ * @param str - Input string with HTML
201
+ * @returns Plain text with tags removed
202
+ * @since 1.0.0
203
+ *
204
+ * @example
205
+ * ```typescript
206
+ * stripHtml('<p>Hello <b>world</b></p>'); // "Hello world"
207
+ * ```
120
208
  */
121
209
  function stripHtml(str) {
122
210
  if (!str)
@@ -124,7 +212,12 @@ function stripHtml(str) {
124
212
  return str.replace(/<[^>]*>/g, '');
125
213
  }
126
214
  /**
127
- * Extract initials from a name
215
+ * Extract initials from a name (e.g., "John Doe" -> "JD").
216
+ *
217
+ * @param name - Full name
218
+ * @param maxInitials - Maximum number of initials (default: 2)
219
+ * @returns Uppercase initials
220
+ * @since 1.0.0
128
221
  */
129
222
  function getInitials(name, maxInitials = 2) {
130
223
  if (!name)
@@ -137,7 +230,18 @@ function getInitials(name, maxInitials = 2) {
137
230
  return initials;
138
231
  }
139
232
  /**
140
- * Format bytes to human-readable size
233
+ * Format bytes to a human-readable size string (e.g., "1.5 MB").
234
+ *
235
+ * @param bytes - Size in bytes
236
+ * @param decimals - Decimal places (default: 2)
237
+ * @returns Formatted string like "1.5 MB"
238
+ * @since 1.0.0
239
+ *
240
+ * @example
241
+ * ```typescript
242
+ * formatBytes(1536); // "1.5 KB"
243
+ * formatBytes(0); // "0 Bytes"
244
+ * ```
141
245
  */
142
246
  function formatBytes(bytes, decimals = 2) {
143
247
  if (bytes === 0)
@@ -149,7 +253,13 @@ function formatBytes(bytes, decimals = 2) {
149
253
  return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + sizes[i];
150
254
  }
151
255
  /**
152
- * Generate a random string
256
+ * Generate a random string of a given length.
257
+ *
258
+ * @param length - Desired string length
259
+ * @param charset - Character set: `'alpha'`, `'numeric'`,
260
+ * `'alphanumeric'` (default), `'hex'`, or a custom string
261
+ * @returns Random string
262
+ * @since 1.0.0
153
263
  */
154
264
  function randomString(length, charset = 'alphanumeric') {
155
265
  let chars;
@@ -176,7 +286,21 @@ function randomString(length, charset = 'alphanumeric') {
176
286
  return result;
177
287
  }
178
288
  /**
179
- * Pluralize a word based on count
289
+ * Pluralize a word based on count.
290
+ * Appends `'s'` by default when count is not 1.
291
+ *
292
+ * @param count - Item count
293
+ * @param singular - Singular form
294
+ * @param plural - Optional explicit plural form
295
+ * @returns Singular or plural form based on count
296
+ * @since 1.0.0
297
+ *
298
+ * @example
299
+ * ```typescript
300
+ * pluralize(1, 'item'); // "item"
301
+ * pluralize(3, 'item'); // "items"
302
+ * pluralize(2, 'child', 'children'); // "children"
303
+ * ```
180
304
  */
181
305
  function pluralize(count, singular, plural) {
182
306
  if (count === 1) {
@@ -185,7 +309,16 @@ function pluralize(count, singular, plural) {
185
309
  return plural || `${singular}s`;
186
310
  }
187
311
  /**
188
- * Format a number with commas as thousands separators
312
+ * Format a number with commas as thousands separators.
313
+ *
314
+ * @param num - Number to format
315
+ * @returns Formatted string (e.g., "1,234,567")
316
+ * @since 1.0.0
317
+ *
318
+ * @example
319
+ * ```typescript
320
+ * formatNumber(1234567); // "1,234,567"
321
+ * ```
189
322
  */
190
323
  function formatNumber(num) {
191
324
  return num.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',');
@@ -1 +1 @@
1
- {"version":3,"file":"string.js","sourceRoot":"","sources":["../../../src/utils/formatting/string.ts"],"names":[],"mappings":";AAAA;;GAEG;;AAOH,4BASC;AAKD,gCAGC;AAKD,kCAOC;AAKD,kCAMC;AAKD,kCAKC;AAKD,kCAMC;AAKD,kDAGC;AAKD,0BAEC;AAKD,gCAEC;AAKD,gCAUC;AAKD,8BAGC;AAKD,kCAUC;AAKD,kCAUC;AAKD,oCA0BC;AAKD,8BASC;AAKD,oCAEC;AA/LD;;GAEG;AACH,SAAgB,QAAQ,CACtB,GAAW,EACX,SAAiB,EACjB,MAAM,GAAG,KAAK;IAEd,IAAI,CAAC,GAAG,IAAI,GAAG,CAAC,MAAM,IAAI,SAAS,EAAE,CAAC;QACpC,OAAO,GAAG,CAAC;IACb,CAAC;IACD,OAAO,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC;AAC1D,CAAC;AAED;;GAEG;AACH,SAAgB,UAAU,CAAC,GAAW;IACpC,IAAI,CAAC,GAAG;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AAC,CAAC,CAAC;AAC3E,CAAC;AAED;;;;;;;;GAQG;AACH,SAAgB,YAAY,CAAC,MAAc,EAAE,OAAO,GAAG,cAAc;IACnE,IAAI,KAAa,CAAC;IAElB,QAAQ,OAAO,EAAE,CAAC;QAChB,KAAK,OAAO;YACV,KAAK,GAAG,sDAAsD,CAAC;YAC/D,MAAM;QACR,KAAK,SAAS;YACZ,KAAK,GAAG,YAAY,CAAC;YACrB,MAAM;QACR,KAAK,cAAc;YACjB,KAAK,GAAG,gEAAgE,CAAC;YACzE,MAAM;QACR,KAAK,KAAK;YACR,KAAK,GAAG,kBAAkB,CAAC;YAC3B,MAAM;QACR;YACE,KAAK,GAAG,OAAO,CAAC;IACpB,CAAC;IAED,IAAI,MAAM,GAAG,EAAE,CAAC;IAChB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QAChC,MAAM,IAAI,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;IACnE,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,SAAgB,SAAS,CACvB,KAAa,EACb,QAAgB,EAChB,MAAyB;IAEzB,IAAI,KAAK,KAAK,CAAC,EAAE,CAAC;QAChB,OAAO,QAAQ,CAAC;IAClB,CAAC;IACD,OAAO,MAAM,IAAI,GAAG,QAAQ,GAAG,CAAC;AAClC,CAAC;AAED;;;;;;;;;;;GAWG;AACH,SAAgB,YAAY,CAAC,GAAW;IACtC,OAAO,GAAG,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,uBAAuB,EAAE,GAAG,CAAC,CAAC;AAC9D,CAAC"}
@@ -8,7 +8,21 @@
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
9
  exports.parseJson = exports.createAssertion = exports.isUrl = exports.isEmail = exports.isValidDate = exports.isErrorResponse = exports.isSuccessResponse = exports.isApiResponse = exports.optional = exports.validateArray = exports.hasRequiredProperties = exports.isNullish = exports.isArray = exports.isObject = exports.isBoolean = exports.isNumber = exports.isString = exports.createValidator = void 0;
10
10
  /**
11
- * Creates a validation function that safely checks if a value matches expected type
11
+ * Creates a validation function that safely checks if a value matches
12
+ * the expected type. Returns a {@link ValidationResult}.
13
+ *
14
+ * @template T - The validated type
15
+ * @param validationFn - Type guard function
16
+ * @param typeName - Name used in error messages
17
+ * @returns A function returning `ValidationResult<T>`
18
+ * @since 1.0.0
19
+ *
20
+ * @example
21
+ * ```typescript
22
+ * const validateString = createValidator(isString, 'string');
23
+ * validateString('hi'); // { isValid: true, data: 'hi' }
24
+ * validateString(42); // { isValid: false, error: 'Invalid string' }
25
+ * ```
12
26
  */
13
27
  const createValidator = (validationFn, typeName) => {
14
28
  return (data) => {
@@ -29,22 +43,49 @@ const createValidator = (validationFn, typeName) => {
29
43
  };
30
44
  exports.createValidator = createValidator;
31
45
  /**
32
- * Basic type validators
46
+ * Runtime type guard: checks if value is a `string`.
47
+ * @since 1.0.0
33
48
  */
34
49
  const isString = (value) => typeof value === 'string';
35
50
  exports.isString = isString;
51
+ /**
52
+ * Runtime type guard: checks if value is a finite `number` (excludes NaN).
53
+ * @since 1.0.0
54
+ */
36
55
  const isNumber = (value) => typeof value === 'number' && !isNaN(value);
37
56
  exports.isNumber = isNumber;
57
+ /**
58
+ * Runtime type guard: checks if value is a `boolean`.
59
+ * @since 1.0.0
60
+ */
38
61
  const isBoolean = (value) => typeof value === 'boolean';
39
62
  exports.isBoolean = isBoolean;
63
+ /**
64
+ * Runtime type guard: checks if value is a non-null, non-array object.
65
+ * @since 1.0.0
66
+ */
40
67
  const isObject = (value) => typeof value === 'object' && value !== null && !Array.isArray(value);
41
68
  exports.isObject = isObject;
69
+ /**
70
+ * Runtime type guard: checks if value is an array.
71
+ * @since 1.0.0
72
+ */
42
73
  const isArray = (value) => Array.isArray(value);
43
74
  exports.isArray = isArray;
75
+ /**
76
+ * Runtime type guard: checks if value is `null` or `undefined`.
77
+ * @since 1.0.0
78
+ */
44
79
  const isNullish = (value) => value === null || value === undefined;
45
80
  exports.isNullish = isNullish;
46
81
  /**
47
- * Validates that an object has required properties
82
+ * Validates that an object has all required properties present.
83
+ *
84
+ * @template T - Expected object shape
85
+ * @param obj - Value to check
86
+ * @param requiredProps - Array of required property keys
87
+ * @returns True if obj has all required properties
88
+ * @since 1.0.0
48
89
  */
49
90
  const hasRequiredProperties = (obj, requiredProps) => {
50
91
  if (!(0, exports.isObject)(obj))
@@ -53,7 +94,13 @@ const hasRequiredProperties = (obj, requiredProps) => {
53
94
  };
54
95
  exports.hasRequiredProperties = hasRequiredProperties;
55
96
  /**
56
- * Validates array of objects with a validator function
97
+ * Validates that a value is an array where every item passes a validator.
98
+ *
99
+ * @template T - Expected item type
100
+ * @param data - Value to check
101
+ * @param itemValidator - Type guard for individual items
102
+ * @returns True if data is an array of T
103
+ * @since 1.0.0
57
104
  */
58
105
  const validateArray = (data, itemValidator) => {
59
106
  if (!(0, exports.isArray)(data))
@@ -62,14 +109,20 @@ const validateArray = (data, itemValidator) => {
62
109
  };
63
110
  exports.validateArray = validateArray;
64
111
  /**
65
- * Creates optional property validator
112
+ * Wraps a validator to also accept `undefined`.
113
+ *
114
+ * @template T - The validated type
115
+ * @param validator - Base type guard
116
+ * @returns Type guard that also accepts `undefined`
117
+ * @since 1.0.0
66
118
  */
67
119
  const optional = (validator) => (value) => {
68
120
  return value === undefined || validator(value);
69
121
  };
70
122
  exports.optional = optional;
71
123
  /**
72
- * Common pattern validators for API responses
124
+ * Check if data looks like an API response (has `success` boolean).
125
+ * @since 1.0.0
73
126
  */
74
127
  const isApiResponse = (data) => {
75
128
  return (0, exports.isObject)(data) && (0, exports.isBoolean)(data.success);
@@ -92,7 +145,8 @@ const isErrorResponse = (data) => {
92
145
  };
93
146
  exports.isErrorResponse = isErrorResponse;
94
147
  /**
95
- * Date validation
148
+ * Check if a value is a string that parses to a valid date.
149
+ * @since 1.0.0
96
150
  */
97
151
  const isValidDate = (value) => {
98
152
  if (!(0, exports.isString)(value))
@@ -102,7 +156,8 @@ const isValidDate = (value) => {
102
156
  };
103
157
  exports.isValidDate = isValidDate;
104
158
  /**
105
- * Email validation (basic)
159
+ * Basic email format validation.
160
+ * @since 1.0.0
106
161
  */
107
162
  const isEmail = (value) => {
108
163
  if (!(0, exports.isString)(value))
@@ -112,7 +167,8 @@ const isEmail = (value) => {
112
167
  };
113
168
  exports.isEmail = isEmail;
114
169
  /**
115
- * URL validation (basic)
170
+ * Basic URL validation using the `URL` constructor.
171
+ * @since 1.0.0
116
172
  */
117
173
  const isUrl = (value) => {
118
174
  if (!(0, exports.isString)(value))
@@ -127,7 +183,21 @@ const isUrl = (value) => {
127
183
  };
128
184
  exports.isUrl = isUrl;
129
185
  /**
130
- * Creates a type assertion function that throws on invalid data
186
+ * Creates a type assertion function that throws `TypeError` on
187
+ * invalid data. Use with `createValidator` for the non-throwing variant.
188
+ *
189
+ * @template T - The asserted type
190
+ * @param validator - Type guard function
191
+ * @param typeName - Name used in error messages
192
+ * @returns An assertion function
193
+ * @since 1.0.0
194
+ *
195
+ * @example
196
+ * ```typescript
197
+ * const assertString = createAssertion(isString, 'string');
198
+ * assertString('hello'); // passes
199
+ * assertString(42); // throws TypeError
200
+ * ```
131
201
  */
132
202
  const createAssertion = (validator, typeName) => {
133
203
  return (data, context = typeName) => {
@@ -138,7 +208,20 @@ const createAssertion = (validator, typeName) => {
138
208
  };
139
209
  exports.createAssertion = createAssertion;
140
210
  /**
141
- * Safe JSON parsing with validation
211
+ * Safely parse a JSON string, optionally validating the result.
212
+ * Returns a {@link ValidationResult} instead of throwing.
213
+ *
214
+ * @template T - Expected parsed type
215
+ * @param jsonString - JSON string to parse
216
+ * @param validator - Optional type guard to validate the parsed result
217
+ * @returns Validation result with parsed data or error
218
+ * @since 1.0.0
219
+ *
220
+ * @example
221
+ * ```typescript
222
+ * const result = parseJson('{"name":"Alice"}');
223
+ * if (result.isValid) console.log(result.data);
224
+ * ```
142
225
  */
143
226
  const parseJson = (jsonString, validator) => {
144
227
  try {
@@ -7,32 +7,85 @@
7
7
  import type { ValidationResult, Optional } from '../../types/common';
8
8
  export type { ValidationResult };
9
9
  /**
10
- * Creates a validation function that safely checks if a value matches expected type
10
+ * Creates a validation function that safely checks if a value matches
11
+ * the expected type. Returns a {@link ValidationResult}.
12
+ *
13
+ * @template T - The validated type
14
+ * @param validationFn - Type guard function
15
+ * @param typeName - Name used in error messages
16
+ * @returns A function returning `ValidationResult<T>`
17
+ * @since 1.0.0
18
+ *
19
+ * @example
20
+ * ```typescript
21
+ * const validateString = createValidator(isString, 'string');
22
+ * validateString('hi'); // { isValid: true, data: 'hi' }
23
+ * validateString(42); // { isValid: false, error: 'Invalid string' }
24
+ * ```
11
25
  */
12
26
  export declare const createValidator: <T>(validationFn: (data: unknown) => data is T, typeName: string) => (data: unknown) => ValidationResult<T>;
13
27
  /**
14
- * Basic type validators
28
+ * Runtime type guard: checks if value is a `string`.
29
+ * @since 1.0.0
15
30
  */
16
31
  export declare const isString: (value: unknown) => value is string;
32
+ /**
33
+ * Runtime type guard: checks if value is a finite `number` (excludes NaN).
34
+ * @since 1.0.0
35
+ */
17
36
  export declare const isNumber: (value: unknown) => value is number;
37
+ /**
38
+ * Runtime type guard: checks if value is a `boolean`.
39
+ * @since 1.0.0
40
+ */
18
41
  export declare const isBoolean: (value: unknown) => value is boolean;
42
+ /**
43
+ * Runtime type guard: checks if value is a non-null, non-array object.
44
+ * @since 1.0.0
45
+ */
19
46
  export declare const isObject: (value: unknown) => value is Record<string, unknown>;
47
+ /**
48
+ * Runtime type guard: checks if value is an array.
49
+ * @since 1.0.0
50
+ */
20
51
  export declare const isArray: (value: unknown) => value is unknown[];
52
+ /**
53
+ * Runtime type guard: checks if value is `null` or `undefined`.
54
+ * @since 1.0.0
55
+ */
21
56
  export declare const isNullish: (value: unknown) => value is null | undefined;
22
57
  /**
23
- * Validates that an object has required properties
58
+ * Validates that an object has all required properties present.
59
+ *
60
+ * @template T - Expected object shape
61
+ * @param obj - Value to check
62
+ * @param requiredProps - Array of required property keys
63
+ * @returns True if obj has all required properties
64
+ * @since 1.0.0
24
65
  */
25
66
  export declare const hasRequiredProperties: <T extends Record<string, unknown>>(obj: unknown, requiredProps: (keyof T)[]) => obj is T;
26
67
  /**
27
- * Validates array of objects with a validator function
68
+ * Validates that a value is an array where every item passes a validator.
69
+ *
70
+ * @template T - Expected item type
71
+ * @param data - Value to check
72
+ * @param itemValidator - Type guard for individual items
73
+ * @returns True if data is an array of T
74
+ * @since 1.0.0
28
75
  */
29
76
  export declare const validateArray: <T>(data: unknown, itemValidator: (item: unknown) => item is T) => data is T[];
30
77
  /**
31
- * Creates optional property validator
78
+ * Wraps a validator to also accept `undefined`.
79
+ *
80
+ * @template T - The validated type
81
+ * @param validator - Base type guard
82
+ * @returns Type guard that also accepts `undefined`
83
+ * @since 1.0.0
32
84
  */
33
85
  export declare const optional: <T>(validator: (value: unknown) => value is T) => (value: unknown) => value is T | undefined;
34
86
  /**
35
- * Common pattern validators for API responses
87
+ * Check if data looks like an API response (has `success` boolean).
88
+ * @since 1.0.0
36
89
  */
37
90
  export declare const isApiResponse: (data: unknown) => data is {
38
91
  success: boolean;
@@ -46,23 +99,53 @@ export declare const isErrorResponse: (data: unknown) => data is {
46
99
  error: string;
47
100
  };
48
101
  /**
49
- * Date validation
102
+ * Check if a value is a string that parses to a valid date.
103
+ * @since 1.0.0
50
104
  */
51
105
  export declare const isValidDate: (value: unknown) => value is string;
52
106
  /**
53
- * Email validation (basic)
107
+ * Basic email format validation.
108
+ * @since 1.0.0
54
109
  */
55
110
  export declare const isEmail: (value: unknown) => value is string;
56
111
  /**
57
- * URL validation (basic)
112
+ * Basic URL validation using the `URL` constructor.
113
+ * @since 1.0.0
58
114
  */
59
115
  export declare const isUrl: (value: unknown) => value is string;
60
116
  /**
61
- * Creates a type assertion function that throws on invalid data
117
+ * Creates a type assertion function that throws `TypeError` on
118
+ * invalid data. Use with `createValidator` for the non-throwing variant.
119
+ *
120
+ * @template T - The asserted type
121
+ * @param validator - Type guard function
122
+ * @param typeName - Name used in error messages
123
+ * @returns An assertion function
124
+ * @since 1.0.0
125
+ *
126
+ * @example
127
+ * ```typescript
128
+ * const assertString = createAssertion(isString, 'string');
129
+ * assertString('hello'); // passes
130
+ * assertString(42); // throws TypeError
131
+ * ```
62
132
  */
63
133
  export declare const createAssertion: <T>(validator: (data: unknown) => data is T, typeName: string) => (data: unknown, context?: string) => asserts data is T;
64
134
  /**
65
- * Safe JSON parsing with validation
135
+ * Safely parse a JSON string, optionally validating the result.
136
+ * Returns a {@link ValidationResult} instead of throwing.
137
+ *
138
+ * @template T - Expected parsed type
139
+ * @param jsonString - JSON string to parse
140
+ * @param validator - Optional type guard to validate the parsed result
141
+ * @returns Validation result with parsed data or error
142
+ * @since 1.0.0
143
+ *
144
+ * @example
145
+ * ```typescript
146
+ * const result = parseJson('{"name":"Alice"}');
147
+ * if (result.isValid) console.log(result.data);
148
+ * ```
66
149
  */
67
150
  export declare const parseJson: <T>(jsonString: string, validator?: Optional<(data: unknown) => data is T>) => ValidationResult<T>;
68
151
  //# sourceMappingURL=type-validation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"type-validation.d.ts","sourceRoot":"","sources":["../../../src/utils/validation/type-validation.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAGrE,YAAY,EAAE,gBAAgB,EAAE,CAAC;AAEjC;;GAEG;AACH,eAAO,MAAM,eAAe,GAAI,CAAC,EAC/B,cAAc,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,IAAI,CAAC,EAC1C,UAAU,MAAM,MAER,MAAM,OAAO,KAAG,gBAAgB,CAAC,CAAC,CAc3C,CAAC;AAEF;;GAEG;AACH,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