@oscarpalmer/atoms 0.75.0 → 0.76.0

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.
Files changed (215) hide show
  1. package/dist/js/array/chunk.cjs +2 -1
  2. package/dist/js/array/chunk.js +2 -1
  3. package/dist/js/array/count.cjs +10 -3
  4. package/dist/js/array/count.js +10 -3
  5. package/dist/js/array/exists.cjs +10 -3
  6. package/dist/js/array/exists.js +10 -3
  7. package/dist/js/array/filter.cjs +10 -3
  8. package/dist/js/array/filter.js +10 -3
  9. package/dist/js/array/find.cjs +10 -3
  10. package/dist/js/array/find.js +10 -3
  11. package/dist/js/array/group-by.cjs +18 -16
  12. package/dist/js/array/group-by.js +18 -16
  13. package/dist/js/array/index-of.cjs +10 -3
  14. package/dist/js/array/index-of.js +10 -3
  15. package/dist/js/array/index.cjs +2 -2
  16. package/dist/js/array/index.js +2 -2
  17. package/dist/js/array/insert.cjs +10 -4
  18. package/dist/js/array/insert.js +10 -4
  19. package/dist/js/array/splice.cjs +4 -4
  20. package/dist/js/array/splice.js +4 -4
  21. package/dist/js/array/to-map.cjs +11 -11
  22. package/dist/js/array/to-map.js +11 -11
  23. package/dist/js/array/to-record.cjs +3 -3
  24. package/dist/js/array/to-record.js +3 -3
  25. package/dist/js/array/unique.cjs +2 -2
  26. package/dist/js/array/unique.js +2 -2
  27. package/dist/js/colour/base.cjs +1 -1
  28. package/dist/js/colour/base.js +1 -1
  29. package/dist/js/colour/hex.cjs +2 -2
  30. package/dist/js/colour/hex.js +2 -2
  31. package/dist/js/colour/hsl.cjs +13 -7
  32. package/dist/js/colour/hsl.js +13 -7
  33. package/dist/js/colour/rgb.cjs +12 -6
  34. package/dist/js/colour/rgb.js +12 -6
  35. package/dist/js/emitter.cjs +8 -5
  36. package/dist/js/emitter.js +8 -5
  37. package/dist/js/function.cjs +6 -6
  38. package/dist/js/function.js +6 -6
  39. package/dist/js/index.cjs +0 -1
  40. package/dist/js/index.js +1 -2
  41. package/dist/js/internal/array/callbacks.cjs +23 -0
  42. package/dist/js/internal/array/callbacks.js +23 -0
  43. package/dist/js/internal/{array-find.cjs → array/find.cjs} +11 -12
  44. package/dist/js/internal/{array-find.js → array/find.js} +11 -12
  45. package/dist/js/logger.cjs +13 -13
  46. package/dist/js/logger.js +13 -13
  47. package/dist/js/query.cjs +0 -3
  48. package/dist/js/query.js +1 -4
  49. package/dist/js/random.cjs +0 -6
  50. package/dist/js/random.js +0 -6
  51. package/dist/js/sized.cjs +1 -1
  52. package/dist/js/sized.js +1 -1
  53. package/dist/js/string/index.cjs +7 -1
  54. package/dist/js/string/index.js +7 -1
  55. package/dist/js/value/compare.cjs +0 -1
  56. package/dist/js/value/compare.js +0 -1
  57. package/dist/js/value/get.cjs +3 -3
  58. package/dist/js/value/get.js +2 -2
  59. package/dist/js/value/set.cjs +4 -4
  60. package/dist/js/value/set.js +2 -2
  61. package/package.json +3 -2
  62. package/src/js/array/chunk.ts +6 -5
  63. package/src/js/array/compact.ts +8 -10
  64. package/src/js/array/count.ts +39 -19
  65. package/src/js/array/exists.ts +40 -16
  66. package/src/js/array/filter.ts +42 -20
  67. package/src/js/array/find.ts +45 -20
  68. package/src/js/array/group-by.ts +158 -27
  69. package/src/js/array/index-of.ts +40 -18
  70. package/src/js/array/index.ts +10 -9
  71. package/src/js/array/insert.ts +28 -14
  72. package/src/js/array/models.ts +18 -15
  73. package/src/js/array/shuffle.ts +3 -3
  74. package/src/js/array/sort.ts +28 -34
  75. package/src/js/array/splice.ts +22 -26
  76. package/src/js/array/to-map.ts +133 -45
  77. package/src/js/array/to-record.ts +137 -39
  78. package/src/js/array/unique.ts +20 -15
  79. package/src/js/colour/base.ts +3 -3
  80. package/src/js/colour/functions.ts +4 -6
  81. package/src/js/colour/hex.ts +5 -5
  82. package/src/js/colour/hsl.ts +18 -12
  83. package/src/js/colour/index.ts +1 -1
  84. package/src/js/colour/is.ts +3 -3
  85. package/src/js/colour/rgb.ts +17 -11
  86. package/src/js/emitter.ts +12 -9
  87. package/src/js/function.ts +12 -12
  88. package/src/js/index.ts +16 -16
  89. package/src/js/internal/array/callbacks.ts +33 -0
  90. package/src/js/internal/{array-find.ts → array/find.ts} +23 -24
  91. package/src/js/internal/{value-handle.ts → value/handle.ts} +1 -1
  92. package/src/js/is.ts +2 -2
  93. package/src/js/logger.ts +14 -14
  94. package/src/js/math.ts +1 -1
  95. package/src/js/models.ts +5 -5
  96. package/src/js/number.ts +2 -2
  97. package/src/js/query.ts +6 -10
  98. package/src/js/queue.ts +1 -1
  99. package/src/js/random.ts +9 -19
  100. package/src/js/sized.ts +145 -145
  101. package/src/js/string/case.ts +1 -1
  102. package/src/js/string/index.ts +13 -7
  103. package/src/js/string/template.ts +6 -3
  104. package/src/js/value/clone.ts +3 -7
  105. package/src/js/value/compare.ts +3 -5
  106. package/src/js/value/diff.ts +4 -4
  107. package/src/js/value/equal.ts +2 -2
  108. package/src/js/value/get.ts +3 -3
  109. package/src/js/value/index.ts +2 -2
  110. package/src/js/value/merge.ts +3 -3
  111. package/src/js/value/set.ts +3 -4
  112. package/src/js/value/smush.ts +4 -4
  113. package/src/js/value/unsmush.ts +4 -4
  114. package/types/array/chunk.d.cts +2 -2
  115. package/types/array/chunk.d.ts +2 -2
  116. package/types/array/compact.d.cts +4 -4
  117. package/types/array/compact.d.ts +4 -4
  118. package/types/array/count.d.cts +15 -8
  119. package/types/array/count.d.ts +13 -7
  120. package/types/array/exists.d.cts +14 -5
  121. package/types/array/exists.d.ts +12 -4
  122. package/types/array/filter.d.cts +16 -7
  123. package/types/array/filter.d.ts +14 -6
  124. package/types/array/find.d.cts +16 -7
  125. package/types/array/find.d.ts +14 -6
  126. package/types/array/group-by.d.cts +51 -5
  127. package/types/array/group-by.d.ts +49 -5
  128. package/types/array/index-of.d.cts +16 -7
  129. package/types/array/index-of.d.ts +14 -6
  130. package/types/array/index.d.cts +239 -95
  131. package/types/array/index.d.ts +7 -6
  132. package/types/array/insert.d.cts +9 -4
  133. package/types/array/insert.d.ts +10 -5
  134. package/types/array/models.d.cts +14 -11
  135. package/types/array/models.d.ts +14 -12
  136. package/types/array/shuffle.d.cts +2 -2
  137. package/types/array/shuffle.d.ts +2 -2
  138. package/types/array/sort.d.cts +11 -11
  139. package/types/array/sort.d.ts +10 -10
  140. package/types/array/splice.d.cts +4 -4
  141. package/types/array/splice.d.ts +4 -4
  142. package/types/array/to-map.d.cts +44 -20
  143. package/types/array/to-map.d.ts +42 -20
  144. package/types/array/to-record.d.cts +44 -20
  145. package/types/array/to-record.d.ts +42 -20
  146. package/types/array/unique.d.cts +11 -6
  147. package/types/array/unique.d.ts +10 -6
  148. package/types/colour/base.d.cts +28 -16
  149. package/types/colour/base.d.ts +2 -2
  150. package/types/colour/functions.d.cts +28 -16
  151. package/types/colour/functions.d.ts +3 -3
  152. package/types/colour/hex.d.cts +28 -16
  153. package/types/colour/hex.d.ts +4 -4
  154. package/types/colour/hsl.d.cts +28 -16
  155. package/types/colour/hsl.d.ts +16 -10
  156. package/types/colour/index.d.cts +28 -16
  157. package/types/colour/index.d.ts +1 -1
  158. package/types/colour/is.d.cts +28 -16
  159. package/types/colour/is.d.ts +3 -3
  160. package/types/colour/rgb.d.cts +28 -16
  161. package/types/colour/rgb.d.ts +15 -9
  162. package/types/emitter.d.cts +11 -8
  163. package/types/emitter.d.ts +11 -8
  164. package/types/function.d.cts +10 -10
  165. package/types/function.d.ts +11 -11
  166. package/types/index.d.cts +1061 -669
  167. package/types/index.d.ts +16 -16
  168. package/types/internal/array/callbacks.d.cts +11 -0
  169. package/types/internal/array/callbacks.d.ts +2 -0
  170. package/types/internal/array/find.d.cts +7 -0
  171. package/types/internal/array/find.d.ts +3 -0
  172. package/types/internal/{value-handle.d.ts → value/handle.d.ts} +1 -1
  173. package/types/is.d.ts +1 -1
  174. package/types/logger.d.cts +13 -13
  175. package/types/logger.d.ts +13 -13
  176. package/types/math.d.cts +1 -1
  177. package/types/math.d.ts +1 -1
  178. package/types/models.d.cts +4 -4
  179. package/types/models.d.ts +1 -4
  180. package/types/number.d.cts +2 -2
  181. package/types/number.d.ts +2 -2
  182. package/types/query.d.cts +2 -2
  183. package/types/query.d.ts +3 -3
  184. package/types/queue.d.cts +1 -1
  185. package/types/queue.d.ts +1 -1
  186. package/types/random.d.cts +8 -12
  187. package/types/random.d.ts +8 -12
  188. package/types/sized.d.cts +6 -6
  189. package/types/sized.d.ts +6 -6
  190. package/types/string/index.d.cts +6 -3
  191. package/types/string/index.d.ts +3 -3
  192. package/types/string/template.d.cts +3 -0
  193. package/types/string/template.d.ts +4 -1
  194. package/types/value/clone.d.cts +4 -2
  195. package/types/value/clone.d.ts +4 -2
  196. package/types/value/get.d.ts +1 -1
  197. package/types/value/index.d.cts +8 -6
  198. package/types/value/index.d.ts +2 -2
  199. package/types/value/merge.d.cts +1 -1
  200. package/types/value/merge.d.ts +2 -2
  201. package/types/value/set.d.ts +1 -1
  202. package/types/value/smush.d.cts +1 -1
  203. package/types/value/smush.d.ts +2 -2
  204. package/types/value/unsmush.d.cts +1 -1
  205. package/types/value/unsmush.d.ts +2 -2
  206. package/dist/js/internal/array-callbacks.cjs +0 -18
  207. package/dist/js/internal/array-callbacks.js +0 -18
  208. package/src/js/internal/array-callbacks.ts +0 -28
  209. package/types/internal/array-callbacks.d.cts +0 -13
  210. package/types/internal/array-callbacks.d.ts +0 -2
  211. package/types/internal/array-find.d.cts +0 -11
  212. package/types/internal/array-find.d.ts +0 -4
  213. /package/dist/js/internal/{value-handle.cjs → value/handle.cjs} +0 -0
  214. /package/dist/js/internal/{value-handle.js → value/handle.js} +0 -0
  215. /package/types/internal/{value-handle.d.cts → value/handle.d.cts} +0 -0
