nhb-toolbox 1.0.2 → 1.0.4

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.
@@ -1,4 +1,4 @@
1
- import type { Flattened, ConfigOptions, OptionInput } from './types';
1
+ import type { Flattened, ConfigOptions, OptionInput, SortOptions, InputObject, OrderOption } from './types';
2
2
  /**
3
3
  * * Flattens a nested array recursively or wraps any non-array data type in an array.
4
4
  *
@@ -16,4 +16,39 @@ export declare const flattenArray: <T>(input: T | T[]) => Flattened<T>[];
16
16
  * @returns An array of options, where each option has `value` and `label` fields as default or as specified by user in the config options.
17
17
  */
18
18
  export declare const createOptionsArray: <T extends OptionInput, K1 extends string = "value", K2 extends string = "label">(data: T[], config: ConfigOptions<T, K1, K2>) => { [P in K1 | K2]: string; }[];
19
+ /**
20
+ * * Sorts an array of strings.
21
+ *
22
+ * @param array - The array of strings to sort.
23
+ * @param options - Sorting options.
24
+ * @returns The sorted array.
25
+ */
26
+ export declare function sortAnArray(array: string[], options?: OrderOption): string[];
27
+ /**
28
+ * * Sorts an array of numbers.
29
+ *
30
+ * @param array - The array of numbers to sort.
31
+ * @param options - Sorting options.
32
+ * @returns The sorted array.
33
+ */
34
+ export declare function sortAnArray(array: number[], options?: OrderOption): number[];
35
+ /**
36
+ * * Sorts an array of booleans.
37
+ *
38
+ * @param array - The array of booleans to sort.
39
+ * @param options - Sorting options.
40
+ * @returns The sorted array.
41
+ */
42
+ export declare function sortAnArray(array: boolean[], options?: OrderOption): boolean[];
43
+ /**
44
+ * * Sorts an array of objects.
45
+ *
46
+ * - Sorts array by the specified field.
47
+ *
48
+ * @template T - The type of objects in the array.
49
+ * @param array - The array of objects to sort.
50
+ * @param options - Sorting options.
51
+ * @returns The sorted array.
52
+ */
53
+ export declare function sortAnArray<T extends InputObject>(array: T[], options: SortOptions<T>): T[];
19
54
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/array/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAErE;;;;;;GAMG;AACH,eAAO,MAAM,YAAY,GAAI,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,KAAG,SAAS,CAAC,CAAC,CAAC,EAO5D,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB,GAC9B,CAAC,SAAS,WAAW,EACrB,EAAE,SAAS,MAAM,YACjB,EAAE,SAAS,MAAM,kBAEX,CAAC,EAAE,UACD,aAAa,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,KAC9B,GAAG,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,MAAM,GAAE,EAe5B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/array/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,SAAS,EACT,aAAa,EACb,WAAW,EACX,WAAW,EACX,WAAW,EACX,WAAW,EACX,MAAM,SAAS,CAAC;AAEjB;;;;;;GAMG;AACH,eAAO,MAAM,YAAY,GAAI,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,KAAG,SAAS,CAAC,CAAC,CAAC,EAO5D,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB,GAC9B,CAAC,SAAS,WAAW,EACrB,EAAE,SAAS,MAAM,YACjB,EAAE,SAAS,MAAM,kBAEX,CAAC,EAAE,UACD,aAAa,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,KAC9B,GAAG,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,MAAM,GAAE,EAe5B,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,MAAM,EAAE,CAAC;AAE9E;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,MAAM,EAAE,CAAC;AAE9E;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,EAAE,CAAC;AAEhF;;;;;;;;;GASG;AACH,wBAAgB,WAAW,CAAC,CAAC,SAAS,WAAW,EAChD,KAAK,EAAE,CAAC,EAAE,EACV,OAAO,EAAE,WAAW,CAAC,CAAC,CAAC,GACrB,CAAC,EAAE,CAAC"}
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createOptionsArray = exports.flattenArray = void 0;
4
+ exports.sortAnArray = sortAnArray;
4
5
  /**
5
6
  * * Flattens a nested array recursively or wraps any non-array data type in an array.
6
7
  *
@@ -38,3 +39,62 @@ const createOptionsArray = (data, config) => {
38
39
  }
39
40
  };
40
41
  exports.createOptionsArray = createOptionsArray;
42
+ /**
43
+ * * Sorts an array of strings, numbers, booleans, or objects based on the provided options.
44
+ *
45
+ * - If the array contains strings, it sorts them alphabetically.
46
+ * - If the array contains numbers, it sorts them numerically.
47
+ * - If the array contains booleans, it sorts them by their boolean value.
48
+ * - If the array contains objects, it sorts them by the specified field.
49
+ * @template T - The type of objects in the array.
50
+ * @param array - The array to sort.
51
+ * @param options - Sorting options for objects.
52
+ * @returns The sorted array.
53
+ */
54
+ function sortAnArray(array, options) {
55
+ if (!Array.isArray(array) || array.length === 0)
56
+ return array;
57
+ // Check if the array contains strings
58
+ if (typeof array[0] === 'string') {
59
+ return [...array].sort((a, b) => options?.sortOrder === 'desc'
60
+ ? b.localeCompare(a)
61
+ : a.localeCompare(b));
62
+ }
63
+ // Check if the array contains numbers
64
+ if (typeof array[0] === 'number') {
65
+ return [...array].sort((a, b) => options?.sortOrder === 'desc'
66
+ ? b - a
67
+ : a - b);
68
+ }
69
+ // Check if the array contains booleans
70
+ if (typeof array[0] === 'boolean') {
71
+ return [...array].sort((a, b) => options?.sortOrder === 'desc'
72
+ ? Number(b) - Number(a)
73
+ : Number(a) - Number(b));
74
+ }
75
+ // Handle object arrays
76
+ if (options?.sortByField) {
77
+ return [...array].sort((a, b) => {
78
+ const key = options.sortByField;
79
+ const keyA = a[key];
80
+ const keyB = b[key];
81
+ if (typeof keyA === 'string' && typeof keyB === 'string') {
82
+ return options?.sortOrder === 'desc'
83
+ ? keyB.localeCompare(keyA)
84
+ : keyA.localeCompare(keyB);
85
+ }
86
+ if (typeof keyA === 'number' && typeof keyB === 'number') {
87
+ return options?.sortOrder === 'desc'
88
+ ? keyB - keyA
89
+ : keyA - keyB;
90
+ }
91
+ if (typeof keyA === 'boolean' && typeof keyB === 'boolean') {
92
+ return options?.sortOrder === 'desc'
93
+ ? Number(keyB) - Number(keyA)
94
+ : Number(keyA) - Number(keyB);
95
+ }
96
+ throw new Error('Cannot compare non-string/non-number/non-boolean properties.');
97
+ });
98
+ }
99
+ throw new Error('Invalid array or missing "sortByField" for objects.');
100
+ }
@@ -1,6 +1,10 @@
1
- /** - Flatten Array */
1
+ /**
2
+ * * Flatten Array or Wrap in Array
3
+ *
4
+ * @template T - The type of the input, which can be a nested array or a non-array value.
5
+ * */
2
6
  export type Flattened<T> = T extends (infer U)[] ? Flattened<U> : T;
