nhb-toolbox 4.26.70 → 4.26.73

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,14 @@ All notable changes to the package will be documented here.
6
6
 
7
7
  ---
8
8
 
9
+ ## [4.26.73] - 2025-11-22
10
+
11
+ - **Added** the **missing** *closing parenthesis* in `INDIA_VEDIC_SEASONS` *constant* within the `seasons` module.
12
+
13
+ ## [4.26.71] - 2025-11-21
14
+
15
+ - **Fixed** type issues regarding *array inputs* for `sanitizeData` by swapping the *overload signatures*.
16
+
9
17
  ## [4.26.70] - 2025-11-21
10
18
 
11
19
  - **Added** new `formatDate` utility with alias `formatDateTime` and *core date formatter (private)* to be shared with both `Chronos` class and `formatDate` utility.
@@ -62,7 +62,7 @@ exports.INDIA_VEDIC_SEASONS = /* @__PURE__ */ Object.freeze([
62
62
  boundary: { startDate: '08-15', endDate: '10-14' },
63
63
  },
64
64
  {
65
- name: 'Hemant (Late-Autumn',
65
+ name: 'Hemant (Late-Autumn)',
66
66
  boundary: { startDate: '10-15', endDate: '12-14' },
67
67
  },
68
68
  ]);
@@ -60,7 +60,7 @@ export type TimeZoneDetails = {
60
60
  };
61
61
  /** Options for `formatDate` utility */
62
62
  export interface DateFormatOptions extends FormatOptions {
63
- /** Date to format, must be parsable by {@link Date} constructor. Can be string, number or `Date`. Defaults to current time. */
63
+ /** - Date to format, must be parsable by {@link Date} constructor. Can be string, number or `Date`. Defaults to current time. */
64
64
  date?: string | number | Date;
65
65
  format?: StrictFormat;
66
66
  }
@@ -265,12 +265,12 @@ export interface FormatOptions {
265
265
  /**
266
266
  * * The desired format (Default format is `'dd, mmm DD, YYYY HH:mm:ss'` = `'Sun, Apr 06, 2025 16:11:55'`).
267
267
  *
268
- * - To output raw text (i.e., not interpreted as a date token), wrap it in square brackets.
269
- * - For example, `[Today is] ddd` results in `Today is Sunday`, and `YYYY[ year]` results in `2025 year`.
268
+ * - To output raw text (i.e., not interpreted as a date token), wrap it in square brackets.
269
+ * - For example, `[Today is] ddd` results in `Today is Sunday`, and `YYYY[ year]` results in `2025 year`.
270
270
  *
271
- * - Supported format tokens include: `YYYY`, `YY`, `mmmm`, `mmm`, `MM`, `M`, `DD`, `D`, `dd`, `ddd`, `Do`, `HH`, `H`, `hh`, `h`, `mm`, `m`, `ss`, `s`, `ms`, `mss`, `a`, `A`, and `ZZ`.
272
- * - *Any token not wrapped in brackets will be parsed and replaced with its corresponding date component.*
273
- * - Please refer to {@link https://toolbox.nazmul-nhb.dev/docs/classes/Chronos/format#format-tokens format tokens} for details.
271
+ * - Supported format tokens include: `YYYY`, `YY`, `mmmm`, `mmm`, `MM`, `M`, `DD`, `D`, `dd`, `ddd`, `Do`, `HH`, `H`, `hh`, `h`, `mm`, `m`, `ss`, `s`, `ms`, `mss`, `a`, `A`, and `ZZ`.
272
+ * - *Any token not wrapped in brackets will be parsed and replaced with its corresponding date component.*
273
+ * - Please refer to {@link https://toolbox.nazmul-nhb.dev/docs/classes/Chronos/format#format-tokens format tokens} for details.
274
274
  */
275
275
  format?: string;
276
276
  /** - Whether to use UTC time. Defaults to `false`. */
@@ -14,16 +14,6 @@ export declare function sanitizeData(input: string): string;
14
14
  * @returns Sanitized array of strings.
15
15
  */
16
16
  export declare function sanitizeData(input: string[]): string[];
17
- /**
18
- * * Sanitizes an object by ignoring specified keys and trimming string values based on options provided.
19
- * * Also excludes nullish values (`null`, `undefined`), falsy (`nullish` + `0` & `""`) or empty values (`object`, `array`) if specified.
20
- *
21
- * @param object - The object to sanitize.
22
- * @param options - Options that define which keys to ignore, whether to trim string values, and whether to exclude nullish, falsy or empty values.
23
- * @param _return - By default return type is as it is, passing this parameter `true` makes the return type `Partial<T>`.
24
- * @returns A new object with the specified modifications.
25
- */
26
- export declare function sanitizeData<Data extends GenericObject, Ignored extends DotNotationKey<Data> = never, PoR extends PartialOrRequired = 'required'>(object: Data, options?: SanitizeOptions<Data, Ignored>, _return?: PoR): SanitizedData<Data, Ignored, PoR>;
27
17
  /**
28
18
  * * Sanitizes a deeply nested array that may contain arrays, objects or other (mixed) data types.
29
19
  * * Preserves structure while removing empty values and trimming strings and other operations.
@@ -34,6 +24,16 @@ export declare function sanitizeData<Data extends GenericObject, Ignored extends
34
24
  * @returns A new sanitized array with the specified modifications.
35
25
  */
36
26
  export declare function sanitizeData<Data extends GenericObject, Ignored extends DotNotationKey<Data> = never, PoR extends PartialOrRequired = 'required'>(array: Data[], options?: SanitizeOptions<Data, Ignored>, _return?: PoR): Array<SanitizedData<Data, Ignored, PoR>>;
27
+ /**
28
+ * * Sanitizes an object by ignoring specified keys and trimming string values based on options provided.
29
+ * * Also excludes nullish values (`null`, `undefined`), falsy (`nullish` + `0` & `""`) or empty values (`object`, `array`) if specified.
30
+ *
31
+ * @param object - The object to sanitize.
32
+ * @param options - Options that define which keys to ignore, whether to trim string values, and whether to exclude nullish, falsy or empty values.
33
+ * @param _return - By default return type is as it is, passing this parameter `true` makes the return type `Partial<T>`.
34
+ * @returns A new object with the specified modifications.
35
+ */
36
+ export declare function sanitizeData<Data extends GenericObject, Ignored extends DotNotationKey<Data> = never, PoR extends PartialOrRequired = 'required'>(object: Data, options?: SanitizeOptions<Data, Ignored>, _return?: PoR): SanitizedData<Data, Ignored, PoR>;
37
37
  /**
38
38
  * * Parse an object of stringified values into their appropriate primitive types.
39
39
  *
@@ -59,7 +59,7 @@ export const INDIA_VEDIC_SEASONS = /* @__PURE__ */ Object.freeze([
59
59
  boundary: { startDate: '08-15', endDate: '10-14' },
60
60
  },
61
61
  {
62
- name: 'Hemant (Late-Autumn',
62
+ name: 'Hemant (Late-Autumn)',
63
63
  boundary: { startDate: '10-15', endDate: '12-14' },
64
64
  },
65
65
  ]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nhb-toolbox",
3
- "version": "4.26.70",
3
+ "version": "4.26.73",
4
4
  "description": "A versatile collection of smart, efficient, and reusable utility functions, classes and types for everyday development needs.",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",