package/types/index.d.ts CHANGED
@@ -1,16 +1,16 @@
1
- export * from '@/array/index';
2
- export * from '@/colour/index';
3
- export * from '@/emitter';
4
- export * from '@/function';
5
- export * from '@/is';
6
- export * from '@/logger';
7
- export * from '@/math';
8
- export * from '@/models';
9
- export * from '@/number';
10
- export * from '@/query';
11
- export * from '@/queue';
12
- export * from '@/random';
13
- export * from '@/sized';
14
- export * from '@/string/index';
15
- export * from '@/touch';
16
- export * from '@/value/index';
1
+ export * from '~/array/index';
2
+ export * from '~/colour/index';
3
+ export * from '~/emitter';
4
+ export * from '~/function';
5
+ export * from '~/is';
6
+ export * from '~/logger';
7
+ export * from '~/math';
8
+ export * from '~/models';
9
+ export * from '~/number';
10
+ export * from '~/query';
11
+ export * from '~/queue';
12
+ export * from '~/random';
13
+ export * from '~/sized';
14
+ export * from '~/string/index';
15
+ export * from '~/touch';
16
+ export * from '~/value/index';
@@ -0,0 +1,11 @@
1
+ // Generated by dts-bundle-generator v9.5.1
2
+
3
+ export type GenericCallback = (...args: any[]) => any;
4
+ export type Callbacks = {
5
+ bool?: GenericCallback;
6
+ key?: GenericCallback;
7
+ value?: GenericCallback;
8
+ };
9
+ export declare function getCallbacks(bool?: unknown, key?: unknown, value?: unknown): Callbacks | undefined;
10
+
11
+ export {};
@@ -0,0 +1,2 @@
1
+ import type { Callbacks } from '~/array/models';
2
+ export declare function getCallbacks(bool?: unknown, key?: unknown, value?: unknown): Callbacks | undefined;
@@ -0,0 +1,7 @@
1
+ // Generated by dts-bundle-generator v9.5.1
2
+
3
+ export type FindType = "index" | "value";
4
+ export declare function findValue(type: FindType, array: unknown[], bool: unknown, key: unknown, value: unknown): unknown;
5
+ export declare function findValues(type: "all" | "unique", array: unknown[], bool: unknown, key: unknown, value: unknown): unknown[];
6
+
7
+ export {};
@@ -0,0 +1,3 @@
1
+ import type { FindType } from '~/array/models';
2
+ export declare function findValue(type: FindType, array: unknown[], bool: unknown, key: unknown, value: unknown): unknown;
3
+ export declare function findValues(type: 'all' | 'unique', array: unknown[], bool: unknown, key: unknown, value: unknown): unknown[];
@@ -1,2 +1,2 @@
1
- import type { PlainObject } from '@/models';
1
+ import type { PlainObject } from '~/models';
2
2
  export declare function handleValue(data: PlainObject, path: string, value: unknown, get: boolean, ignoreCase: boolean): unknown;
