@dereekb/util 10.1.10 → 10.1.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dereekb/util",
3
- "version": "10.1.10",
3
+ "version": "10.1.12",
4
4
  "exports": {
5
5
  ".": {
6
6
  "types": "./src/index.d.ts",
@@ -36,3 +36,60 @@ export interface ComputeFractionalHour {
36
36
  readonly hours?: Maybe<Hours>;
37
37
  }
38
38
  export declare function computeNextFractionalHour(input: FractionalHour, change: ComputeFractionalHour): FractionalHour;
39
+ /**
40
+ * The minute of the day.
41
+ *
42
+ * Number from 0-1439.
43
+ */
44
+ export type MinuteOfDay = number;
45
+ /**
46
+ * A pair of hours and minutes.
47
+ */
48
+ export interface HoursAndMinutes {
49
+ readonly hour: number;
50
+ readonly minute: number;
51
+ }
52
+ /**
53
+ * Converts the input number of minutes to the equivalent in hours and minutes.
54
+ *
55
+ * @param inputMinutes
56
+ * @returns
57
+ */
58
+ export declare function minutesToHoursAndMinutes(inputMinutes: Minutes): HoursAndMinutes;
59
+ /**
60
+ * Reads the hour and minutes of the Date.
61
+ *
62
+ * @param date
63
+ * @returns
64
+ */
65
+ export declare function dateToHoursAndMinutes(date: Date): HoursAndMinutes;
66
+ /**
67
+ * Converts the input hours and minutes to a MinuteOfDay.
68
+ *
69
+ * @param hour
70
+ * @param minute
71
+ * @returns
72
+ */
73
+ export declare function toMinuteOfDay(hour: Hours, minute: Minutes): MinuteOfDay;
74
+ /**
75
+ * Creates a new date from the minute of the day.
76
+ *
77
+ * @param minuteOfDay
78
+ * @param day
79
+ * @returns
80
+ */
81
+ export declare function dateFromMinuteOfDay(minuteOfDay: Minutes | MinuteOfDay, day?: Date): Date;
82
+ /**
83
+ * Converts a Date to a MinuteOfDay.
84
+ *
85
+ * @param date
86
+ * @returns
87
+ */
88
+ export declare function dateToMinuteOfDay(date: Date): MinuteOfDay;
89
+ /**
90
+ * Converts the input minutes to a MinuteOfDay.
91
+ *
92
+ * @param minutes
93
+ * @returns
94
+ */
95
+ export declare function asMinuteOfDay(minutes: Minutes): MinuteOfDay;
@@ -8,7 +8,33 @@ import { type Maybe } from '../value/maybe.type';
8
8
  */
9
9
  export type IterableOrValue<T> = T | Iterable<T>;
10
10
  export declare function asIterable<T = unknown>(values: IterableOrValue<T>, treatStringAsIterable?: boolean): Iterable<T>;
11
+ /**
12
+ * Converts the input IterableOrValue value to an array.
13
+ *
14
+ * By default will treat strings as a non-iterable value, using the string as a single value.
15
+ *
16
+ * @param values
17
+ * @param treatStringAsIterable
18
+ * @returns
19
+ */
11
20
  export declare function iterableToArray<T = unknown>(values: IterableOrValue<T>, treatStringAsIterable?: boolean): T[];
21
+ /**
22
+ * Converts the input IterableOrValue value to a Set.
23
+ *
24
+ * By default will treat strings as a non-iterable value, using the string as a single value.
25
+ *
26
+ * @param values
27
+ * @param treatStringAsIterable
28
+ * @returns
29
+ */
30
+ export declare function iterableToSet<T = unknown>(values: IterableOrValue<T>, treatStringAsIterable?: boolean): Set<T>;
31
+ /**
32
+ * Converts the input IterableOrValue value to a Map using the input readKey function.
33
+ *
34
+ * @param values
35
+ * @param readKey
36
+ * @returns
37
+ */
12
38
  export declare function iterableToMap<T, K extends PrimativeKey = PrimativeKey>(values: IterableOrValue<T>, readKey: ReadKeyFunction<T, K>): Map<Maybe<K>, T>;
13
39
  /**
14
40
  * Returns true if the input is an Iterable.
package/test/CHANGELOG.md CHANGED
@@ -2,6 +2,14 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ ## [10.1.12](https://github.com/dereekb/dbx-components/compare/v10.1.11-dev...v10.1.12) (2024-04-30)
6
+
7
+
8
+
9
+ ## [10.1.11](https://github.com/dereekb/dbx-components/compare/v10.1.10-dev...v10.1.11) (2024-04-27)
10
+
11
+
12
+
5
13
  ## [10.1.10](https://github.com/dereekb/dbx-components/compare/v10.1.9-dev...v10.1.10) (2024-04-12)
6
14
 
7
15
 
package/test/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dereekb/util/test",
3
- "version": "10.1.10",
3
+ "version": "10.1.12",
4
4
  "type": "commonjs",
5
5
  "peerDependencies": {
6
6
  "@dereekb/util": "*"