3
- /** */
7
+ /** - Input for `createOptionsArray`. */
4
8
  export type OptionInput = Record<string, string | number | null | undefined>;
5
9
  /**
6
10
  * - Configuration for `createOptionsArray`.
@@ -34,4 +38,23 @@ export interface ConfigOptions<T extends Record<string, string | number | null |
34
38
  */
35
39
  secondFieldName?: K2;
36
40
  }
41
+ /** - Object type with string or number as value for each key. */
42
+ export type InputObject = Record<string, string | number | boolean>;
43
+ /** - Option for sorting order. */
44
+ export interface OrderOption {
45
+ /**
46
+ * * The order in which to sort the array. Defaults to `'asc'`.
47
+ * - `'asc'`: Sort in ascending order.
48
+ * - `'desc'`: Sort in descending order.
49
+ */
50
+ sortOrder?: 'asc' | 'desc';
51
+ }
52
+ /**
53
+ * * Options for sorting an array of objects.
54
+ * @template T - The type of objects in the array.
55
+ */
56
+ export interface SortOptions<T extends InputObject> extends OrderOption {
57
+ /** The field by which to sort the objects in the array. */
58
+ sortByField?: keyof T;
59
+ }
37
60
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/array/types.ts"],"names":[],"mappings":"AAAA,sBAAsB;AACtB,MAAM,MAAM,SAAS,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,GAAG,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;AAEpE,OAAO;AACP,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC,CAAC;AAE7E;;;;;;;GAOG;AACH,MAAM,WAAW,aAAa,CAC7B,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC,EAC5D,EAAE,SAAS,MAAM,GAAG,OAAO,EAC3B,EAAE,SAAS,MAAM,GAAG,OAAO;IAE3B;;;OAGG;IACH,aAAa,EAAE,MAAM,CAAC,CAAC;IAEvB;;;OAGG;IACH,cAAc,EAAE,MAAM,CAAC,CAAC;IAExB;;;;OAIG;IACH,cAAc,CAAC,EAAE,EAAE,CAAC;IAEpB;;;;OAIG;IACH,eAAe,CAAC,EAAE,EAAE,CAAC;CACrB"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/array/types.ts"],"names":[],"mappings":"AAAA;;;;MAIM;AACN,MAAM,MAAM,SAAS,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,GAAG,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;AAEpE,wCAAwC;AACxC,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC,CAAC;AAE7E;;;;;;;GAOG;AACH,MAAM,WAAW,aAAa,CAC7B,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC,EAC5D,EAAE,SAAS,MAAM,GAAG,OAAO,EAC3B,EAAE,SAAS,MAAM,GAAG,OAAO;IAE3B;;;OAGG;IACH,aAAa,EAAE,MAAM,CAAC,CAAC;IAEvB;;;OAGG;IACH,cAAc,EAAE,MAAM,CAAC,CAAC;IAExB;;;;OAIG;IACH,cAAc,CAAC,EAAE,EAAE,CAAC;IAEpB;;;;OAIG;IACH,eAAe,CAAC,EAAE,EAAE,CAAC;CACrB;AAED,iEAAiE;AACjE,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC;AAEpE,kCAAkC;AAClC,MAAM,WAAW,WAAW;IAC3B;;;;OAIG;IACH,SAAS,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;CAC3B;AAED;;;GAGG;AACH,MAAM,WAAW,WAAW,CAAC,CAAC,SAAS,WAAW,CAAE,SAAQ,WAAW;IACtE,2DAA2D;IAC3D,WAAW,CAAC,EAAE,MAAM,CAAC,CAAC;CACtB"}
@@ -1,6 +1,6 @@
1
1
  import type { ColorInput, ColorInputArray, OpacityValue } from './types';
