nhb-toolbox 4.14.11 → 4.14.12

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/CHANGELOG.md CHANGED
@@ -6,6 +6,10 @@ All notable changes to the package will be documented here.
6
6
 
7
7
  ---
8
8
 
9
+ ## [4.14.12] - 2025-08-17
10
+
11
+ - **Updated** _error type_ for `trimString` utility.
12
+
9
13
  ## [4.14.10] - 2025-08-17
10
14
 
11
15
  - **Added** new utility `wordsToNumber` utility with alias: `convertWordsToNumber`, `convertWordToNumber` and `wordToNumber`
@@ -106,5 +106,7 @@ function trimString(input) {
106
106
  if (Array.isArray(input)) {
107
107
  return input?.map((str) => typeof str === 'string' ? str?.trim()?.replace(/\s+/g, ' ') : str);
108
108
  }
109
- throw new Error('Invalid input type. Expected string or array of strings!');
109
+ throw new TypeError('Expected string or array of strings!', {
110
+ cause: 'Invalid Input Type',
111
+ });
110
112
  }
@@ -99,5 +99,7 @@ export function trimString(input) {
99
99
  if (Array.isArray(input)) {
100
100
  return input?.map((str) => typeof str === 'string' ? str?.trim()?.replace(/\s+/g, ' ') : str);
101
101
  }
102
- throw new Error('Invalid input type. Expected string or array of strings!');
102
+ throw new TypeError('Expected string or array of strings!', {
103
+ cause: 'Invalid Input Type',
104
+ });
103
105
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nhb-toolbox",
3
- "version": "4.14.11",
3
+ "version": "4.14.12",
4
4
  "description": "A versatile collection of smart, efficient, and reusable utility functions and classes for everyday development needs.",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",