nhb-toolbox 4.27.0 → 4.27.10

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.27.10] - 2025-11-28
10
+
11
+ - **Updated** type augmentation for `String` methods: `toLowerCase` and `toUpperCase` (type level only, implementation remains intact).
12
+
13
+ ## [4.27.1] - 2025-11-28
14
+
15
+ - **Updated** default *type parameter* for `generateRandomColor` by replacing `undefined` with `'hex'`.
16
+
9
17
  ## [4.27.0] - 2025-11-28
10
18
 
11
19
  ### New
@@ -19,6 +27,7 @@ All notable changes to the package will be documented here.
19
27
  ### Updates
20
28
 
21
29
  - **Updated** `convertStringCase` utility to accept new format: `'Sentence case'`.
30
+ - **Updated** `generateAnagram` utility to accept an *optional dictionary array* for generating **valid anagrams**.
22
31
  - **Updated** `isUUID` to verify versions 1-8 (not just `v4`). It now *narrows down* the value to **branded type** `UUID<UUIDVersion>`.
23
32
 
24
33
  ## [4.26.74] - 2025-11-23
@@ -40,4 +40,4 @@ export declare const generateRandomColorInHexRGB: (maxColors?: number) => Random
40
40
  * const hsl = generateRandomColor({ colorType: 'hsl', maxColors: 32 });
41
41
  * // hsl value with inferred type: HSL, with a larger unique color memory pool
42
42
  */
43
- export declare function generateRandomColor<C extends $ColorType | undefined = undefined>(options?: RandomColorOptions<C>): RandomColor<C>;
43
+ export declare function generateRandomColor<C extends $ColorType = 'hex'>(options?: RandomColorOptions<C>): RandomColor<C>;
@@ -58,9 +58,9 @@ export type RandomHexRGB = {
58
58
  /** Basic color type: `hex`, `rgb` or `hsl`. */
59
59
  export type $ColorType = 'hex' | 'rgb' | 'hsl';
60
60
  /** Options for random color generation. */
61
- export interface RandomColorOptions<C extends $ColorType | undefined> {
61
+ export interface RandomColorOptions<C extends $ColorType> {
62
62
  /** The type of expected return type of color: `hex`, `rgb` or `hsl`. Default is `'hex'`. */
63
- colorType?: C;
63
+ colorType?: C | $ColorType;
64
64
  /** The maximum number of recent colors to store in memory. Default is `16`. */
65
65
  maxColors?: number;
66
66
  }
@@ -1,11 +1,12 @@
1
1
  import type { $Countries } from '../object/types';
2
2
  import type { Join, LooseLiteral, Split } from '../utils/types';
3
3
  import type { LOWERCASE } from './constants';
4
- /** Set proper type interface for `String` methods */
5
4
  declare global {
6
5
  interface String {
7
- toLowerCase<C extends 'T' | '' = ''>(): C extends 'T' ? Lowercase<string> : string;
8
- toUpperCase<C extends 'T' | '' = ''>(): C extends 'T' ? Uppercase<string> : string;
6
+ toLowerCase(): string;
7
+ toLowerCase<C extends 'T'>(): C extends 'T' ? Lowercase<string> : string;
8
+ toUpperCase(): string;
9
+ toUpperCase<C extends 'T'>(): C extends 'T' ? Uppercase<string> : string;
9
10
  }
10
11
  }
11
12
  /** - Options for generating anagrams. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nhb-toolbox",
3
- "version": "4.27.0",
3
+ "version": "4.27.10",
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",