2
2
  /**
3
- * * Generates a hex color based on the first character of a string or number.
3
+ * * Generates a hex color based on the first character (initial) of a string or number.
4
4
  *
5
5
  * - For numbers, it uses 10 predefined colors (0-9).
6
6
  * - For letters, it uses 26 predefined colors (A-Z).
@@ -9,9 +9,9 @@ import type { ColorInput, ColorInputArray, OpacityValue } from './types';
9
9
  * @param opacity - A value from 0 to 100 representing the opacity percentage.
10
10
  * @returns A hex color for the first character of the provided string/number.
11
11
  */
12
- export declare function getColorForFirstCharacter(input?: ColorInput, opacity?: OpacityValue): string;
12
+ export declare function getColorForInitial(input: ColorInput, opacity?: OpacityValue): string;
13
13
  /**
14
- * * Generates an array of hex colors based on the first character of an array of strings/numbers or even nested arrays of strings/numbers.
14
+ * * Generates an array of hex colors based on the first character (initial) of an array of strings/numbers or even nested arrays of strings/numbers.
15
15
  *
16
16
  * - For numbers, it uses 10 predefined colors (0-9).
17
17
  * - For letters, it uses 26 predefined colors (A-Z).
@@ -21,5 +21,5 @@ export declare function getColorForFirstCharacter(input?: ColorInput, opacity?:
21
21
  * @param opacity - A value from 0 to 100 representing the opacity percentage.
22
22
  * @returns A hex color for a string/number, or an array of hex colors for each element of the provided array.
23
23
  */
