nhb-toolbox 4.11.4 → 4.11.6

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/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { C as CapitalizeOptions, R as RandomIdOptions, a as CaseFormat, M as MaskOptions, N as Numeric, P as Percent, b as ColorInputArray, H as Hex6, c as RGB, d as HSL, e as Hex8, f as RGBA, g as HSLA, h as Hex, A as AlphaValues, S as SolidValues, G as GenericObject, F as Flattened, O as OwnKeys, i as FindOptions, j as SortByOption, k as OrderOption, l as OptionsConfig, m as FieldValue, n as SortNature, o as FormDataConfigs, p as ParsedFormData, q as SerializedForm, r as CustomFile, s as FileUpload, t as OriginFileObj, u as FlattenPartial, v as Any, w as PartialOrRequired, x as SanitizeOptions, D as DotNotationKey, y as Stringified, z as Numberified, Q as QueryObject, B as QueryString, E as StrictObject, I as Constructor, V as VoidFunction, J as DelayedFn, K as ClassDetails, T as ThrottledFn, L as PaginatorOptions, U as PaginatorMeta, W as PageListOptions, X as FromMetaOptions, Y as FalsyPrimitive, Z as NormalPrimitive, _ as Primitive, $ as AsyncFunction, a0 as GenericFn } from './types-uginMOiI.mjs';
2
- export { a1 as Color, a1 as Colour } from './types-uginMOiI.mjs';
1
+ import { C as CapitalizeOptions, R as RandomIdOptions, a as CaseFormat, M as MaskOptions, N as Numeric, P as Percent, b as ColorInputArray, H as Hex6, c as RGB, d as HSL, e as Hex8, f as RGBA, g as HSLA, h as Hex, A as AlphaValues, S as SolidValues, G as GenericObject, F as Flattened, O as OwnKeys, i as FindOptions, j as SortByOption, k as OrderOption, l as OptionsConfig, m as FieldValue, n as SortNature, o as FormDataConfigs, p as ParsedFormData, q as SerializedForm, r as CustomFile, s as FileUpload, t as OriginFileObj, u as FlattenPartial, v as Any, w as PartialOrRequired, x as SanitizeOptions, D as DotNotationKey, y as Stringified, z as Numberified, Q as QueryObject, B as QueryString, E as StrictObject, I as Constructor, V as VoidFunction, J as DelayedFn, K as ClassDetails, T as ThrottledFn, L as PaginatorOptions, U as PaginatorMeta, W as PageListOptions, X as FromMetaOptions, Y as FalsyPrimitive, Z as NormalPrimitive, _ as Primitive, $ as AsyncFunction, a0 as GenericFn } from './typedefs-BYmqOW77.mjs';
2
+ export { a1 as Color, a1 as Colour } from './typedefs-BYmqOW77.mjs';
3
3
  import { D as DecimalOptions, b as ConvertedDecimal, R as RandomNumberOptions, c as CurrencyCode, L as LocaleCode, S as SupportedCurrency, d as ConvertOptions, P as PercentageOptions, N as NumberType, e as RangeOptions, f as RangedNumbers, G as GreetingConfigs, T as Time, U as UTCOffSet } from './Chronos-v7ni8eaQ.mjs';
4
4
  export { g as Unit, g as UnitConverter } from './Chronos-v7ni8eaQ.mjs';
5
5
 
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { C as CapitalizeOptions, R as RandomIdOptions, a as CaseFormat, M as MaskOptions, N as Numeric, P as Percent, b as ColorInputArray, H as Hex6, c as RGB, d as HSL, e as Hex8, f as RGBA, g as HSLA, h as Hex, A as AlphaValues, S as SolidValues, G as GenericObject, F as Flattened, O as OwnKeys, i as FindOptions, j as SortByOption, k as OrderOption, l as OptionsConfig, m as FieldValue, n as SortNature, o as FormDataConfigs, p as ParsedFormData, q as SerializedForm, r as CustomFile, s as FileUpload, t as OriginFileObj, u as FlattenPartial, v as Any, w as PartialOrRequired, x as SanitizeOptions, D as DotNotationKey, y as Stringified, z as Numberified, Q as QueryObject, B as QueryString, E as StrictObject, I as Constructor, V as VoidFunction, J as DelayedFn, K as ClassDetails, T as ThrottledFn, L as PaginatorOptions, U as PaginatorMeta, W as PageListOptions, X as FromMetaOptions, Y as FalsyPrimitive, Z as NormalPrimitive, _ as Primitive, $ as AsyncFunction, a0 as GenericFn } from './types-C33n5Qt0.js';
2
- export { a1 as Color, a1 as Colour } from './types-C33n5Qt0.js';
1
+ import { C as CapitalizeOptions, R as RandomIdOptions, a as CaseFormat, M as MaskOptions, N as Numeric, P as Percent, b as ColorInputArray, H as Hex6, c as RGB, d as HSL, e as Hex8, f as RGBA, g as HSLA, h as Hex, A as AlphaValues, S as SolidValues, G as GenericObject, F as Flattened, O as OwnKeys, i as FindOptions, j as SortByOption, k as OrderOption, l as OptionsConfig, m as FieldValue, n as SortNature, o as FormDataConfigs, p as ParsedFormData, q as SerializedForm, r as CustomFile, s as FileUpload, t as OriginFileObj, u as FlattenPartial, v as Any, w as PartialOrRequired, x as SanitizeOptions, D as DotNotationKey, y as Stringified, z as Numberified, Q as QueryObject, B as QueryString, E as StrictObject, I as Constructor, V as VoidFunction, J as DelayedFn, K as ClassDetails, T as ThrottledFn, L as PaginatorOptions, U as PaginatorMeta, W as PageListOptions, X as FromMetaOptions, Y as FalsyPrimitive, Z as NormalPrimitive, _ as Primitive, $ as AsyncFunction, a0 as GenericFn } from './typedefs-C3luCa9l.js';
2
+ export { a1 as Color, a1 as Colour } from './typedefs-C3luCa9l.js';
3
3
  import { D as DecimalOptions, b as ConvertedDecimal, R as RandomNumberOptions, c as CurrencyCode, L as LocaleCode, S as SupportedCurrency, d as ConvertOptions, P as PercentageOptions, N as NumberType, e as RangeOptions, f as RangedNumbers, G as GreetingConfigs, T as Time, U as UTCOffSet } from './Chronos-v7ni8eaQ.js';
4
4
  export { g as Unit, g as UnitConverter } from './Chronos-v7ni8eaQ.js';
5
5
 