package/types/is.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { ArrayOrPlainObject, Key, PlainObject, Primitive } from '@/models';
1
+ import type { ArrayOrPlainObject, Key, PlainObject, Primitive } from '~/models';
2
2
  /**
3
3
  * Is the value an array or a record?
4
4
  */
@@ -2,14 +2,14 @@
2
2
 
3
3
  declare class Logger {
4
4
  /**
5
- * Logs any number of values at the "debug" log level
5
+ * Log any number of values at the "debug" log level
6
6
  */
7
7
  get debug(): {
8
8
  (...data: any[]): void;
9
9
  (message?: any, ...optionalParams: any[]): void;
10
10
  };
11
11
  /**
12
- * Logs the value and shows all its properties
12
+ * Log the value and shows all its properties
13
13
  */
14
14
  get dir(): {
15
15
  (item?: any, options?: any): void;
@@ -24,49 +24,49 @@ declare class Logger {
24
24
  */
25
25
  set enabled(value: boolean);
26
26
  /**
27
- * Logs any number of values at the "error" log level
27
+ * Log any number of values at the "error" log level
28
28
  */
29
29
  get error(): {
30
30
  (...data: any[]): void;
31
31
  (message?: any, ...optionalParams: any[]): void;
32
32
  };
33
33
  /**
34
- * Logs any number of values at the "info" log level
34
+ * Log any number of values at the "info" log level
35
35
  */
36
36
  get info(): {
37
37
  (...data: any[]): void;
38
38
  (message?: any, ...optionalParams: any[]): void;
39
39
  };
40
40
  /**
41
- * Logs any number of values at the "log" log level
41
+ * Log any number of values at the "log" log level
42
42
  */
43
43
  get log(): {
44
44
  (...data: any[]): void;
45
45
  (message?: any, ...optionalParams: any[]): void;
46
46
  };
47
47
  /**
48
- * Logs data as a table, with optional properties to use as columns
48
+ * Log data as a table, with optional properties to use as columns
49
49
  */
50
50
  get table(): {
51
51
  (tabularData?: any, properties?: string[]): void;
52
52
  (tabularData: any, properties?: readonly string[]): void;
53
53
  };
54
54
  /**
55
- * Logs any number of values together with a trace from where it was called
55
+ * Log any number of values together with a trace from where it was called
56
56
  */
57
57
  get trace(): {
58
58
  (...data: any[]): void;
59
59
  (message?: any, ...optionalParams: any[]): void;
60
60
  };
61
61
  /**
62
- * Logs any number of values at the "warn" log level
62
+ * Log any number of values at the "warn" log level
63
63
  */
64
64
  get warn(): {
65
65
  (...data: any[]): void;
66
66
  (message?: any, ...optionalParams: any[]): void;
67
67
  };
68
68
  /**
69
- * - Starts a logged timer with a label
69
+ * - Start a logged timer with a label
70
70
  * - Returns a `Time`-object for logging the current duration of the timer and stopping the timer _(and logging the total duration)_
71
71
  */
72
72
  time(label: string): Time;
@@ -75,13 +75,13 @@ declare class Time {
75
75
  private readonly state;
76
76
  constructor(label: string);
77
77
  /**
78
- * - Logs the current duration of the timer
79
- * - Ignored if logging is disabled
78
+ * - Log the current duration of the timer
79
+ * - _(Ignored if logging is disabled)_
80
80
  */
81
81
  log(): void;
82
82
  /**
83
- * - Stops the timer and logs the total duration
84
- * - Will always log the total duration, even if logging is disabled
83
+ * - Stop the timer and logs the total duration
84
+ * - _(Will always log the total duration, even if logging is disabled)_
85
85
  */
86
86
  stop(): void;
87
87
  }
package/types/logger.d.ts CHANGED
@@ -3,14 +3,14 @@ declare global {
3
3
  }
4
4
  declare class Logger {
5
5
  /**
6
- * Logs any number of values at the "debug" log level
6
+ * Log any number of values at the "debug" log level
7
7
  */
8
8
  get debug(): {
9
9
  (...data: any[]): void;
10
10
  (message?: any, ...optionalParams: any[]): void;
11
11
  };
12
12
  /**
13
- * Logs the value and shows all its properties
13
+ * Log the value and shows all its properties
14
14
  */
15
15
  get dir(): {
16
16
  (item?: any, options?: any): void;
@@ -25,49 +25,49 @@ declare class Logger {
25
25
  */
26
26
  set enabled(value: boolean);
27
27
  /**
28
- * Logs any number of values at the "error" log level
28
+ * Log any number of values at the "error" log level
29
29
  */
30
30
  get error(): {
31
31
  (...data: any[]): void;
32
32
  (message?: any, ...optionalParams: any[]): void;
33
33
  };
34
34
  /**
35
- * Logs any number of values at the "info" log level
35
+ * Log any number of values at the "info" log level
36
36
  */
37
37
  get info(): {
38
38
  (...data: any[]): void;
39
39
  (message?: any, ...optionalParams: any[]): void;
40
40
  };
41
41
  /**
42
- * Logs any number of values at the "log" log level
42
+ * Log any number of values at the "log" log level
43
43
  */
44
44
  get log(): {
45
45
  (...data: any[]): void;
46
46
  (message?: any, ...optionalParams: any[]): void;
47
47
  };
48
48
  /**
49
- * Logs data as a table, with optional properties to use as columns
49
+ * Log data as a table, with optional properties to use as columns
50
50
  */
51
51
  get table(): {
52
52
  (tabularData?: any, properties?: string[]): void;
53
53
  (tabularData: any, properties?: readonly string[]): void;
54
54
  };
55
55
  /**
56
- * Logs any number of values together with a trace from where it was called
56
+ * Log any number of values together with a trace from where it was called
57
57
  */
58
58
  get trace(): {
59
59
  (...data: any[]): void;
60
60
  (message?: any, ...optionalParams: any[]): void;
61
61
  };
62
62
  /**
63
- * Logs any number of values at the "warn" log level
63
+ * Log any number of values at the "warn" log level
64
64
  */
65
65
  get warn(): {
66
66
  (...data: any[]): void;
67
67
  (message?: any, ...optionalParams: any[]): void;
68
68
  };
69
69
  /**
70
- * - Starts a logged timer with a label
70
+ * - Start a logged timer with a label
71
71
  * - Returns a `Time`-object for logging the current duration of the timer and stopping the timer _(and logging the total duration)_
72
72
  */
73
73
  time(label: string): Time;
@@ -76,13 +76,13 @@ declare class Time {
76
76
  private readonly state;
77
77
  constructor(label: string);
78
78
  /**
79
- * - Logs the current duration of the timer
80
- * - Ignored if logging is disabled
79
+ * - Log the current duration of the timer
80
+ * - _(Ignored if logging is disabled)_
81
81
  */
82
82
  log(): void;
83
83
  /**
84
- * - Stops the timer and logs the total duration
85
- * - Will always log the total duration, even if logging is disabled
84
+ * - Stop the timer and logs the total duration
85
+ * - _(Will always log the total duration, even if logging is disabled)_
86
86
  */
87
87
  stop(): void;
88
88
  }
package/types/math.d.cts CHANGED
@@ -13,7 +13,7 @@ export declare function max(values: number[]): number;
13
13
  */
14
14
  export declare function min(values: number[]): number;
15
15
  /**
16
- * Rounds a number to a specific number of decimal places _(defaults to 0)_
16
+ * Round a number to a specific number of decimal places _(defaults to 0)_
17
17
  */
18
18
  export declare function round(value: number, decimals?: number): number;
19
19
  /**
package/types/math.d.ts CHANGED
@@ -11,7 +11,7 @@ export declare function max(values: number[]): number;
11
11
  */
12
12
  export declare function min(values: number[]): number;
13
13
  /**
14
- * Rounds a number to a specific number of decimal places _(defaults to 0)_
14
+ * Round a number to a specific number of decimal places _(defaults to 0)_
15
15
  */
16
16
  export declare function round(value: number, decimals?: number): number;
17
17
  /**
@@ -1299,14 +1299,14 @@ export type EventPosition = {
1299
1299
  x: number;
1300
1300
  y: number;
1301
1301
  };
1302
+ export type KeyedValue<
1303
+ Item,
1304
+ Key extends keyof Item,
1305
+ > = Item[Key] extends PropertyKey ? Item[Key] : never;
1302
1306
  export type NestedArrayType<Value> = Value extends Array<infer NestedValue>
1303
1307
  ? NestedArrayType<NestedValue>
1304
1308
  : Value;
1305
1309
  export type GenericCallback = (...args: any[]) => any;
1306
- export type GetterSetter<Value> = {
1307
- get(): Value;
1308
- set(value: Value): void;
1309
- };
1310
1310
  export type Key = number | string;
1311
1311
  export type PlainObject = UnknownRecord;
1312
1312
  export type UnknownArrayOrRecord = UnknownArray | UnknownRecord;
package/types/models.d.ts CHANGED
@@ -4,12 +4,9 @@ export type EventPosition = {
4
4
  x: number;
5
5
  y: number;
6
6
  };
7
+ export type KeyedValue<Item, Key extends keyof Item> = Item[Key] extends PropertyKey ? Item[Key] : never;
7
8
  export type NestedArrayType<Value> = Value extends Array<infer NestedValue> ? NestedArrayType<NestedValue> : Value;
8
9
  export type GenericCallback = (...args: any[]) => any;
9
- export type GetterSetter<Value> = {
10
- get(): Value;
11
- set(value: Value): void;
12
- };
13
10
  export type Key = number | string;
14
11
  export type PlainObject = UnknownRecord;
15
12
  export type UnknownArrayOrRecord = UnknownArray | UnknownRecord;
@@ -5,12 +5,12 @@
5
5
  */
6
6
  export declare function between(value: number, min: number, max: number): boolean;
7
7
  /**
8
- * - Clamps a number between a minimum and maximum value
8
+ * - Clamp a number between a minimum and maximum value
9
9
  * - If `loop` is `true`, when the value is less than the minimum, it will be clamped as the maximum, and vice versa
10
10
  */
11
11
  export declare function clamp(value: number, min: number, max: number, loop?: boolean): number;
12
12
  /**
13
- * - Gets the number value from an unknown value
13
+ * - Get the number value from an unknown value
14
14
  * - Returns `NaN` if the value is `undefined`, `null`, or cannot be parsed
15
15
  * - Based on Lodash :-)
16
16
  */
package/types/number.d.ts CHANGED
@@ -3,12 +3,12 @@
3
3
  */
4
4
  export declare function between(value: number, min: number, max: number): boolean;
5
5
  /**
6
- * - Clamps a number between a minimum and maximum value
6
+ * - Clamp a number between a minimum and maximum value
7
7
  * - If `loop` is `true`, when the value is less than the minimum, it will be clamped as the maximum, and vice versa
8
8
  */
9
9
  export declare function clamp(value: number, min: number, max: number, loop?: boolean): number;
10
10
  /**
11
- * - Gets the number value from an unknown value
11
+ * - Get the number value from an unknown value
12
12
  * - Returns `NaN` if the value is `undefined`, `null`, or cannot be parsed
13
13
  * - Based on Lodash :-)
14
14
  */
package/types/query.d.cts CHANGED
@@ -33,11 +33,11 @@ isObject('hello');
33
33
  export type UnknownRecord = Record<PropertyKey, unknown>;
34
34
  export type PlainObject = UnknownRecord;
35
35
  /**
36
- * Converts a query string to a plain _(nested)_ object
36
+ * Convert a query string to a plain _(nested)_ object
37
37
  */
38
38
  export declare function fromQuery(query: string): PlainObject;
39
39
  /**
40
- * Converts a plain _(nested)_ object to a query string
40
+ * Convert a plain _(nested)_ object to a query string
41
41
  */
42
42
  export declare function toQuery(parameters: PlainObject): string;
43
43
 
package/types/query.d.ts CHANGED
@@ -1,9 +1,9 @@
1
- import type { PlainObject } from '@/models';
1
+ import type { PlainObject } from '~/models';
2
2
  /**
3
- * Converts a query string to a plain _(nested)_ object
3
+ * Convert a query string to a plain _(nested)_ object
4
4
  */
5
5
  export declare function fromQuery(query: string): PlainObject;
6
6
  /**
7
- * Converts a plain _(nested)_ object to a query string
7
+ * Convert a plain _(nested)_ object to a query string
8
8
  */
9
9
  export declare function toQuery(parameters: PlainObject): string;
package/types/queue.d.cts CHANGED
@@ -1,7 +1,7 @@
1
1
  // Generated by dts-bundle-generator v9.5.1
2
2
 
3
3
  /**
4
- * Queues a callback to be executed at the next best time
4
+ * Queue a callback to be executed at the next best time
5
5
  */
6
6
  export declare function queue(callback: () => void): void;
7
7
 
package/types/queue.d.ts CHANGED
@@ -2,6 +2,6 @@ declare global {
2
2
  var _atomic_queued: Set<() => void>;
3
3
  }
4
4
  /**
5
- * Queues a callback to be executed at the next best time
5
+ * Queue a callback to be executed at the next best time
6
6
  */
7
7
  export declare function queue(callback: () => void): void;
@@ -1,40 +1,36 @@
1
1
  // Generated by dts-bundle-generator v9.5.1
2
2
 
3
3
  /**
4
- * Returns a random boolean
4
+ * Get a random boolean
5
5
  */
6
6
  export declare function getRandomBoolean(): boolean;
7
7
  /**
8
- * Returns a random string of characters with a specified length
8
+ * Get a random string of characters with a specified length
9
9
  * - `selection` defaults to all lowercase letters in the English alphabet
10
10
  */
11
11
  export declare function getRandomCharacters(length: number, selection?: string): string;
12
12
  /**
13
- * Returns a random hexadecimal colour
13
+ * Get a random hexadecimal colour
14
14
  */
15
15
  export declare function getRandomColour(): string;
16
16
  /**
17
- * Returns a random date
18
- */
19
- export declare function getRandomDate(earliest?: Date, latest?: Date): Date;
20
- /**
21
- * Returns a random floating-point number
17
+ * Get a random floating-point number
22
18
  */
23
19
  export declare function getRandomFloat(min?: number, max?: number): number;
24
20
  /**
25
- * Returns a random hexadecimal character
21
+ * Get a random hexadecimal character
26
22
  */
27
23
  export declare function getRandomHex(): string;
28
24
  /**
29
- * Returns a random integer
25
+ * Get a random integer
30
26
  */
31
27
  export declare function getRandomInteger(min?: number, max?: number): number;
32
28
  /**
33
- * Returns a random item from an array
29
+ * Get a random item from an array
34
30
  */
35
31
  export declare function getRandomItem<Value>(array: Value[]): Value;
36
32
  /**
37
- * - Returns an amount of random items from an array
33
+ * - Get an amount of random items from an array
38
34
  * - If `amount` is not specified, a shuffled array will be returned instead
39
35
  */
40
36
  export declare function getRandomItems<Value>(array: Value[], amount?: number): Value[];
package/types/random.d.ts CHANGED
@@ -1,38 +1,34 @@
1
1
  /**
2
- * Returns a random boolean
2
+ * Get a random boolean
3
3
  */
4
4
  export declare function getRandomBoolean(): boolean;
5
5
  /**
6
- * Returns a random string of characters with a specified length
6
+ * Get a random string of characters with a specified length
7
7
  * - `selection` defaults to all lowercase letters in the English alphabet
8
8
  */
9
9
  export declare function getRandomCharacters(length: number, selection?: string): string;
10
10
  /**
11
- * Returns a random hexadecimal colour
11
+ * Get a random hexadecimal colour
12
12
  */
13
13
  export declare function getRandomColour(): string;
14
14
  /**
15
- * Returns a random date
16
- */
17
- export declare function getRandomDate(earliest?: Date, latest?: Date): Date;
18
- /**
19
- * Returns a random floating-point number
15
+ * Get a random floating-point number
20
16
  */
21
17
  export declare function getRandomFloat(min?: number, max?: number): number;
22
18
  /**
23
- * Returns a random hexadecimal character
19
+ * Get a random hexadecimal character
24
20
  */
25
21
  export declare function getRandomHex(): string;
26
22
  /**
27
- * Returns a random integer
23
+ * Get a random integer
28
24
  */
29
25
  export declare function getRandomInteger(min?: number, max?: number): number;
30
26
  /**
31
- * Returns a random item from an array
27
+ * Get a random item from an array
32
28
  */
33
29
  export declare function getRandomItem<Value>(array: Value[]): Value;
34
30
  /**
35
- * - Returns an amount of random items from an array
31
+ * - Get an amount of random items from an array
36
32
  * - If `amount` is not specified, a shuffled array will be returned instead
37
33
  */
38
34
  export declare function getRandomItems<Value>(array: Value[], amount?: number): Value[];
package/types/sized.d.cts CHANGED
@@ -16,18 +16,18 @@ export declare class SizedMap<Key = unknown, Value = unknown> extends Map<Key, V
16
16
  */
17
17
  get maximum(): number;
18
18
  /**
19
- * Creates a new Map with entries and a maximum size _(2^20)_
19
+ * Create a new Map with entries and a maximum size _(2^20)_
20
20
  */
21
21
  constructor(entries: Array<[
22
22
  Key,
23
23
  Value
24
24
  ]>);
25
25
  /**
26
- * Creates a new Map with a maximum size _(but clamped at 2^24)_
26
+ * Create a new Map with a maximum size _(but clamped at 2^24)_
27
27
  */
28
28
  constructor(maximum: number);
29
29
  /**
30
- * Creates a new Map with _(optional)_ entries and a maximum size _(defaults to 2^20; clamped at 2^24)_
30
+ * Create a new Map with _(optional)_ entries and a maximum size _(defaults to 2^20; clamped at 2^24)_
31
31
  */
32
32
  constructor(entries?: Array<[
33
33
  Key,
@@ -58,15 +58,15 @@ export declare class SizedSet<Value = unknown> extends Set<Value> {
58
58
  */
59
59
  get maximum(): number;
60
60
  /**
61
- * Creates a new Set with values and a maximum size _(2^20)_
61
+ * Create a new Set with values and a maximum size _(2^20)_
62
62
  */
63
63
  constructor(values: Value[]);
64
64
  /**
65
- * Creates a new Set with a maximum size _(but clamped at 2^24)_
65
+ * Create a new Set with a maximum size _(but clamped at 2^24)_
66
66
  */
67
67
  constructor(maximum: number);
68
68
  /**
69
- * Creates a new Set with _(optional)_ values and a maximum size _(defaults to 2^20; clamped at 2^24)_
69
+ * Create a new Set with _(optional)_ values and a maximum size _(defaults to 2^20; clamped at 2^24)_
70
70
  */
71
71
  constructor(values?: Value[], maximum?: number);
72
72
  /**
package/types/sized.d.ts CHANGED
@@ -14,15 +14,15 @@ export declare class SizedMap<Key = unknown, Value = unknown> extends Map<Key, V
14
14
  */
15
15
  get maximum(): number;
16
16
  /**
17
- * Creates a new Map with entries and a maximum size _(2^20)_
17
+ * Create a new Map with entries and a maximum size _(2^20)_
18
18
  */
19
19
  constructor(entries: Array<[Key, Value]>);
20
20
  /**
21
- * Creates a new Map with a maximum size _(but clamped at 2^24)_
21
+ * Create a new Map with a maximum size _(but clamped at 2^24)_
22
22
  */
23
23
  constructor(maximum: number);
24
24
  /**
25
- * Creates a new Map with _(optional)_ entries and a maximum size _(defaults to 2^20; clamped at 2^24)_
25
+ * Create a new Map with _(optional)_ entries and a maximum size _(defaults to 2^20; clamped at 2^24)_
26
26
  */
27
27
  constructor(entries?: Array<[Key, Value]>, maximum?: number);
28
28
  /**
@@ -50,15 +50,15 @@ export declare class SizedSet<Value = unknown> extends Set<Value> {
50
50
  */
51
51
  get maximum(): number;
52
52
  /**
53
- * Creates a new Set with values and a maximum size _(2^20)_
53
+ * Create a new Set with values and a maximum size _(2^20)_
54
54
  */
55
55
  constructor(values: Value[]);
56
56
  /**
57
- * Creates a new Set with a maximum size _(but clamped at 2^24)_
57
+ * Create a new Set with a maximum size _(but clamped at 2^24)_
58
58
  */
59
59
  constructor(maximum: number);
60
60
  /**
61
- * Creates a new Set with _(optional)_ values and a maximum size _(defaults to 2^20; clamped at 2^24)_
61
+ * Create a new Set with _(optional)_ values and a maximum size _(defaults to 2^20; clamped at 2^24)_
62
62
  */
63
63
  constructor(values?: Value[], maximum?: number);
64
64
  /**
@@ -66,6 +66,9 @@ export type Options = {
66
66
  */
67
67
  pattern?: RegExp;
68
68
  };
69
+ /**
70
+ * Render a string from a template with variables
71
+ */
69
72
  export declare function template(value: string, variables: PlainObject, options?: Partial<Options>): string;
70
73
  /**
71
74
  * Create a new UUID
@@ -76,15 +79,15 @@ export declare function createUuid(): string;
76
79
  */
77
80
  export declare function getString(value: unknown): string;
78
81
  /**
79
- * Joins an array into a string while ignoring empty values _(with an optional delimiter)_
82
+ * Join an array into a string while ignoring empty values _(with an optional delimiter)_
80
83
  */
81
84
  export declare function join(value: unknown[], delimiter?: string): string;
82
85
  /**
83
- * Parses a JSON string into its proper value _(or `undefined` if it fails)_
86
+ * Parse a JSON string into its proper value _(or `undefined` if it fails)_
84
87
  */
85
88
  export declare function parse(value: string, reviver?: (this: unknown, key: string, value: unknown) => unknown): unknown;
86
89
  /**
87
- * Truncates a string to a specified length, when possible
90
+ * Truncate a string to a specified length, when possible
88
91
  * - Returned as-is if the string is already short enough
89
92
  * - A suffix may be appended to the truncated string, e.g., an ellipsis
90
93
  */
@@ -7,15 +7,15 @@ export declare function createUuid(): string;
7
7
  */
8
8
  export declare function getString(value: unknown): string;
9
9
  /**
10
- * Joins an array into a string while ignoring empty values _(with an optional delimiter)_
10
+ * Join an array into a string while ignoring empty values _(with an optional delimiter)_
11
11
  */
12
12
  export declare function join(value: unknown[], delimiter?: string): string;
13
13
  /**
14
- * Parses a JSON string into its proper value _(or `undefined` if it fails)_
14
+ * Parse a JSON string into its proper value _(or `undefined` if it fails)_
15
15
  */
16
16
  export declare function parse(value: string, reviver?: (this: unknown, key: string, value: unknown) => unknown): unknown;
17
17
  /**
18
- * Truncates a string to a specified length, when possible
18
+ * Truncate a string to a specified length, when possible
19
19
  * - Returned as-is if the string is already short enough
20
20
  * - A suffix may be appended to the truncated string, e.g., an ellipsis
21
21
  */
@@ -42,6 +42,9 @@ export type Options = {
42
42
  */
43
43
  pattern?: RegExp;
44
44
  };
45
+ /**
46
+ * Render a string from a template with variables
47
+ */
45
48
  export declare function template(value: string, variables: PlainObject, options?: Partial<Options>): string;
46
49
 
47
50
  export {};
@@ -1,4 +1,4 @@
1
- import type { PlainObject } from '@/models';
1
+ import type { PlainObject } from '~/models';
2
2
  type Options = {
3
3
  /**
4
4
  * Ignore case when searching for variables?
@@ -9,5 +9,8 @@ type Options = {
9
9
  */
10
10
  pattern?: RegExp;
11
11
  };
12
+ /**
13
+ * Render a string from a template with variables
14
+ */
12
15
  export declare function template(value: string, variables: PlainObject, options?: Partial<Options>): string;
13
16
  export {};