24
- export declare function getColorForFirstCharacter(input: ColorInputArray, opacity?: OpacityValue): string[];
24
+ export declare function getColorForInitial(input: ColorInputArray, opacity?: OpacityValue): string[];
25
25
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/colors/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAGzE;;;;;;;;;GASG;AACH,wBAAgB,yBAAyB,CACxC,KAAK,CAAC,EAAE,UAAU,EAClB,OAAO,CAAC,EAAE,YAAY,GACpB,MAAM,CAAC;AAEV;;;;;;;;;;GAUG;AACH,wBAAgB,yBAAyB,CACxC,KAAK,EAAE,eAAe,EACtB,OAAO,CAAC,EAAE,YAAY,GACpB,MAAM,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/colors/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAGzE;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CACjC,KAAK,EAAE,UAAU,EACjB,OAAO,CAAC,EAAE,YAAY,GACpB,MAAM,CAAC;AAEV;;;;;;;;;;GAUG;AACH,wBAAgB,kBAAkB,CACjC,KAAK,EAAE,eAAe,EACtB,OAAO,CAAC,EAAE,YAAY,GACpB,MAAM,EAAE,CAAC"}
@@ -1,10 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getColorForFirstCharacter = getColorForFirstCharacter;
3
+ exports.getColorForInitial = getColorForInitial;
4
4
  const helpers_1 = require("./helpers");
5
5
  const constants_1 = require("./constants");
6
6
  /**
7
- * * Generates an array of hex colors based on the first character of an array of strings/numbers or even nested arrays of strings/numbers.
7
+ * * Generates a hex color based on the first character (initial) of a string or number;
8
+ * or an array of hex colors based on the first character (initial) of an array of strings/numbers or even nested arrays of strings/numbers.
8
9
  *
9
10
  * - For numbers, it uses 10 predefined colors (0-9).
10
11
  * - For letters, it uses 26 predefined colors (A-Z).
@@ -14,7 +15,7 @@ const constants_1 = require("./constants");
14
15
  * @param opacity - A value from 0 to 100 representing the opacity percentage.
15
16
  * @returns A hex color for a string/number, or an array of hex colors for each element of the provided array.
16
17
  */