@@ -45,191 +45,76 @@ interface MaskOptions {
45
45
  /** Formatted query string as `?${string}` = `?key=value&...` or empty string. */
46
46
  type QueryString = `?${string}` | '';
47
47
 
48
- /** - Generic object with `unknown` value */
49
- type StrictObject = Record<string, unknown>;
50
- /** - Generic object but with `any` value */
51
- type GenericObject = Record<string, any>;
52
- /**
53
- * * Represents a value that can be used in a query object.
54
- * - Can be a primitive, an array of primitives, or a nested query object.
55
- */
56
- type QueryObjectValue = NormalPrimitive | NormalPrimitive[] | QueryObject;
57
- /**
58
- * * Represents a query object with string keys and `QueryObjectValue` values.
59
- * - Supports nested objects and arrays.
60
- */
61
- type QueryObject = {
62
- [key: string]: QueryObjectValue;
63
- };
64
- /** - Object type with string or number or boolean as value for each key. */
65
- type GenericObjectPrimitive = Record<string, string | number | boolean>;
66
- /** - Dot-notation keys for nested objects with unknown value (including optional properties) */
67
- type DotNotationKeyStrict<T> = T extends AdvancedTypes ? never : T extends StrictObject ? HasMethods<T> extends true ? never : {
68
- [K in keyof T & string]: NonNullable<T[K]> extends (StrictObject) ? `${K}` | `${K}.${DotNotationKey<NonNullable<T[K]>>}` : `${K}`;
69
- }[keyof T & string] : never;
70
- /** - Dot-notation keys for nested objects with `any` value (including optional properties) */
71
- type DotNotationKey<T> = T extends AdvancedTypes ? never : T extends GenericObject ? HasMethods<T> extends true ? never : {
72
- [K in keyof T & string]: NonNullable<T[K]> extends (GenericObject) ? `${K}` | `${K}.${DotNotationKey<NonNullable<T[K]>>}` : `${K}`;
73
- }[keyof T & string] : never;
74
- /** - Object keys where the value is an array (including optional properties) */
75
- type KeyForArray<T> = T extends GenericObject ? HasMethods<T> extends true ? never : {
76
- [K in keyof T & string]: NonNullable<T[K]> extends (Array<unknown>) ? K : never;
77
- }[keyof T & string] : never;
78
- /** - Object keys where the value is a non-array/non-advanced type object (including optional properties) */
79
- type KeyForObject<T> = T extends AdvancedTypes ? never : T extends GenericObject ? HasMethods<T> extends true ? never : {
80
- [K in keyof T & string]: NonNullable<T[K]> extends (GenericObject) ? NonNullable<T[K]> extends AdvancedTypes ? never : K : never;
81
- }[keyof T & string] : never;
82
- /** - Extract only keys with string values from an object, including nested dot-notation keys. */
83
- type NestedKeyString<T> = T extends AdvancedTypes ? never : T extends GenericObject ? HasMethods<T> extends true ? never : {
84
- [K in keyof T & string]: NonNullable<T[K]> extends string ? K : NonNullable<T[K]> extends GenericObject ? `${K}.${NestedKeyString<NonNullable<T[K]>>}` : never;
85
- }[keyof T & string] : never;
86
- /** - Extract only primitive keys from an object, including nested dot-notation keys. */
87
- type NestedPrimitiveKey<T> = T extends AdvancedTypes ? never : T extends GenericObject ? HasMethods<T> extends true ? never : {
88
- [K in keyof T & string]: NonNullable<T[K]> extends (NormalPrimitive) ? K : NonNullable<T[K]> extends GenericObject ? `${K}.${NestedPrimitiveKey<NonNullable<T[K]>>}` : never;
89
- }[keyof T & string] : never;
90
- /** - Options for `sanitizeData` utility. */
91
- interface SanitizeOptions<T> {
92
- /**
93
- * An array of dot-notation keys to exclude from the sanitized output.
94
- * This is only applicable when sanitizing plain objects or arrays of objects.
95
- * When applied to nested or irregular array structures, behavior may be inconsistent or partially ignored.
96
- */
97
- keysToIgnore?: DotNotationKey<T>[];
98
- /** Whether to trim string values. Defaults to `true`. */
99
- trimStrings?: boolean;
100
- /** Whether to exclude nullish (`null` or `undefined`) values. Defaults to `false`. */
101
- ignoreNullish?: boolean;
102
- /** Whether to exclude all falsy values (`false`, `0`, `empty string: ''`, `null`, `undefined`. Defaults to `false`. */
103
- ignoreFalsy?: boolean;
104
- /** Whether to exclude empty object(s) and array(s) (`{}`, `[]`). Defaults to `false`. */
105
- ignoreEmpty?: boolean;
106
- /**
107
- * An array of dot-notation key paths that must be preserved in the sanitized output.
108
- * Use `"*"` to retain all keys. This applies primarily to plain or nested objects and arrays of objects.
109
- * When applied to nested or irregular array structures, behavior may be inconsistent or partially ignored.
110
- */
111
- requiredKeys?: '*' | DotNotationKey<T>[];
112
- }
113
- /** - Type of data value converted to `string` */
114
- type Stringified<T> = {
115
- [K in keyof T]: T[K] extends (infer U)[] ? Stringified<U>[] : T[K] extends object | null | undefined ? Stringified<T[K]> : T[K] extends string | number ? string : T[K];
116
- };
117
- /** - Type of data value converted to `number` */
118
- type Numberified<T> = {
119
- [K in keyof T]: T[K] extends (infer U)[] ? Numberified<U>[] : T[K] extends object | null | undefined ? Numberified<T[K]> : T[K] extends string ? number : T[K] extends number ? T[K] : number;
48
+ /** Uncontrolled any to use for edge cases */
49
+ type Any = any;
50
+ declare const __brand: unique symbol;
51
+ type Brand<B> = {
52
+ [__brand]: B;
120
53
  };
121
-
122
- /** * Flatten Array or Wrap in Array */
123
- type Flattened<T> = T extends (infer U)[] ? Flattened<U> : T;
54
+ /** Create a branded type. */
55
+ type Branded<T, B> = T & Brand<B>;
56
+ /** Utility type to flatten Partial type */
57
+ type FlattenPartial<T> = Partial<{
58
+ [K in keyof T]: T[K];
59
+ }>;
60
+ /** Union of `number` and numeric string */
61
+ type Numeric = number | `${number}`;
62
+ /** Union of All Primitive Types (i.e. `string | number | boolean | symbol | bigint | null | undefined`) */
63
+ type Primitive = string | number | boolean | symbol | bigint | null | undefined;
64
+ /** Union of Normal Primitive Types (i.e. `string | number | boolean | null | undefined`) */
65
+ type NormalPrimitive = string | number | boolean | null | undefined;
66
+ /** Extract normal primitive key(s) (i.e. `string | number | boolean | null | undefined`) from an object */
67
+ type NormalPrimitiveKey<T> = {
68
+ [K in keyof T]: T[K] extends NormalPrimitive ? K : never;
69
+ }[keyof T];
124
70
  /**
125
- * * Configuration for `createOptionsArray`.
126
- * - Defines the mapping between keys in the input objects and the keys in the output options.
127
- *
128
- * @typeParam T - The type of the objects in the input array.
129
- * @typeParam K1 - The name of the key for the first field in the output (default: `'value'`).
130
- * @typeParam K2 - The name of the key for the second field in the output (default: `'label'`).
131
- * @typeParam V - Whether to keep the `value` field as number if it is a number. Defaults to `false`.
71
+ * * Keys of an object that are part of the object type itself.
72
+ * This excludes keys that are inherited from the prototype chain.
73
+ * This type is useful for extracting keys that are part of the object's own properties.
74
+ * It is used in the `OwnKeys` type to filter out keys that are not part of the object properties.
132
75
  */
133
- interface OptionsConfig<T, K1, K2, V extends boolean = false> {
134
- /**
135
- * - The key in the input objects to use for the first field of the option. Only primitive values (`string | number | boolean | null | undefined`) are accepted.
136
- * @example
137
- * // If the input objects have an `id` field and you want to use it as the `value` field in the output:
138
- * createOptionsArray(data, {firstFieldKey: 'id'}).
139
- */
140
- firstFieldKey: NormalPrimitiveKey<T>;
141
- /**
142
- * - The key in the input objects to use for the second field of the option. Only primitive values (`string | number | boolean | null | undefined`) are accepted.
143
- * @example
144
- * // If the input objects have a `name` field and you want to use it as the `label` field in the output:
145
- * createOptionsArray(data, {firstFieldKey: 'id', secondFieldKey: 'name'}).
146
- */
147
- secondFieldKey: NormalPrimitiveKey<T>;
148
- /**
149
- * - The name of the first field in the output object.
150
- * - Defaults to `'value'`.
151
- * @example
152
- * // If you want the output field to be named `'key'` instead of `'value'`:
153
- * createOptionsArray(data, {firstFieldKey: 'id', secondFieldKey: 'name', firstFieldName: 'key'}).
154
- */
155
- firstFieldName?: K1;
156
- /**
157
- * - The name of the second field in the output object.
158
- * - Defaults to `'label'`.
159
- * @example
160
- * // If you want the output field to be named `'title'` instead of `'label'`:
161
- * createOptionsArray(data, {firstFieldKey: 'id', secondFieldKey: 'name', firstFieldName: 'key', secondFieldName: 'title'}).
162
- */
163
- secondFieldName?: K2;
164
- /**
165
- * - If `true`, numeric values from `firstFieldKey` will remain as numbers.
166
- * - All other values (including booleans, null, undefined) will be converted to strings.
167
- * - When `false` (default), all values are converted to strings.
168
- * - Defaults to `false`.
169
- * @example
170
- * // Numeric IDs remain as numbers
171
- * createOptionsArray(data, {
172
- * firstFieldKey: 'id',
173
- * secondFieldKey: 'name',
174
- * retainNumberValue: true
175
- * });
176
- *
177
- * // All values become strings (default behavior)
178
- * createOptionsArray(data, {
179
- * firstFieldKey: 'id',
180
- * secondFieldKey: 'name'
181
- * });
182
- */
183
- retainNumberValue?: V;
184
- }
185
- /** Type for first field key */
186
- type FirstFieldKey<T extends GenericObject, K1 extends string = 'value', K2 extends string = 'label', V extends boolean = false> = T[OptionsConfig<T, K1, K2, V>['firstFieldKey']];
187
- /** Type for firs field value */
188
- type FirstFieldValue<T extends GenericObject, K1 extends string = 'value', K2 extends string = 'label', V extends boolean = false> = V extends true ? FirstFieldKey<T, K1, K2, V> extends (Exclude<FirstFieldKey<T, K1, K2, V>, number>) ? string : number : string;
189
- /** Type of values for the option fields */
190
- type FieldValue<P extends K1 | K2, T extends GenericObject, K1 extends string = 'value', K2 extends string = 'label', V extends boolean = false> = P extends K1 ? FirstFieldValue<T, K1, K2, V> : string;
191
- /** Type of an option in `OptionsArray` */
192
- type Option<T extends GenericObject, K1 extends string = 'value', K2 extends string = 'label', V extends boolean = false> = {
193
- [P in K1 | K2]: FieldValue<P, T, K1, K2, V>;
194
- };
195
- /** * Option for sorting order. */
196
- interface OrderOption {
197
- /**
198
- * * The order in which to sort the array. Defaults to `'asc'`.
199
- * - `'asc'`: Sort in ascending order.
200
- * - `'desc'`: Sort in descending order.
201
- */
202
- sortOrder?: 'asc' | 'desc';
203
- }
204
- /** * Options for setting sortByField for sorting an array of objects. */
205
- interface SortByOption<T extends GenericObject> extends OrderOption {
206
- /** The field by which to sort the objects in the array. */
207
- sortByField: NestedPrimitiveKey<T>;
208
- }
209
- /** * Options for sorting array. */
210
- type SortOptions<T> = T extends GenericObject ? SortByOption<T> : OrderOption;
211
- /** Optional settings to configure comparison behavior. */
212
- interface SortNature {
213
- /** If true, compares string chunks without case sensitivity. Defaults to `true`. */
214
- caseInsensitive?: boolean;
215
- /** If true, uses localeCompare for string chunk comparisons. Defaults to `false`. */
216
- localeAware?: boolean;
217
- }
218
- /** * Options for customizing the search behavior. */
219
- interface FindOptions<T = unknown> {
220
- /** * Enables fuzzy matching when exact match fails. Defaults to `false`. */
221
- fuzzy?: boolean;
222
- /** * Optional key for caching the result. Defaults to `finder-cache` */
223
- cacheKey?: string;
224
- /** * Forces binary search even for small datasets. Defaults to `false`. */
225
- forceBinary?: boolean;
226
- /** * If true, matcher and keys will be normalized to lowercase. Defaults to `true`. */
227
- caseInsensitive?: boolean;
228
- /** * If true, uses built in `Array.sort()`. Defaults to `true`. Pass `false` if data is already sorted. */
229
- needSorting?: boolean;
230
- /** * Optional data source to use instead of constructor items. */
231
- data?: T[] | (() => T[]);
76
+ type OwnKeys<T> = {
77
+ [K in keyof T]: {} extends Pick<T, K> ? never : K;
78
+ }[keyof T];
79
+ /** Extract primitive (string, number or boolean) key(s) from an object */
80
+ type NonNullishPrimitiveKey<T> = {
81
+ [K in keyof T]: T[K] extends string | number | boolean ? K : never;
82
+ }[keyof T];
83
+ /** Falsy primitive type */
84
+ type FalsyPrimitive = false | 0 | '' | null | undefined;
85
+ /** A generic class constructor */
86
+ type Constructor = new (...args: any[]) => unknown;
87
+ /** Generic function type */
88
+ type GenericFn = (...args: unknown[]) => unknown;
89
+ /** Generic function type that returns `void` */
90
+ type VoidFunction = (...args: any[]) => void;
91
+ /** Debounced function type after certain delay */
92
+ type DelayedFn<T extends VoidFunction> = (...args: Parameters<T>) => void;
93
+ /** Throttled function type after specific delay */
94
+ type ThrottledFn<T extends VoidFunction> = (...args: Parameters<T>) => void;
95
+ /** Asynchronous function type */
96
+ type AsyncFunction<T> = (...args: unknown[]) => Promise<T>;
97
+ /** Advanced non-primitive types */
98
+ type AdvancedTypes = Array<unknown> | File | FileList | Blob | Date | RegExp | WeakMap<WeakKey, unknown> | WeakSet<WeakKey> | Map<unknown, unknown> | Set<unknown> | Function | GenericFn | VoidFunction | AsyncFunction<unknown> | Promise<unknown> | Error | EvalError | RangeError | ReferenceError | SyntaxError | TypeError | URIError | bigint | symbol;
99
+ /** Helper to detect if a type has methods */
100
+ type HasMethods<T> = {
101
+ [K in keyof T]: T[K] extends Function ? true : never;
102
+ }[keyof T] extends never ? false : true;
103
+ /** * Represents detailed information about a class's methods. */
104
+ interface ClassDetails {
105
+ /** * List of instance method names defined directly on the class prototype. */
106
+ instanceNames: string[];
107
+ /** * List of static method names defined directly on the class constructor. */
108
+ staticNames: string[];
109
+ /** * Number of instance methods. */
110
+ instances: number;
111
+ /** * Number of static methods. */
112
+ statics: number;
113
+ /** * Total number of instance and static methods combined. */
114
+ total: number;
232
115
  }
116
+ /** Literal type for `partial` and `required` */
117
+ type PartialOrRequired = 'partial' | 'required';
233
118
 
234
119
  /**
235
120
  * * Class representing a color and its conversions among `Hex`, `Hex8` `RGB`, `RGBA`, `HSL` and `HSLA` formats.
@@ -331,7 +216,7 @@ declare class Color {
331
216
  */
332
217
  constructor(color: CSSColor);
333
218
  /** - Iterates over the color representations (Hex, RGB, HSL). */
334
- [Symbol.iterator](): Generator<HSL | Hex6 | Hex8 | RGB | RGBA | HSLA, void, unknown>;
219
+ [Symbol.iterator](): Generator<HSL | RGB | HSLA | RGBA | Hex6 | Hex8, void, unknown>;
335
220
  /**
336
221
  * @instance Applies or modifies the opacity of a color. Mutate the original instance.
337
222
  * - For solid colors (Hex6/RGB/HSL): Adds an alpha channel with the specified opacity.
@@ -768,6 +653,192 @@ type Tetrad = [Color, Color, Color, Color];
768
653
  /** CSS named color, also includes different response colors */
769
654
  type CSSColor = keyof typeof CSS_COLORS;
770
655
 
656
+ /** - Generic object with `unknown` value */
657
+ type StrictObject = Record<string, unknown>;
658
+ /** - Generic object but with `any` value */
659
+ type GenericObject = Record<string, any>;
660
+ /**
661
+ * * Represents a value that can be used in a query object.
662
+ * - Can be a primitive, an array of primitives, or a nested query object.
663
+ */
664
+ type QueryObjectValue = NormalPrimitive | NormalPrimitive[] | QueryObject;
665
+ /**
666
+ * * Represents a query object with string keys and `QueryObjectValue` values.
667
+ * - Supports nested objects and arrays.
668
+ */
669
+ type QueryObject = {
670
+ [key: string]: QueryObjectValue;
671
+ };
672
+ /** - Object type with string or number or boolean as value for each key. */
673
+ type GenericObjectPrimitive = Record<string, string | number | boolean>;
674
+ /** - Dot-notation keys for nested objects with unknown value (including optional properties) */
675
+ type DotNotationKeyStrict<T> = T extends AdvancedTypes ? never : T extends StrictObject ? HasMethods<T> extends true ? never : {
676
+ [K in keyof T & string]: NonNullable<T[K]> extends (StrictObject) ? `${K}` | `${K}.${DotNotationKey<NonNullable<T[K]>>}` : `${K}`;
677
+ }[keyof T & string] : never;
678
+ /** - Dot-notation keys for nested objects with `any` value (including optional properties) */
679
+ type DotNotationKey<T> = T extends AdvancedTypes ? never : T extends GenericObject ? HasMethods<T> extends true ? never : {
680
+ [K in keyof T & string]: NonNullable<T[K]> extends (GenericObject) ? `${K}` | `${K}.${DotNotationKey<NonNullable<T[K]>>}` : `${K}`;
681
+ }[keyof T & string] : never;
682
+ /** - Object keys where the value is an array (including optional properties) */
683
+ type KeyForArray<T> = T extends GenericObject ? HasMethods<T> extends true ? never : {
684
+ [K in keyof T & string]: NonNullable<T[K]> extends (Array<unknown>) ? K : never;
685
+ }[keyof T & string] : never;
686
+ /** - Object keys where the value is a non-array/non-advanced type object (including optional properties) */
687
+ type KeyForObject<T> = T extends AdvancedTypes ? never : T extends GenericObject ? HasMethods<T> extends true ? never : {
688
+ [K in keyof T & string]: NonNullable<T[K]> extends (GenericObject) ? NonNullable<T[K]> extends AdvancedTypes ? never : K : never;
689
+ }[keyof T & string] : never;
690
+ /** - Extract only keys with string values from an object, including nested dot-notation keys. */
691
+ type NestedKeyString<T> = T extends AdvancedTypes ? never : T extends GenericObject ? HasMethods<T> extends true ? never : {
692
+ [K in keyof T & string]: NonNullable<T[K]> extends string ? K : NonNullable<T[K]> extends GenericObject ? `${K}.${NestedKeyString<NonNullable<T[K]>>}` : never;
693
+ }[keyof T & string] : never;
694
+ /** - Extract only primitive keys from an object, including nested dot-notation keys. */
695
+ type NestedPrimitiveKey<T> = T extends AdvancedTypes ? never : T extends GenericObject ? HasMethods<T> extends true ? never : {
696
+ [K in keyof T & string]: NonNullable<T[K]> extends (NormalPrimitive) ? K : NonNullable<T[K]> extends GenericObject ? `${K}.${NestedPrimitiveKey<NonNullable<T[K]>>}` : never;
697
+ }[keyof T & string] : never;
698
+ /** - Options for `sanitizeData` utility. */
699
+ interface SanitizeOptions<T> {
700
+ /**
701
+ * An array of dot-notation keys to exclude from the sanitized output.
702
+ * This is only applicable when sanitizing plain objects or arrays of objects.
703
+ * When applied to nested or irregular array structures, behavior may be inconsistent or partially ignored.
704
+ */
705
+ keysToIgnore?: DotNotationKey<T>[];
706
+ /** Whether to trim string values. Defaults to `true`. */
707
+ trimStrings?: boolean;
708
+ /** Whether to exclude nullish (`null` or `undefined`) values. Defaults to `false`. */
709
+ ignoreNullish?: boolean;
710
+ /** Whether to exclude all falsy values (`false`, `0`, `empty string: ''`, `null`, `undefined`. Defaults to `false`. */
711
+ ignoreFalsy?: boolean;
712
+ /** Whether to exclude empty object(s) and array(s) (`{}`, `[]`). Defaults to `false`. */
713
+ ignoreEmpty?: boolean;
714
+ /**
715
+ * An array of dot-notation key paths that must be preserved in the sanitized output.
716
+ * Use `"*"` to retain all keys. This applies primarily to plain or nested objects and arrays of objects.
717
+ * When applied to nested or irregular array structures, behavior may be inconsistent or partially ignored.
718
+ */
719
+ requiredKeys?: '*' | DotNotationKey<T>[];
720
+ }
721
+ /** - Type of data value converted to `string` */
722
+ type Stringified<T> = {
723
+ [K in keyof T]: T[K] extends (infer U)[] ? Stringified<U>[] : T[K] extends object | null | undefined ? Stringified<T[K]> : T[K] extends string | number ? string : T[K];
724
+ };
725
+ /** - Type of data value converted to `number` */
726
+ type Numberified<T> = {
727
+ [K in keyof T]: T[K] extends (infer U)[] ? Numberified<U>[] : T[K] extends object | null | undefined ? Numberified<T[K]> : T[K] extends string ? number : T[K] extends number ? T[K] : number;
728
+ };
729
+
730
+ /** * Flatten Array or Wrap in Array */
731
+ type Flattened<T> = T extends (infer U)[] ? Flattened<U> : T;
732
+ /**
733
+ * * Configuration for `createOptionsArray`.
734
+ * - Defines the mapping between keys in the input objects and the keys in the output options.
735
+ *
736
+ * @typeParam T - The type of the objects in the input array.
737
+ * @typeParam K1 - The name of the key for the first field in the output (default: `'value'`).
738
+ * @typeParam K2 - The name of the key for the second field in the output (default: `'label'`).
739
+ * @typeParam V - Whether to keep the `value` field as number if it is a number. Defaults to `false`.
740
+ */
741
+ interface OptionsConfig<T, K1, K2, V extends boolean = false> {
742
+ /**
743
+ * - The key in the input objects to use for the first field of the option. Only primitive values (`string | number | boolean | null | undefined`) are accepted.
744
+ * @example
745
+ * // If the input objects have an `id` field and you want to use it as the `value` field in the output:
746
+ * createOptionsArray(data, {firstFieldKey: 'id'}).
747
+ */
748
+ firstFieldKey: NormalPrimitiveKey<T>;
749
+ /**
750
+ * - The key in the input objects to use for the second field of the option. Only primitive values (`string | number | boolean | null | undefined`) are accepted.
751
+ * @example
752
+ * // If the input objects have a `name` field and you want to use it as the `label` field in the output:
753
+ * createOptionsArray(data, {firstFieldKey: 'id', secondFieldKey: 'name'}).
754
+ */
755
+ secondFieldKey: NormalPrimitiveKey<T>;
756
+ /**
757
+ * - The name of the first field in the output object.
758
+ * - Defaults to `'value'`.
759
+ * @example
760
+ * // If you want the output field to be named `'key'` instead of `'value'`:
761
+ * createOptionsArray(data, {firstFieldKey: 'id', secondFieldKey: 'name', firstFieldName: 'key'}).
762
+ */
763
+ firstFieldName?: K1;
764
+ /**
765
+ * - The name of the second field in the output object.
766
+ * - Defaults to `'label'`.
767
+ * @example
768
+ * // If you want the output field to be named `'title'` instead of `'label'`:
769
+ * createOptionsArray(data, {firstFieldKey: 'id', secondFieldKey: 'name', firstFieldName: 'key', secondFieldName: 'title'}).
770
+ */
771
+ secondFieldName?: K2;
772
+ /**
773
+ * - If `true`, numeric values from `firstFieldKey` will remain as numbers.
774
+ * - All other values (including booleans, null, undefined) will be converted to strings.
775
+ * - When `false` (default), all values are converted to strings.
776
+ * - Defaults to `false`.
777
+ * @example
778
+ * // Numeric IDs remain as numbers
779
+ * createOptionsArray(data, {
780
+ * firstFieldKey: 'id',
781
+ * secondFieldKey: 'name',
782
+ * retainNumberValue: true
783
+ * });
784
+ *
785
+ * // All values become strings (default behavior)
786
+ * createOptionsArray(data, {
787
+ * firstFieldKey: 'id',
788
+ * secondFieldKey: 'name'
789
+ * });
790
+ */
791
+ retainNumberValue?: V;
792
+ }
793
+ /** Type for first field key */
794
+ type FirstFieldKey<T extends GenericObject, K1 extends string = 'value', K2 extends string = 'label', V extends boolean = false> = T[OptionsConfig<T, K1, K2, V>['firstFieldKey']];
795
+ /** Type for firs field value */
796
+ type FirstFieldValue<T extends GenericObject, K1 extends string = 'value', K2 extends string = 'label', V extends boolean = false> = V extends true ? FirstFieldKey<T, K1, K2, V> extends (Exclude<FirstFieldKey<T, K1, K2, V>, number>) ? string : number : string;
797
+ /** Type of values for the option fields */
798
+ type FieldValue<P extends K1 | K2, T extends GenericObject, K1 extends string = 'value', K2 extends string = 'label', V extends boolean = false> = P extends K1 ? FirstFieldValue<T, K1, K2, V> : string;
799
+ /** Type of an option in `OptionsArray` */
800
+ type Option<T extends GenericObject, K1 extends string = 'value', K2 extends string = 'label', V extends boolean = false> = {
801
+ [P in K1 | K2]: FieldValue<P, T, K1, K2, V>;
802
+ };
803
+ /** * Option for sorting order. */
804
+ interface OrderOption {
805
+ /**
806
+ * * The order in which to sort the array. Defaults to `'asc'`.
807
+ * - `'asc'`: Sort in ascending order.
808
+ * - `'desc'`: Sort in descending order.
809
+ */
810
+ sortOrder?: 'asc' | 'desc';
811
+ }
812
+ /** * Options for setting sortByField for sorting an array of objects. */
813
+ interface SortByOption<T extends GenericObject> extends OrderOption {
814
+ /** The field by which to sort the objects in the array. */
815
+ sortByField: NestedPrimitiveKey<T>;
816
+ }
817
+ /** * Options for sorting array. */
818
+ type SortOptions<T> = T extends GenericObject ? SortByOption<T> : OrderOption;
819
+ /** Optional settings to configure comparison behavior. */
820
+ interface SortNature {
821
+ /** If true, compares string chunks without case sensitivity. Defaults to `true`. */
822
+ caseInsensitive?: boolean;
823
+ /** If true, uses localeCompare for string chunk comparisons. Defaults to `false`. */
824
+ localeAware?: boolean;
825
+ }
826
+ /** * Options for customizing the search behavior. */
827
+ interface FindOptions<T = unknown> {
828
+ /** * Enables fuzzy matching when exact match fails. Defaults to `false`. */
829
+ fuzzy?: boolean;
830
+ /** * Optional key for caching the result. Defaults to `finder-cache` */
831
+ cacheKey?: string;
832
+ /** * Forces binary search even for small datasets. Defaults to `false`. */
833
+ forceBinary?: boolean;
834
+ /** * If true, matcher and keys will be normalized to lowercase. Defaults to `true`. */
835
+ caseInsensitive?: boolean;
836
+ /** * If true, uses built in `Array.sort()`. Defaults to `true`. Pass `false` if data is already sorted. */
837
+ needSorting?: boolean;
838
+ /** * Optional data source to use instead of constructor items. */
839
+ data?: T[] | (() => T[]);
840
+ }
841
+
771
842
  /** - Configuration options to control FormData generation behavior. */
772
843
  interface FormDataConfigs<T> {
773
844
  /**
@@ -865,77 +936,6 @@ type SerializedForm<T extends boolean> = T extends false ? Record<string, string
865
936
  /** * Represents the parsed form data. */
866
937
  type ParsedFormData<T> = T extends string ? Record<string, string | string[]> : Record<string, string | string[] | File | File[]>;
867
938
 
868
- /** Uncontrolled any to use for edge cases */
869
- type Any = any;
870
- declare const __brand: unique symbol;
871
- type Brand<B> = {
872
- [__brand]: B;
873
- };
874
- /** Create a branded type. */
875
- type Branded<T, B> = T & Brand<B>;
876
- /** Utility type to flatten Partial type */
877
- type FlattenPartial<T> = Partial<{
878
- [K in keyof T]: T[K];
879
- }>;
880
- /** Union of `number` and numeric string */
881
- type Numeric = number | `${number}`;
882
- /** Union of All Primitive Types (i.e. `string | number | boolean | symbol | bigint | null | undefined`) */
883
- type Primitive = string | number | boolean | symbol | bigint | null | undefined;
884
- /** Union of Normal Primitive Types (i.e. `string | number | boolean | null | undefined`) */
885
- type NormalPrimitive = string | number | boolean | null | undefined;
886
- /** Extract normal primitive key(s) (i.e. `string | number | boolean | null | undefined`) from an object */
887
- type NormalPrimitiveKey<T> = {
888
- [K in keyof T]: T[K] extends NormalPrimitive ? K : never;
889
- }[keyof T];
890
- /**
891
- * * Keys of an object that are part of the object type itself.
892
- * This excludes keys that are inherited from the prototype chain.
893
- * This type is useful for extracting keys that are part of the object's own properties.
894
- * It is used in the `OwnKeys` type to filter out keys that are not part of the object properties.
895
- */
896
- type OwnKeys<T> = {
897
- [K in keyof T]: {} extends Pick<T, K> ? never : K;
898
- }[keyof T];
899
- /** Extract primitive (string, number or boolean) key(s) from an object */
900
- type NonNullishPrimitiveKey<T> = {
901
- [K in keyof T]: T[K] extends string | number | boolean ? K : never;
902
- }[keyof T];
903
- /** Falsy primitive type */
904
- type FalsyPrimitive = false | 0 | '' | null | undefined;
905
- /** A generic class constructor */
906
- type Constructor = new (...args: any[]) => unknown;
907
- /** Generic function type */
908
- type GenericFn = (...args: unknown[]) => unknown;
909
- /** Generic function type that returns `void` */
910
- type VoidFunction = (...args: any[]) => void;
911
- /** Debounced function type after certain delay */
912
- type DelayedFn<T extends VoidFunction> = (...args: Parameters<T>) => void;
913
- /** Throttled function type after specific delay */
914
- type ThrottledFn<T extends VoidFunction> = (...args: Parameters<T>) => void;
915
- /** Asynchronous function type */
916
- type AsyncFunction<T> = (...args: unknown[]) => Promise<T>;
917
- /** Advanced non-primitive types */
918
- type AdvancedTypes = Array<unknown> | File | FileList | Blob | Date | RegExp | WeakMap<WeakKey, unknown> | WeakSet<WeakKey> | Map<unknown, unknown> | Set<unknown> | Function | GenericFn | VoidFunction | AsyncFunction<unknown> | Promise<unknown> | Error | EvalError | RangeError | ReferenceError | SyntaxError | TypeError | URIError | bigint | symbol;
919
- /** Helper to detect if a type has methods */
920
- type HasMethods<T> = {
921
- [K in keyof T]: T[K] extends Function ? true : never;
922
- }[keyof T] extends never ? false : true;
923
- /** * Represents detailed information about a class's methods. */
924
- interface ClassDetails {
925
- /** * List of instance method names defined directly on the class prototype. */
926
- instanceNames: string[];
927
- /** * List of static method names defined directly on the class constructor. */
928
- staticNames: string[];
929
- /** * Number of instance methods. */
930
- instances: number;
931
- /** * Number of static methods. */
932
- statics: number;
933
- /** * Total number of instance and static methods combined. */
934
- total: number;
935
- }
936
- /** Literal type for `partial` and `required` */
937
- type PartialOrRequired = 'partial' | 'required';
938
-
939
939
  /** Options to initialize Paginator */
940
940
  interface PaginatorOptions {
941
941
  /** The total number of items. */
@@ -45,191 +45,76 @@ interface MaskOptions {
45
45
  /** Formatted query string as `?${string}` = `?key=value&...` or empty string. */
46
46
  type QueryString = `?${string}` | '';
47
47
 
48
- /** - Generic object with `unknown` value */
49
- type StrictObject = Record<string, unknown>;
50
- /** - Generic object but with `any` value */
51
- type GenericObject = Record<string, any>;
52
- /**
53
- * * Represents a value that can be used in a query object.
54
- * - Can be a primitive, an array of primitives, or a nested query object.
55
- */
56
- type QueryObjectValue = NormalPrimitive | NormalPrimitive[] | QueryObject;
57
- /**
58
- * * Represents a query object with string keys and `QueryObjectValue` values.
59
- * - Supports nested objects and arrays.
60
- */
61
- type QueryObject = {
62
- [key: string]: QueryObjectValue;
63
- };
64
- /** - Object type with string or number or boolean as value for each key. */
65
- type GenericObjectPrimitive = Record<string, string | number | boolean>;
66
- /** - Dot-notation keys for nested objects with unknown value (including optional properties) */
67
- type DotNotationKeyStrict<T> = T extends AdvancedTypes ? never : T extends StrictObject ? HasMethods<T> extends true ? never : {
68
- [K in keyof T & string]: NonNullable<T[K]> extends (StrictObject) ? `${K}` | `${K}.${DotNotationKey<NonNullable<T[K]>>}` : `${K}`;
69
- }[keyof T & string] : never;
70
- /** - Dot-notation keys for nested objects with `any` value (including optional properties) */
71
- type DotNotationKey<T> = T extends AdvancedTypes ? never : T extends GenericObject ? HasMethods<T> extends true ? never : {
72
- [K in keyof T & string]: NonNullable<T[K]> extends (GenericObject) ? `${K}` | `${K}.${DotNotationKey<NonNullable<T[K]>>}` : `${K}`;
73
- }[keyof T & string] : never;
74
- /** - Object keys where the value is an array (including optional properties) */
75
- type KeyForArray<T> = T extends GenericObject ? HasMethods<T> extends true ? never : {
76
- [K in keyof T & string]: NonNullable<T[K]> extends (Array<unknown>) ? K : never;
77
- }[keyof T & string] : never;
78
- /** - Object keys where the value is a non-array/non-advanced type object (including optional properties) */
79
- type KeyForObject<T> = T extends AdvancedTypes ? never : T extends GenericObject ? HasMethods<T> extends true ? never : {
80
- [K in keyof T & string]: NonNullable<T[K]> extends (GenericObject) ? NonNullable<T[K]> extends AdvancedTypes ? never : K : never;
81
- }[keyof T & string] : never;
82
- /** - Extract only keys with string values from an object, including nested dot-notation keys. */
83
- type NestedKeyString<T> = T extends AdvancedTypes ? never : T extends GenericObject ? HasMethods<T> extends true ? never : {
84
- [K in keyof T & string]: NonNullable<T[K]> extends string ? K : NonNullable<T[K]> extends GenericObject ? `${K}.${NestedKeyString<NonNullable<T[K]>>}` : never;
85
- }[keyof T & string] : never;
86
- /** - Extract only primitive keys from an object, including nested dot-notation keys. */
87
- type NestedPrimitiveKey<T> = T extends AdvancedTypes ? never : T extends GenericObject ? HasMethods<T> extends true ? never : {
88
- [K in keyof T & string]: NonNullable<T[K]> extends (NormalPrimitive) ? K : NonNullable<T[K]> extends GenericObject ? `${K}.${NestedPrimitiveKey<NonNullable<T[K]>>}` : never;
89
- }[keyof T & string] : never;
90
- /** - Options for `sanitizeData` utility. */
91
- interface SanitizeOptions<T> {
92
- /**
93
- * An array of dot-notation keys to exclude from the sanitized output.
94
- * This is only applicable when sanitizing plain objects or arrays of objects.
95
- * When applied to nested or irregular array structures, behavior may be inconsistent or partially ignored.
96
- */
97
- keysToIgnore?: DotNotationKey<T>[];
98
- /** Whether to trim string values. Defaults to `true`. */
99
- trimStrings?: boolean;
100
- /** Whether to exclude nullish (`null` or `undefined`) values. Defaults to `false`. */
101
- ignoreNullish?: boolean;
102
- /** Whether to exclude all falsy values (`false`, `0`, `empty string: ''`, `null`, `undefined`. Defaults to `false`. */
103
- ignoreFalsy?: boolean;
104
- /** Whether to exclude empty object(s) and array(s) (`{}`, `[]`). Defaults to `false`. */
105
- ignoreEmpty?: boolean;
106
- /**
107
- * An array of dot-notation key paths that must be preserved in the sanitized output.
108
- * Use `"*"` to retain all keys. This applies primarily to plain or nested objects and arrays of objects.
109
- * When applied to nested or irregular array structures, behavior may be inconsistent or partially ignored.
110
- */
111
- requiredKeys?: '*' | DotNotationKey<T>[];
112
- }
113
- /** - Type of data value converted to `string` */
114
- type Stringified<T> = {
115
- [K in keyof T]: T[K] extends (infer U)[] ? Stringified<U>[] : T[K] extends object | null | undefined ? Stringified<T[K]> : T[K] extends string | number ? string : T[K];
116
- };
117
- /** - Type of data value converted to `number` */
118
- type Numberified<T> = {
119
- [K in keyof T]: T[K] extends (infer U)[] ? Numberified<U>[] : T[K] extends object | null | undefined ? Numberified<T[K]> : T[K] extends string ? number : T[K] extends number ? T[K] : number;
48
+ /** Uncontrolled any to use for edge cases */
49
+ type Any = any;
50
+ declare const __brand: unique symbol;
51
+ type Brand<B> = {
52
+ [__brand]: B;
120
53
  };
121
-
122
- /** * Flatten Array or Wrap in Array */
123
- type Flattened<T> = T extends (infer U)[] ? Flattened<U> : T;
54
+ /** Create a branded type. */
55
+ type Branded<T, B> = T & Brand<B>;
56
+ /** Utility type to flatten Partial type */
57
+ type FlattenPartial<T> = Partial<{
58
+ [K in keyof T]: T[K];
59
+ }>;
60
+ /** Union of `number` and numeric string */
61
+ type Numeric = number | `${number}`;
62
+ /** Union of All Primitive Types (i.e. `string | number | boolean | symbol | bigint | null | undefined`) */
63
+ type Primitive = string | number | boolean | symbol | bigint | null | undefined;
64
+ /** Union of Normal Primitive Types (i.e. `string | number | boolean | null | undefined`) */
65
+ type NormalPrimitive = string | number | boolean | null | undefined;
66
+ /** Extract normal primitive key(s) (i.e. `string | number | boolean | null | undefined`) from an object */
67
+ type NormalPrimitiveKey<T> = {
68
+ [K in keyof T]: T[K] extends NormalPrimitive ? K : never;
69
+ }[keyof T];
124
70
  /**
125
- * * Configuration for `createOptionsArray`.
126
- * - Defines the mapping between keys in the input objects and the keys in the output options.
127
- *
128
- * @typeParam T - The type of the objects in the input array.
129
- * @typeParam K1 - The name of the key for the first field in the output (default: `'value'`).
130
- * @typeParam K2 - The name of the key for the second field in the output (default: `'label'`).
131
- * @typeParam V - Whether to keep the `value` field as number if it is a number. Defaults to `false`.
71
+ * * Keys of an object that are part of the object type itself.
72
+ * This excludes keys that are inherited from the prototype chain.
73
+ * This type is useful for extracting keys that are part of the object's own properties.
74
+ * It is used in the `OwnKeys` type to filter out keys that are not part of the object properties.
132
75
  */
133
- interface OptionsConfig<T, K1, K2, V extends boolean = false> {
134
- /**
135
- * - The key in the input objects to use for the first field of the option. Only primitive values (`string | number | boolean | null | undefined`) are accepted.
136
- * @example
137
- * // If the input objects have an `id` field and you want to use it as the `value` field in the output:
138
- * createOptionsArray(data, {firstFieldKey: 'id'}).
139
- */
140
- firstFieldKey: NormalPrimitiveKey<T>;
141
- /**
142
- * - The key in the input objects to use for the second field of the option. Only primitive values (`string | number | boolean | null | undefined`) are accepted.
143
- * @example
144
- * // If the input objects have a `name` field and you want to use it as the `label` field in the output:
145
- * createOptionsArray(data, {firstFieldKey: 'id', secondFieldKey: 'name'}).
146
- */
147
- secondFieldKey: NormalPrimitiveKey<T>;
148
- /**
149
- * - The name of the first field in the output object.
150
- * - Defaults to `'value'`.
151
- * @example
152
- * // If you want the output field to be named `'key'` instead of `'value'`:
153
- * createOptionsArray(data, {firstFieldKey: 'id', secondFieldKey: 'name', firstFieldName: 'key'}).
154
- */
155
- firstFieldName?: K1;
156
- /**
157
- * - The name of the second field in the output object.
158
- * - Defaults to `'label'`.
159
- * @example
160
- * // If you want the output field to be named `'title'` instead of `'label'`:
161
- * createOptionsArray(data, {firstFieldKey: 'id', secondFieldKey: 'name', firstFieldName: 'key', secondFieldName: 'title'}).
162
- */
163
- secondFieldName?: K2;
164
- /**
165
- * - If `true`, numeric values from `firstFieldKey` will remain as numbers.
166
- * - All other values (including booleans, null, undefined) will be converted to strings.
167
- * - When `false` (default), all values are converted to strings.
168
- * - Defaults to `false`.
169
- * @example
170
- * // Numeric IDs remain as numbers
171
- * createOptionsArray(data, {
172
- * firstFieldKey: 'id',
173
- * secondFieldKey: 'name',
174
- * retainNumberValue: true
175
- * });
176
- *
177
- * // All values become strings (default behavior)
178
- * createOptionsArray(data, {
179
- * firstFieldKey: 'id',
180
- * secondFieldKey: 'name'
181
- * });
182
- */
183
- retainNumberValue?: V;
184
- }
185
- /** Type for first field key */
186
- type FirstFieldKey<T extends GenericObject, K1 extends string = 'value', K2 extends string = 'label', V extends boolean = false> = T[OptionsConfig<T, K1, K2, V>['firstFieldKey']];
187
- /** Type for firs field value */
188
- type FirstFieldValue<T extends GenericObject, K1 extends string = 'value', K2 extends string = 'label', V extends boolean = false> = V extends true ? FirstFieldKey<T, K1, K2, V> extends (Exclude<FirstFieldKey<T, K1, K2, V>, number>) ? string : number : string;
189
- /** Type of values for the option fields */
190
- type FieldValue<P extends K1 | K2, T extends GenericObject, K1 extends string = 'value', K2 extends string = 'label', V extends boolean = false> = P extends K1 ? FirstFieldValue<T, K1, K2, V> : string;
191
- /** Type of an option in `OptionsArray` */
192
- type Option<T extends GenericObject, K1 extends string = 'value', K2 extends string = 'label', V extends boolean = false> = {
193
- [P in K1 | K2]: FieldValue<P, T, K1, K2, V>;
194
- };
195
- /** * Option for sorting order. */
196
- interface OrderOption {
197
- /**
198
- * * The order in which to sort the array. Defaults to `'asc'`.
199
- * - `'asc'`: Sort in ascending order.
200
- * - `'desc'`: Sort in descending order.
201
- */
202
- sortOrder?: 'asc' | 'desc';
203
- }
204
- /** * Options for setting sortByField for sorting an array of objects. */
205
- interface SortByOption<T extends GenericObject> extends OrderOption {
206
- /** The field by which to sort the objects in the array. */
207
- sortByField: NestedPrimitiveKey<T>;
208
- }
209
- /** * Options for sorting array. */
210
- type SortOptions<T> = T extends GenericObject ? SortByOption<T> : OrderOption;
211
- /** Optional settings to configure comparison behavior. */
212
- interface SortNature {
213
- /** If true, compares string chunks without case sensitivity. Defaults to `true`. */
214
- caseInsensitive?: boolean;
215
- /** If true, uses localeCompare for string chunk comparisons. Defaults to `false`. */
216
- localeAware?: boolean;
217
- }
218
- /** * Options for customizing the search behavior. */
219
- interface FindOptions<T = unknown> {
220
- /** * Enables fuzzy matching when exact match fails. Defaults to `false`. */
221
- fuzzy?: boolean;
222
- /** * Optional key for caching the result. Defaults to `finder-cache` */
223
- cacheKey?: string;
224
- /** * Forces binary search even for small datasets. Defaults to `false`. */
225
- forceBinary?: boolean;
226
- /** * If true, matcher and keys will be normalized to lowercase. Defaults to `true`. */
227
- caseInsensitive?: boolean;
228
- /** * If true, uses built in `Array.sort()`. Defaults to `true`. Pass `false` if data is already sorted. */
229
- needSorting?: boolean;
230
- /** * Optional data source to use instead of constructor items. */
231
- data?: T[] | (() => T[]);
76
+ type OwnKeys<T> = {
77
+ [K in keyof T]: {} extends Pick<T, K> ? never : K;
78
+ }[keyof T];
79
+ /** Extract primitive (string, number or boolean) key(s) from an object */
80
+ type NonNullishPrimitiveKey<T> = {
81
+ [K in keyof T]: T[K] extends string | number | boolean ? K : never;
82
+ }[keyof T];
83
+ /** Falsy primitive type */
84
+ type FalsyPrimitive = false | 0 | '' | null | undefined;
85
+ /** A generic class constructor */
86
+ type Constructor = new (...args: any[]) => unknown;
87
+ /** Generic function type */
88
+ type GenericFn = (...args: unknown[]) => unknown;
89
+ /** Generic function type that returns `void` */
90
+ type VoidFunction = (...args: any[]) => void;
91
+ /** Debounced function type after certain delay */
92
+ type DelayedFn<T extends VoidFunction> = (...args: Parameters<T>) => void;
93
+ /** Throttled function type after specific delay */
94
+ type ThrottledFn<T extends VoidFunction> = (...args: Parameters<T>) => void;
95
+ /** Asynchronous function type */
96
+ type AsyncFunction<T> = (...args: unknown[]) => Promise<T>;
97
+ /** Advanced non-primitive types */
98
+ type AdvancedTypes = Array<unknown> | File | FileList | Blob | Date | RegExp | WeakMap<WeakKey, unknown> | WeakSet<WeakKey> | Map<unknown, unknown> | Set<unknown> | Function | GenericFn | VoidFunction | AsyncFunction<unknown> | Promise<unknown> | Error | EvalError | RangeError | ReferenceError | SyntaxError | TypeError | URIError | bigint | symbol;
99
+ /** Helper to detect if a type has methods */
100
+ type HasMethods<T> = {
101
+ [K in keyof T]: T[K] extends Function ? true : never;
102
+ }[keyof T] extends never ? false : true;
103
+ /** * Represents detailed information about a class's methods. */
104
+ interface ClassDetails {
105
+ /** * List of instance method names defined directly on the class prototype. */
106
+ instanceNames: string[];
107
+ /** * List of static method names defined directly on the class constructor. */
108
+ staticNames: string[];
109
+ /** * Number of instance methods. */
110
+ instances: number;
111
+ /** * Number of static methods. */
112
+ statics: number;
113
+ /** * Total number of instance and static methods combined. */
114
+ total: number;
232
115
  }
116
+ /** Literal type for `partial` and `required` */
117
+ type PartialOrRequired = 'partial' | 'required';
233
118
 
234
119
  /**
235
120
  * * Class representing a color and its conversions among `Hex`, `Hex8` `RGB`, `RGBA`, `HSL` and `HSLA` formats.
@@ -331,7 +216,7 @@ declare class Color {
331
216
  */
332
217
  constructor(color: CSSColor);
333
218
  /** - Iterates over the color representations (Hex, RGB, HSL). */
334
- [Symbol.iterator](): Generator<HSL | Hex6 | Hex8 | RGB | RGBA | HSLA, void, unknown>;
219
+ [Symbol.iterator](): Generator<HSL | RGB | HSLA | RGBA | Hex6 | Hex8, void, unknown>;
335
220
  /**
336
221
  * @instance Applies or modifies the opacity of a color. Mutate the original instance.
337
222
  * - For solid colors (Hex6/RGB/HSL): Adds an alpha channel with the specified opacity.
@@ -768,6 +653,192 @@ type Tetrad = [Color, Color, Color, Color];
768
653
  /** CSS named color, also includes different response colors */
769
654
  type CSSColor = keyof typeof CSS_COLORS;
770
655
 
656
+ /** - Generic object with `unknown` value */
657
+ type StrictObject = Record<string, unknown>;
658
+ /** - Generic object but with `any` value */
659
+ type GenericObject = Record<string, any>;
660
+ /**
661
+ * * Represents a value that can be used in a query object.
662
+ * - Can be a primitive, an array of primitives, or a nested query object.
663
+ */
664
+ type QueryObjectValue = NormalPrimitive | NormalPrimitive[] | QueryObject;
665
+ /**
666
+ * * Represents a query object with string keys and `QueryObjectValue` values.
667
+ * - Supports nested objects and arrays.
668
+ */
669
+ type QueryObject = {
670
+ [key: string]: QueryObjectValue;
671
+ };
672
+ /** - Object type with string or number or boolean as value for each key. */
673
+ type GenericObjectPrimitive = Record<string, string | number | boolean>;
674
+ /** - Dot-notation keys for nested objects with unknown value (including optional properties) */
675
+ type DotNotationKeyStrict<T> = T extends AdvancedTypes ? never : T extends StrictObject ? HasMethods<T> extends true ? never : {
676
+ [K in keyof T & string]: NonNullable<T[K]> extends (StrictObject) ? `${K}` | `${K}.${DotNotationKey<NonNullable<T[K]>>}` : `${K}`;
677
+ }[keyof T & string] : never;
678
+ /** - Dot-notation keys for nested objects with `any` value (including optional properties) */
679
+ type DotNotationKey<T> = T extends AdvancedTypes ? never : T extends GenericObject ? HasMethods<T> extends true ? never : {
680
+ [K in keyof T & string]: NonNullable<T[K]> extends (GenericObject) ? `${K}` | `${K}.${DotNotationKey<NonNullable<T[K]>>}` : `${K}`;
681
+ }[keyof T & string] : never;
682
+ /** - Object keys where the value is an array (including optional properties) */
683
+ type KeyForArray<T> = T extends GenericObject ? HasMethods<T> extends true ? never : {
684
+ [K in keyof T & string]: NonNullable<T[K]> extends (Array<unknown>) ? K : never;
685
+ }[keyof T & string] : never;
686
+ /** - Object keys where the value is a non-array/non-advanced type object (including optional properties) */
687
+ type KeyForObject<T> = T extends AdvancedTypes ? never : T extends GenericObject ? HasMethods<T> extends true ? never : {
688
+ [K in keyof T & string]: NonNullable<T[K]> extends (GenericObject) ? NonNullable<T[K]> extends AdvancedTypes ? never : K : never;
689
+ }[keyof T & string] : never;
690
+ /** - Extract only keys with string values from an object, including nested dot-notation keys. */
691
+ type NestedKeyString<T> = T extends AdvancedTypes ? never : T extends GenericObject ? HasMethods<T> extends true ? never : {
692
+ [K in keyof T & string]: NonNullable<T[K]> extends string ? K : NonNullable<T[K]> extends GenericObject ? `${K}.${NestedKeyString<NonNullable<T[K]>>}` : never;
693
+ }[keyof T & string] : never;
694
+ /** - Extract only primitive keys from an object, including nested dot-notation keys. */
695
+ type NestedPrimitiveKey<T> = T extends AdvancedTypes ? never : T extends GenericObject ? HasMethods<T> extends true ? never : {
696
+ [K in keyof T & string]: NonNullable<T[K]> extends (NormalPrimitive) ? K : NonNullable<T[K]> extends GenericObject ? `${K}.${NestedPrimitiveKey<NonNullable<T[K]>>}` : never;
697
+ }[keyof T & string] : never;
698
+ /** - Options for `sanitizeData` utility. */
699
+ interface SanitizeOptions<T> {
700
+ /**
701
+ * An array of dot-notation keys to exclude from the sanitized output.
702
+ * This is only applicable when sanitizing plain objects or arrays of objects.
703
+ * When applied to nested or irregular array structures, behavior may be inconsistent or partially ignored.
704
+ */
705
+ keysToIgnore?: DotNotationKey<T>[];
706
+ /** Whether to trim string values. Defaults to `true`. */
707
+ trimStrings?: boolean;
708
+ /** Whether to exclude nullish (`null` or `undefined`) values. Defaults to `false`. */
709
+ ignoreNullish?: boolean;
710
+ /** Whether to exclude all falsy values (`false`, `0`, `empty string: ''`, `null`, `undefined`. Defaults to `false`. */
711
+ ignoreFalsy?: boolean;
712
+ /** Whether to exclude empty object(s) and array(s) (`{}`, `[]`). Defaults to `false`. */
713
+ ignoreEmpty?: boolean;
714
+ /**
715
+ * An array of dot-notation key paths that must be preserved in the sanitized output.
716
+ * Use `"*"` to retain all keys. This applies primarily to plain or nested objects and arrays of objects.
717
+ * When applied to nested or irregular array structures, behavior may be inconsistent or partially ignored.
718
+ */
719
+ requiredKeys?: '*' | DotNotationKey<T>[];
720
+ }
721
+ /** - Type of data value converted to `string` */
722
+ type Stringified<T> = {
723
+ [K in keyof T]: T[K] extends (infer U)[] ? Stringified<U>[] : T[K] extends object | null | undefined ? Stringified<T[K]> : T[K] extends string | number ? string : T[K];
724
+ };
725
+ /** - Type of data value converted to `number` */
726
+ type Numberified<T> = {
727
+ [K in keyof T]: T[K] extends (infer U)[] ? Numberified<U>[] : T[K] extends object | null | undefined ? Numberified<T[K]> : T[K] extends string ? number : T[K] extends number ? T[K] : number;
728
+ };
729
+
730
+ /** * Flatten Array or Wrap in Array */
731
+ type Flattened<T> = T extends (infer U)[] ? Flattened<U> : T;
732
+ /**
733
+ * * Configuration for `createOptionsArray`.
734
+ * - Defines the mapping between keys in the input objects and the keys in the output options.
735
+ *
736
+ * @typeParam T - The type of the objects in the input array.
737
+ * @typeParam K1 - The name of the key for the first field in the output (default: `'value'`).
738
+ * @typeParam K2 - The name of the key for the second field in the output (default: `'label'`).
739
+ * @typeParam V - Whether to keep the `value` field as number if it is a number. Defaults to `false`.
740
+ */
741
+ interface OptionsConfig<T, K1, K2, V extends boolean = false> {
742
+ /**
743
+ * - The key in the input objects to use for the first field of the option. Only primitive values (`string | number | boolean | null | undefined`) are accepted.
744
+ * @example
745
+ * // If the input objects have an `id` field and you want to use it as the `value` field in the output:
746
+ * createOptionsArray(data, {firstFieldKey: 'id'}).
747
+ */
748
+ firstFieldKey: NormalPrimitiveKey<T>;
749
+ /**
750
+ * - The key in the input objects to use for the second field of the option. Only primitive values (`string | number | boolean | null | undefined`) are accepted.
751
+ * @example
752
+ * // If the input objects have a `name` field and you want to use it as the `label` field in the output:
753
+ * createOptionsArray(data, {firstFieldKey: 'id', secondFieldKey: 'name'}).
754
+ */
755
+ secondFieldKey: NormalPrimitiveKey<T>;
756
+ /**
757
+ * - The name of the first field in the output object.
758
+ * - Defaults to `'value'`.
759
+ * @example
760
+ * // If you want the output field to be named `'key'` instead of `'value'`:
761
+ * createOptionsArray(data, {firstFieldKey: 'id', secondFieldKey: 'name', firstFieldName: 'key'}).
762
+ */
763
+ firstFieldName?: K1;
764
+ /**
765
+ * - The name of the second field in the output object.
766
+ * - Defaults to `'label'`.
767
+ * @example
768
+ * // If you want the output field to be named `'title'` instead of `'label'`:
769
+ * createOptionsArray(data, {firstFieldKey: 'id', secondFieldKey: 'name', firstFieldName: 'key', secondFieldName: 'title'}).
770
+ */
771
+ secondFieldName?: K2;
772
+ /**
773
+ * - If `true`, numeric values from `firstFieldKey` will remain as numbers.
774
+ * - All other values (including booleans, null, undefined) will be converted to strings.
775
+ * - When `false` (default), all values are converted to strings.
776
+ * - Defaults to `false`.
777
+ * @example
778
+ * // Numeric IDs remain as numbers
779
+ * createOptionsArray(data, {
780
+ * firstFieldKey: 'id',
781
+ * secondFieldKey: 'name',
782
+ * retainNumberValue: true
783
+ * });
784
+ *
785
+ * // All values become strings (default behavior)
786
+ * createOptionsArray(data, {
787
+ * firstFieldKey: 'id',
788
+ * secondFieldKey: 'name'
789
+ * });
790
+ */
791
+ retainNumberValue?: V;
792
+ }
793
+ /** Type for first field key */
794
+ type FirstFieldKey<T extends GenericObject, K1 extends string = 'value', K2 extends string = 'label', V extends boolean = false> = T[OptionsConfig<T, K1, K2, V>['firstFieldKey']];
795
+ /** Type for firs field value */
796
+ type FirstFieldValue<T extends GenericObject, K1 extends string = 'value', K2 extends string = 'label', V extends boolean = false> = V extends true ? FirstFieldKey<T, K1, K2, V> extends (Exclude<FirstFieldKey<T, K1, K2, V>, number>) ? string : number : string;
797
+ /** Type of values for the option fields */
798
+ type FieldValue<P extends K1 | K2, T extends GenericObject, K1 extends string = 'value', K2 extends string = 'label', V extends boolean = false> = P extends K1 ? FirstFieldValue<T, K1, K2, V> : string;
799
+ /** Type of an option in `OptionsArray` */
800
+ type Option<T extends GenericObject, K1 extends string = 'value', K2 extends string = 'label', V extends boolean = false> = {
801
+ [P in K1 | K2]: FieldValue<P, T, K1, K2, V>;
802
+ };
803
+ /** * Option for sorting order. */
804
+ interface OrderOption {
805
+ /**
806
+ * * The order in which to sort the array. Defaults to `'asc'`.
807
+ * - `'asc'`: Sort in ascending order.
808
+ * - `'desc'`: Sort in descending order.
809
+ */
810
+ sortOrder?: 'asc' | 'desc';
811
+ }
812
+ /** * Options for setting sortByField for sorting an array of objects. */
813
+ interface SortByOption<T extends GenericObject> extends OrderOption {
814
+ /** The field by which to sort the objects in the array. */
815
+ sortByField: NestedPrimitiveKey<T>;
816
+ }
817
+ /** * Options for sorting array. */
818
+ type SortOptions<T> = T extends GenericObject ? SortByOption<T> : OrderOption;
819
+ /** Optional settings to configure comparison behavior. */
820
+ interface SortNature {
821
+ /** If true, compares string chunks without case sensitivity. Defaults to `true`. */
822
+ caseInsensitive?: boolean;
823
+ /** If true, uses localeCompare for string chunk comparisons. Defaults to `false`. */
824
+ localeAware?: boolean;
825
+ }
826
+ /** * Options for customizing the search behavior. */
827
+ interface FindOptions<T = unknown> {
828
+ /** * Enables fuzzy matching when exact match fails. Defaults to `false`. */
829
+ fuzzy?: boolean;
830
+ /** * Optional key for caching the result. Defaults to `finder-cache` */
831
+ cacheKey?: string;
832
+ /** * Forces binary search even for small datasets. Defaults to `false`. */
833
+ forceBinary?: boolean;
834
+ /** * If true, matcher and keys will be normalized to lowercase. Defaults to `true`. */
835
+ caseInsensitive?: boolean;
836
+ /** * If true, uses built in `Array.sort()`. Defaults to `true`. Pass `false` if data is already sorted. */
837
+ needSorting?: boolean;
838
+ /** * Optional data source to use instead of constructor items. */
839
+ data?: T[] | (() => T[]);
840
+ }
841
+
771
842
  /** - Configuration options to control FormData generation behavior. */
772
843
  interface FormDataConfigs<T> {
773
844
  /**
@@ -865,77 +936,6 @@ type SerializedForm<T extends boolean> = T extends false ? Record<string, string
865
936
  /** * Represents the parsed form data. */
866
937
  type ParsedFormData<T> = T extends string ? Record<string, string | string[]> : Record<string, string | string[] | File | File[]>;
867
938
 
868
- /** Uncontrolled any to use for edge cases */
869
- type Any = any;
870
- declare const __brand: unique symbol;
871
- type Brand<B> = {
872
- [__brand]: B;
873
- };
874
- /** Create a branded type. */
875
- type Branded<T, B> = T & Brand<B>;
876
- /** Utility type to flatten Partial type */
877
- type FlattenPartial<T> = Partial<{
878
- [K in keyof T]: T[K];
879
- }>;
880
- /** Union of `number` and numeric string */
881
- type Numeric = number | `${number}`;
882
- /** Union of All Primitive Types (i.e. `string | number | boolean | symbol | bigint | null | undefined`) */
883
- type Primitive = string | number | boolean | symbol | bigint | null | undefined;
884
- /** Union of Normal Primitive Types (i.e. `string | number | boolean | null | undefined`) */
885
- type NormalPrimitive = string | number | boolean | null | undefined;
886
- /** Extract normal primitive key(s) (i.e. `string | number | boolean | null | undefined`) from an object */
887
- type NormalPrimitiveKey<T> = {
888
- [K in keyof T]: T[K] extends NormalPrimitive ? K : never;
889
- }[keyof T];
890
- /**
891
- * * Keys of an object that are part of the object type itself.
892
- * This excludes keys that are inherited from the prototype chain.
893
- * This type is useful for extracting keys that are part of the object's own properties.
894
- * It is used in the `OwnKeys` type to filter out keys that are not part of the object properties.
895
- */
896
- type OwnKeys<T> = {
897
- [K in keyof T]: {} extends Pick<T, K> ? never : K;
898
- }[keyof T];
899
- /** Extract primitive (string, number or boolean) key(s) from an object */
900
- type NonNullishPrimitiveKey<T> = {
901
- [K in keyof T]: T[K] extends string | number | boolean ? K : never;
902
- }[keyof T];
903
- /** Falsy primitive type */
904
- type FalsyPrimitive = false | 0 | '' | null | undefined;
905
- /** A generic class constructor */
906
- type Constructor = new (...args: any[]) => unknown;
907
- /** Generic function type */
908
- type GenericFn = (...args: unknown[]) => unknown;
909
- /** Generic function type that returns `void` */
910
- type VoidFunction = (...args: any[]) => void;
911
- /** Debounced function type after certain delay */
912
- type DelayedFn<T extends VoidFunction> = (...args: Parameters<T>) => void;
913
- /** Throttled function type after specific delay */
914
- type ThrottledFn<T extends VoidFunction> = (...args: Parameters<T>) => void;
915
- /** Asynchronous function type */
916
- type AsyncFunction<T> = (...args: unknown[]) => Promise<T>;
917
- /** Advanced non-primitive types */
918
- type AdvancedTypes = Array<unknown> | File | FileList | Blob | Date | RegExp | WeakMap<WeakKey, unknown> | WeakSet<WeakKey> | Map<unknown, unknown> | Set<unknown> | Function | GenericFn | VoidFunction | AsyncFunction<unknown> | Promise<unknown> | Error | EvalError | RangeError | ReferenceError | SyntaxError | TypeError | URIError | bigint | symbol;
919
- /** Helper to detect if a type has methods */
920
- type HasMethods<T> = {
921
- [K in keyof T]: T[K] extends Function ? true : never;
922
- }[keyof T] extends never ? false : true;
923
- /** * Represents detailed information about a class's methods. */
924
- interface ClassDetails {
925
- /** * List of instance method names defined directly on the class prototype. */
926
- instanceNames: string[];
927
- /** * List of static method names defined directly on the class constructor. */
928
- staticNames: string[];
929
- /** * Number of instance methods. */
930
- instances: number;
931
- /** * Number of static methods. */
932
- statics: number;
933
- /** * Total number of instance and static methods combined. */
934
- total: number;
935
- }
936
- /** Literal type for `partial` and `required` */
937
- type PartialOrRequired = 'partial' | 'required';
938
-
939
939
  /** Options to initialize Paginator */
940
940
  interface PaginatorOptions {
941
941
  /** The total number of items. */
@@ -1,2 +1,2 @@
1
- export { as as AdvancedTypes, a6 as AlphaColors, a7 as AlphaValue, A as AlphaValues, ar as AnagramOptions, a8 as Analogous, v as Any, $ as AsyncFunction, at as Branded, af as CSSColor, C as CapitalizeOptions, a as CaseFormat, K as ClassDetails, a9 as ColorInput, b as ColorInputArray, ab as ColorType, ac as ColorTypeAlpha, ad as ColorTypeSolid, aa as Colors, I as Constructor, ae as ConvertedColors, r as CustomFile, J as DelayedFn, D as DotNotationKey, ak as DotNotationKeyStrict, Y as FalsyPrimitive, m as FieldValue, aj as FileError, s as FileUpload, i as FindOptions, a2 as FirstFieldKey, a3 as FirstFieldValue, u as FlattenPartial, F as Flattened, o as FormDataConfigs, X as FromMetaOptions, a0 as GenericFn, G as GenericObject, al as GenericObjectPrimitive, d as HSL, g as HSLA, au as HasMethods, h as Hex, H as Hex6, e as Hex8, am as KeyForArray, an as KeyForObject, M as MaskOptions, ao as NestedKeyString, ap as NestedPrimitiveKey, av as NonNullishPrimitiveKey, Z as NormalPrimitive, aw as NormalPrimitiveKey, z as Numberified, N as Numeric, a4 as Option, l as OptionsConfig, k as OrderOption, t as OriginFileObj, O as OwnKeys, W as PageListOptions, U as PaginatorMeta, L as PaginatorOptions, p as ParsedFormData, w as PartialOrRequired, P as Percent, _ as Primitive, Q as QueryObject, aq as QueryObjectValue, B as QueryString, c as RGB, f as RGBA, R as RandomIdOptions, x as SanitizeOptions, q as SerializedForm, ag as SolidColors, S as SolidValues, j as SortByOption, n as SortNature, a5 as SortOptions, E as StrictObject, y as Stringified, ah as Tetrad, T as ThrottledFn, ai as Triad, V as VoidFunction } from './types-uginMOiI.mjs';
1
+ export { as as AdvancedTypes, a6 as AlphaColors, a7 as AlphaValue, A as AlphaValues, ar as AnagramOptions, a8 as Analogous, v as Any, $ as AsyncFunction, at as Branded, af as CSSColor, C as CapitalizeOptions, a as CaseFormat, K as ClassDetails, a9 as ColorInput, b as ColorInputArray, ab as ColorType, ac as ColorTypeAlpha, ad as ColorTypeSolid, aa as Colors, I as Constructor, ae as ConvertedColors, r as CustomFile, J as DelayedFn, D as DotNotationKey, ak as DotNotationKeyStrict, Y as FalsyPrimitive, m as FieldValue, aj as FileError, s as FileUpload, i as FindOptions, a2 as FirstFieldKey, a3 as FirstFieldValue, u as FlattenPartial, F as Flattened, o as FormDataConfigs, X as FromMetaOptions, a0 as GenericFn, G as GenericObject, al as GenericObjectPrimitive, d as HSL, g as HSLA, au as HasMethods, h as Hex, H as Hex6, e as Hex8, am as KeyForArray, an as KeyForObject, M as MaskOptions, ao as NestedKeyString, ap as NestedPrimitiveKey, av as NonNullishPrimitiveKey, Z as NormalPrimitive, aw as NormalPrimitiveKey, z as Numberified, N as Numeric, a4 as Option, l as OptionsConfig, k as OrderOption, t as OriginFileObj, O as OwnKeys, W as PageListOptions, U as PaginatorMeta, L as PaginatorOptions, p as ParsedFormData, w as PartialOrRequired, P as Percent, _ as Primitive, Q as QueryObject, aq as QueryObjectValue, B as QueryString, c as RGB, f as RGBA, R as RandomIdOptions, x as SanitizeOptions, q as SerializedForm, ag as SolidColors, S as SolidValues, j as SortByOption, n as SortNature, a5 as SortOptions, E as StrictObject, y as Stringified, ah as Tetrad, T as ThrottledFn, ai as Triad, V as VoidFunction } from './typedefs-BYmqOW77.mjs';
2
2
  export { K as ApplyChangeOptions, h as ChronosFormat, i as ChronosInput, j as ChronosMethods, k as ChronosObject, C as ChronosStatics, d as ConvertOptions, b as ConvertedDecimal, c as CurrencyCode, l as DateParts, m as Day, n as DayPart, o as DayPartConfig, D as DecimalOptions, F as FormatOptions, O as FrankFurter, V as GetChangeOptions, X as GetDifferenceOptions, _ as GetOriginalOptions, $ as GetPercentOptions, a0 as GetValueOptions, G as GreetingConfigs, H as Hour, p as Hours, a1 as InversePercentageOptions, L as LocaleCode, M as Millisecond, q as Minute, r as Minutes, s as Month, t as MonthDate, u as NegativeUTCHour, N as NumberType, P as PercentageOptions, v as PositiveUTCHour, Q as Quarter, R as RandomNumberOptions, e as RangeOptions, f as RangedNumbers, a2 as SIPrefix, w as Second, x as Seconds, y as StrictFormat, S as SupportedCurrency, T as Time, z as TimeDuration, A as TimeFormats, B as TimeParts, E as TimeUnit, I as TimeZone, J as UTCMinute, U as UTCOffSet, a3 as UnitKey, a4 as UnitLabel, a5 as UnitNumberMethods, W as WithoutOrigin, Y as Year, Z as ZodiacSign } from './Chronos-v7ni8eaQ.mjs';
@@ -1,2 +1,2 @@
1
- export { as as AdvancedTypes, a6 as AlphaColors, a7 as AlphaValue, A as AlphaValues, ar as AnagramOptions, a8 as Analogous, v as Any, $ as AsyncFunction, at as Branded, af as CSSColor, C as CapitalizeOptions, a as CaseFormat, K as ClassDetails, a9 as ColorInput, b as ColorInputArray, ab as ColorType, ac as ColorTypeAlpha, ad as ColorTypeSolid, aa as Colors, I as Constructor, ae as ConvertedColors, r as CustomFile, J as DelayedFn, D as DotNotationKey, ak as DotNotationKeyStrict, Y as FalsyPrimitive, m as FieldValue, aj as FileError, s as FileUpload, i as FindOptions, a2 as FirstFieldKey, a3 as FirstFieldValue, u as FlattenPartial, F as Flattened, o as FormDataConfigs, X as FromMetaOptions, a0 as GenericFn, G as GenericObject, al as GenericObjectPrimitive, d as HSL, g as HSLA, au as HasMethods, h as Hex, H as Hex6, e as Hex8, am as KeyForArray, an as KeyForObject, M as MaskOptions, ao as NestedKeyString, ap as NestedPrimitiveKey, av as NonNullishPrimitiveKey, Z as NormalPrimitive, aw as NormalPrimitiveKey, z as Numberified, N as Numeric, a4 as Option, l as OptionsConfig, k as OrderOption, t as OriginFileObj, O as OwnKeys, W as PageListOptions, U as PaginatorMeta, L as PaginatorOptions, p as ParsedFormData, w as PartialOrRequired, P as Percent, _ as Primitive, Q as QueryObject, aq as QueryObjectValue, B as QueryString, c as RGB, f as RGBA, R as RandomIdOptions, x as SanitizeOptions, q as SerializedForm, ag as SolidColors, S as SolidValues, j as SortByOption, n as SortNature, a5 as SortOptions, E as StrictObject, y as Stringified, ah as Tetrad, T as ThrottledFn, ai as Triad, V as VoidFunction } from './types-C33n5Qt0.js';
1
+ export { as as AdvancedTypes, a6 as AlphaColors, a7 as AlphaValue, A as AlphaValues, ar as AnagramOptions, a8 as Analogous, v as Any, $ as AsyncFunction, at as Branded, af as CSSColor, C as CapitalizeOptions, a as CaseFormat, K as ClassDetails, a9 as ColorInput, b as ColorInputArray, ab as ColorType, ac as ColorTypeAlpha, ad as ColorTypeSolid, aa as Colors, I as Constructor, ae as ConvertedColors, r as CustomFile, J as DelayedFn, D as DotNotationKey, ak as DotNotationKeyStrict, Y as FalsyPrimitive, m as FieldValue, aj as FileError, s as FileUpload, i as FindOptions, a2 as FirstFieldKey, a3 as FirstFieldValue, u as FlattenPartial, F as Flattened, o as FormDataConfigs, X as FromMetaOptions, a0 as GenericFn, G as GenericObject, al as GenericObjectPrimitive, d as HSL, g as HSLA, au as HasMethods, h as Hex, H as Hex6, e as Hex8, am as KeyForArray, an as KeyForObject, M as MaskOptions, ao as NestedKeyString, ap as NestedPrimitiveKey, av as NonNullishPrimitiveKey, Z as NormalPrimitive, aw as NormalPrimitiveKey, z as Numberified, N as Numeric, a4 as Option, l as OptionsConfig, k as OrderOption, t as OriginFileObj, O as OwnKeys, W as PageListOptions, U as PaginatorMeta, L as PaginatorOptions, p as ParsedFormData, w as PartialOrRequired, P as Percent, _ as Primitive, Q as QueryObject, aq as QueryObjectValue, B as QueryString, c as RGB, f as RGBA, R as RandomIdOptions, x as SanitizeOptions, q as SerializedForm, ag as SolidColors, S as SolidValues, j as SortByOption, n as SortNature, a5 as SortOptions, E as StrictObject, y as Stringified, ah as Tetrad, T as ThrottledFn, ai as Triad, V as VoidFunction } from './typedefs-C3luCa9l.js';
2
2
  export { K as ApplyChangeOptions, h as ChronosFormat, i as ChronosInput, j as ChronosMethods, k as ChronosObject, C as ChronosStatics, d as ConvertOptions, b as ConvertedDecimal, c as CurrencyCode, l as DateParts, m as Day, n as DayPart, o as DayPartConfig, D as DecimalOptions, F as FormatOptions, O as FrankFurter, V as GetChangeOptions, X as GetDifferenceOptions, _ as GetOriginalOptions, $ as GetPercentOptions, a0 as GetValueOptions, G as GreetingConfigs, H as Hour, p as Hours, a1 as InversePercentageOptions, L as LocaleCode, M as Millisecond, q as Minute, r as Minutes, s as Month, t as MonthDate, u as NegativeUTCHour, N as NumberType, P as PercentageOptions, v as PositiveUTCHour, Q as Quarter, R as RandomNumberOptions, e as RangeOptions, f as RangedNumbers, a2 as SIPrefix, w as Second, x as Seconds, y as StrictFormat, S as SupportedCurrency, T as Time, z as TimeDuration, A as TimeFormats, B as TimeParts, E as TimeUnit, I as TimeZone, J as UTCMinute, U as UTCOffSet, a3 as UnitKey, a4 as UnitLabel, a5 as UnitNumberMethods, W as WithoutOrigin, Y as Year, Z as ZodiacSign } from './Chronos-v7ni8eaQ.js';
@@ -0,0 +1,4 @@
1
+ 'use strict';
2
+
3
+ //# sourceMappingURL=typedefs.js.map
4
+ //# sourceMappingURL=typedefs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"typedefs.js"}
@@ -0,0 +1,3 @@
1
+
2
+ //# sourceMappingURL=typedefs.mjs.map
3
+ //# sourceMappingURL=typedefs.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"typedefs.mjs"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nhb-toolbox",
3
- "version": "4.11.4",
3
+ "version": "4.11.6",
4
4
  "description": "A versatile collection of smart, efficient, and reusable utility functions and classes for everyday development needs.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -49,40 +49,27 @@
49
49
  },
50
50
  "exports": {
51
51
  ".": {
52
- "import": {
53
- "types": "./dist/index.d.mts",
54
- "default": "./dist/index.mjs"
55
- },
56
- "require": {
57
- "types": "./dist/index.d.ts",
58
- "default": "./dist/index.js"
59
- }
52
+ "types": "./dist/index.d.ts",
53
+ "import": "./dist/index.mjs",
54
+ "require": "./dist/index.js"
60
55
  },
61
56
  "./types": {
62
- "import": {
63
- "types": "./dist/dts/types/index.d.mts",
64
- "default": "./dist/dts/types/index.d.mts"
65
- },
66
- "require": {
67
- "types": "./dist/dts/types/index.d.ts",
68
- "default": "./dist/dts/types/index.d.ts"
69
- }
70
- },
71
- "./chronos": {
72
- "import": {
73
- "types": "./dist/chronos.d.mts",
74
- "default": "./dist/chronos.mjs"
75
- },
76
- "require": {
77
- "types": "./dist/chronos.d.ts",
78
- "default": "./dist/chronos.js"
79
- }
57
+ "types": "./dist/typedefs.d.ts",
58
+ "default": "./dist/typedefs.d.ts"
80
59
  }
81
60
  },
61
+ "./chronos": {
62
+ "types": "./dist/chronos.d.ts",
63
+ "import": "./dist/chronos.mjs",
64
+ "require": "./dist/chronos.js"
65
+ },
82
66
  "typesVersions": {
83
67
  "*": {
84
68
  "chronos": [
85
69
  "dist/chronos.d.ts"
70
+ ],
71
+ "types": [
72
+ "dist/typedefs.d.ts"
86
73
  ]
87
74
  }
88
75
  },
package/dist/types.js DELETED
@@ -1,4 +0,0 @@
1
- 'use strict';
2
-
3
- //# sourceMappingURL=types.js.map
4
- //# sourceMappingURL=types.js.map
package/dist/types.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"types.js"}
package/dist/types.mjs DELETED
@@ -1,3 +0,0 @@
1
-
2
- //# sourceMappingURL=types.mjs.map
3
- //# sourceMappingURL=types.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"types.mjs"}