17
- function getColorForFirstCharacter(input = '', opacity = 100) {
18
+ function getColorForInitial(input = '', opacity = 100) {
18
19
  let initial;
19
20
  const hexOpacity = (0, helpers_1.convertOpacityToHex)(opacity);
20
21
  const numbers = '0123456789';
@@ -51,9 +52,9 @@ function getColorForFirstCharacter(input = '', opacity = 100) {
51
52
  return input
52
53
  .map((el) => {
53
54
  if (Array.isArray(el)) {
54
- return getColorForFirstCharacter(el, opacity);
55
+ return getColorForInitial(el, opacity);
55
56
  }
56
- return getColorForFirstCharacter(el, opacity);
57
+ return getColorForInitial(el, opacity);
57
58
  })
58
59
  .flat();
59
60
  }
package/dist/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  export { capitalizeString, truncateString, generateRandomID } from './string';
2
2
  export { getRandomNumber, convertToDecimal } from './number';
3
- export { getColorForFirstCharacter } from './colors';
3
+ export { getColorForInitial } from './colors';
4
4
  export { generateRandomColor } from './colors/random';
5
5
  export { convertHexToHsl, convertHexToRgb, convertHslToHex, convertHslToRgb, convertRgbToHex, convertRgbToHsl, } from './colors/convert';
6
- export { flattenArray, createOptionsArray, } from './array';
6
+ export { flattenArray, createOptionsArray, sortAnArray } from './array';
7
7
  export { generateQueryParams, cloneObject, isDeepEqual, mergeObjects, flattenObject, mergeAndFlattenObjects, isEmptyObject, countObjectFields, } from './object';
8
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAE9E,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAE7D,OAAO,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;AAErD,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAEtD,OAAO,EACN,eAAe,EACf,eAAe,EACf,eAAe,EACf,eAAe,EACf,eAAe,EACf,eAAe,GACf,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACN,YAAY,EACZ,kBAAkB,GAClB,MAAM,SAAS,CAAC;AAEjB,OAAO,EACN,mBAAmB,EACnB,WAAW,EACX,WAAW,EACX,YAAY,EACZ,aAAa,EACb,sBAAsB,EACtB,aAAa,EACb,iBAAiB,GACjB,MAAM,UAAU,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAE9E,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAE7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAE9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAEtD,OAAO,EACN,eAAe,EACf,eAAe,EACf,eAAe,EACf,eAAe,EACf,eAAe,EACf,eAAe,GACf,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAExE,OAAO,EACN,mBAAmB,EACnB,WAAW,EACX,WAAW,EACX,YAAY,EACZ,aAAa,EACb,sBAAsB,EACtB,aAAa,EACb,iBAAiB,GACjB,MAAM,UAAU,CAAC"}
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.countObjectFields = exports.isEmptyObject = exports.mergeAndFlattenObjects = exports.flattenObject = exports.mergeObjects = exports.isDeepEqual = exports.cloneObject = exports.generateQueryParams = exports.createOptionsArray = exports.flattenArray = exports.convertRgbToHsl = exports.convertRgbToHex = exports.convertHslToRgb = exports.convertHslToHex = exports.convertHexToRgb = exports.convertHexToHsl = exports.generateRandomColor = exports.getColorForFirstCharacter = exports.convertToDecimal = exports.getRandomNumber = exports.generateRandomID = exports.truncateString = exports.capitalizeString = void 0;
3
+ exports.countObjectFields = exports.isEmptyObject = exports.mergeAndFlattenObjects = exports.flattenObject = exports.mergeObjects = exports.isDeepEqual = exports.cloneObject = exports.generateQueryParams = exports.sortAnArray = exports.createOptionsArray = exports.flattenArray = exports.convertRgbToHsl = exports.convertRgbToHex = exports.convertHslToRgb = exports.convertHslToHex = exports.convertHexToRgb = exports.convertHexToHsl = exports.generateRandomColor = exports.getColorForInitial = exports.convertToDecimal = exports.getRandomNumber = exports.generateRandomID = exports.truncateString = exports.capitalizeString = void 0;
4
4
  var string_1 = require("./string");
5
5
  Object.defineProperty(exports, "capitalizeString", { enumerable: true, get: function () { return string_1.capitalizeString; } });
6
6
  Object.defineProperty(exports, "truncateString", { enumerable: true, get: function () { return string_1.truncateString; } });
@@ -9,7 +9,7 @@ var number_1 = require("./number");
9
9
  Object.defineProperty(exports, "getRandomNumber", { enumerable: true, get: function () { return number_1.getRandomNumber; } });
10
10
  Object.defineProperty(exports, "convertToDecimal", { enumerable: true, get: function () { return number_1.convertToDecimal; } });
11
11
  var colors_1 = require("./colors");
12
- Object.defineProperty(exports, "getColorForFirstCharacter", { enumerable: true, get: function () { return colors_1.getColorForFirstCharacter; } });
12
+ Object.defineProperty(exports, "getColorForInitial", { enumerable: true, get: function () { return colors_1.getColorForInitial; } });
13
13
  var random_1 = require("./colors/random");
14
14
  Object.defineProperty(exports, "generateRandomColor", { enumerable: true, get: function () { return random_1.generateRandomColor; } });
15
15
  var convert_1 = require("./colors/convert");
@@ -22,6 +22,7 @@ Object.defineProperty(exports, "convertRgbToHsl", { enumerable: true, get: funct
22
22
  var array_1 = require("./array");
23
23
  Object.defineProperty(exports, "flattenArray", { enumerable: true, get: function () { return array_1.flattenArray; } });
24
24
  Object.defineProperty(exports, "createOptionsArray", { enumerable: true, get: function () { return array_1.createOptionsArray; } });
25
+ Object.defineProperty(exports, "sortAnArray", { enumerable: true, get: function () { return array_1.sortAnArray; } });
25
26
  var object_1 = require("./object");
26
27
  Object.defineProperty(exports, "generateQueryParams", { enumerable: true, get: function () { return object_1.generateQueryParams; } });
27
28
  Object.defineProperty(exports, "cloneObject", { enumerable: true, get: function () { return object_1.cloneObject; } });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nhb-toolbox",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "description": "A versatile collection of smart, efficient, and reusable utility functions for everyday development needs.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",