@oscarpalmer/atoms 0.74.1 → 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 (282) hide show
  1. package/dist/js/array/chunk.cjs +18 -0
  2. package/dist/js/array/{chunk.mjs → chunk.js} +2 -2
  3. package/dist/js/array/compact.cjs +6 -0
  4. package/dist/js/array/{compact.mjs → compact.js} +0 -1
  5. package/dist/js/array/count.cjs +14 -0
  6. package/dist/js/array/count.js +14 -0
  7. package/dist/js/array/exists.cjs +14 -0
  8. package/dist/js/array/exists.js +14 -0
  9. package/dist/js/array/filter.cjs +14 -0
  10. package/dist/js/array/filter.js +14 -0
  11. package/dist/js/array/find.cjs +14 -0
  12. package/dist/js/array/find.js +14 -0
  13. package/dist/js/array/group-by.cjs +35 -0
  14. package/dist/js/array/group-by.js +35 -0
  15. package/dist/js/array/index-of.cjs +14 -0
  16. package/dist/js/array/index-of.js +14 -0
  17. package/dist/js/array/index.cjs +40 -0
  18. package/dist/js/array/index.js +34 -381
  19. package/dist/js/array/insert.cjs +31 -0
  20. package/dist/js/array/insert.js +31 -0
  21. package/dist/js/array/models.cjs +1 -0
  22. package/dist/js/array/models.js +1 -0
  23. package/dist/js/array/shuffle.cjs +13 -0
  24. package/dist/js/array/{shuffle.mjs → shuffle.js} +2 -3
  25. package/dist/js/array/sort.cjs +53 -0
  26. package/dist/js/array/{sort.mjs → sort.js} +13 -9
  27. package/dist/js/array/splice.cjs +14 -0
  28. package/dist/js/array/splice.js +14 -0
  29. package/dist/js/array/to-map.cjs +27 -0
  30. package/dist/js/array/to-map.js +27 -0
  31. package/dist/js/array/to-record.cjs +12 -0
  32. package/dist/js/array/to-record.js +12 -0
  33. package/dist/js/array/unique.cjs +7 -0
  34. package/dist/js/array/unique.js +7 -0
  35. package/dist/js/colour/base.cjs +18 -0
  36. package/dist/js/colour/{base.mjs → base.js} +4 -3
  37. package/dist/js/colour/functions.cjs +96 -0
  38. package/dist/js/colour/{functions.mjs → functions.js} +18 -19
  39. package/dist/js/colour/hex.cjs +56 -0
  40. package/dist/js/colour/{hex.mjs → hex.js} +34 -15
  41. package/dist/js/colour/hsl.cjs +85 -0
  42. package/dist/js/colour/{hsl.mjs → hsl.js} +40 -12
  43. package/dist/js/colour/index.cjs +29 -0
  44. package/dist/js/colour/index.js +14 -272
  45. package/dist/js/colour/is.cjs +27 -0
  46. package/dist/js/colour/{is.mjs → is.js} +7 -6
  47. package/dist/js/colour/rgb.cjs +87 -0
  48. package/dist/js/colour/{rgb.mjs → rgb.js} +43 -12
  49. package/dist/js/{emitter.mjs → emitter.cjs} +88 -56
  50. package/dist/js/emitter.js +85 -56
  51. package/dist/js/{function.mjs → function.cjs} +66 -46
  52. package/dist/js/function.js +61 -48
  53. package/dist/js/index.cjs +136 -0
  54. package/dist/js/index.js +133 -1724
  55. package/dist/js/internal/array/callbacks.cjs +23 -0
  56. package/dist/js/internal/array/callbacks.js +23 -0
  57. package/dist/js/internal/array/find.cjs +51 -0
  58. package/dist/js/internal/array/find.js +51 -0
  59. package/dist/js/internal/value/handle.cjs +21 -0
  60. package/dist/js/internal/{value-handle.mjs → value/handle.js} +0 -1
  61. package/dist/js/{is.mjs → is.cjs} +17 -18
  62. package/dist/js/is.js +15 -27
  63. package/dist/js/logger.cjs +108 -0
  64. package/dist/js/logger.js +44 -8
  65. package/dist/js/{math.mjs → math.cjs} +7 -8
  66. package/dist/js/math.js +4 -5
  67. package/dist/js/models.cjs +1 -0
  68. package/dist/js/models.js +1 -0
  69. package/dist/js/{number.mjs → number.cjs} +8 -8
  70. package/dist/js/number.js +5 -5
  71. package/dist/js/{query.mjs → query.cjs} +18 -18
  72. package/dist/js/query.js +17 -86
  73. package/dist/js/{queue.mjs → queue.cjs} +12 -13
  74. package/dist/js/queue.js +9 -10
  75. package/dist/js/{random.mjs → random.cjs} +14 -21
  76. package/dist/js/random.js +9 -26
  77. package/dist/js/{sized.mjs → sized.cjs} +68 -33
  78. package/dist/js/sized.js +66 -38
  79. package/dist/js/string/case.cjs +41 -0
  80. package/dist/js/string/{case.mjs → case.js} +13 -9
  81. package/dist/js/string/index.cjs +59 -0
  82. package/dist/js/string/index.js +30 -100
  83. package/dist/js/string/template.cjs +21 -0
  84. package/dist/js/string/{template.mjs → template.js} +4 -5
  85. package/dist/js/{touch.mjs → touch.cjs} +4 -7
  86. package/dist/js/touch.js +3 -5
  87. package/dist/js/value/clone.cjs +76 -0
  88. package/dist/js/value/{clone.mjs → clone.js} +5 -6
  89. package/dist/js/value/compare.cjs +59 -0
  90. package/dist/js/value/{compare.mjs → compare.js} +4 -6
  91. package/dist/js/value/diff.cjs +75 -0
  92. package/dist/js/value/{diff.mjs → diff.js} +13 -11
  93. package/dist/js/value/equal.cjs +106 -0
  94. package/dist/js/value/{equal.mjs → equal.js} +13 -8
  95. package/dist/js/value/get.cjs +21 -0
  96. package/dist/js/value/{get.mjs → get.js} +9 -4
  97. package/dist/js/value/index.cjs +30 -0
  98. package/dist/js/value/index.js +19 -510
  99. package/dist/js/value/merge.cjs +35 -0
  100. package/dist/js/value/{merge.mjs → merge.js} +7 -6
  101. package/dist/js/value/set.cjs +25 -0
  102. package/dist/js/value/{set.mjs → set.js} +3 -4
  103. package/dist/js/value/smush.cjs +26 -0
  104. package/dist/js/value/{smush.mjs → smush.js} +3 -4
  105. package/dist/js/value/unsmush.cjs +39 -0
  106. package/dist/js/value/{unsmush.mjs → unsmush.js} +10 -7
  107. package/package.json +50 -47
  108. package/src/js/array/chunk.ts +6 -5
  109. package/src/js/array/compact.ts +8 -10
  110. package/src/js/array/count.ts +39 -19
  111. package/src/js/array/exists.ts +39 -15
  112. package/src/js/array/filter.ts +42 -20
  113. package/src/js/array/find.ts +45 -20
  114. package/src/js/array/group-by.ts +158 -27
  115. package/src/js/array/index-of.ts +40 -18
  116. package/src/js/array/index.ts +10 -9
  117. package/src/js/array/insert.ts +28 -14
  118. package/src/js/array/models.ts +18 -15
  119. package/src/js/array/shuffle.ts +3 -3
  120. package/src/js/array/sort.ts +32 -34
  121. package/src/js/array/splice.ts +22 -26
  122. package/src/js/array/to-map.ts +133 -45
  123. package/src/js/array/to-record.ts +137 -39
  124. package/src/js/array/unique.ts +20 -15
  125. package/src/js/colour/base.ts +3 -3
  126. package/src/js/colour/functions.ts +4 -6
  127. package/src/js/colour/hex.ts +5 -5
  128. package/src/js/colour/hsl.ts +18 -12
  129. package/src/js/colour/index.ts +1 -1
  130. package/src/js/colour/is.ts +3 -3
  131. package/src/js/colour/rgb.ts +17 -11
  132. package/src/js/emitter.ts +12 -9
  133. package/src/js/function.ts +17 -17
  134. package/src/js/index.ts +16 -16
  135. package/src/js/internal/array/callbacks.ts +33 -0
  136. package/src/js/internal/{array-find.ts → array/find.ts} +23 -24
  137. package/src/js/internal/{value-handle.ts → value/handle.ts} +1 -1
  138. package/src/js/is.ts +2 -2
  139. package/src/js/logger.ts +14 -14
  140. package/src/js/math.ts +1 -1
  141. package/src/js/models.ts +5 -5
  142. package/src/js/number.ts +2 -2
  143. package/src/js/query.ts +6 -10
  144. package/src/js/queue.ts +1 -1
  145. package/src/js/random.ts +9 -19
  146. package/src/js/sized.ts +145 -145
  147. package/src/js/string/case.ts +1 -1
  148. package/src/js/string/index.ts +13 -7
  149. package/src/js/string/template.ts +6 -3
  150. package/src/js/value/clone.ts +3 -7
  151. package/src/js/value/compare.ts +3 -5
  152. package/src/js/value/diff.ts +4 -4
  153. package/src/js/value/equal.ts +2 -2
  154. package/src/js/value/get.ts +3 -3
  155. package/src/js/value/index.ts +2 -2
  156. package/src/js/value/merge.ts +3 -3
  157. package/src/js/value/set.ts +3 -4
  158. package/src/js/value/smush.ts +4 -4
  159. package/src/js/value/unsmush.ts +4 -4
  160. package/types/array/chunk.d.cts +8 -0
  161. package/types/array/chunk.d.ts +2 -2
  162. package/types/array/compact.d.cts +12 -0
  163. package/types/array/compact.d.ts +4 -4
  164. package/types/array/count.d.cts +24 -0
  165. package/types/array/count.d.ts +13 -7
  166. package/types/array/exists.d.cts +26 -0
  167. package/types/array/exists.d.ts +11 -3
  168. package/types/array/filter.d.cts +26 -0
  169. package/types/array/filter.d.ts +14 -6
  170. package/types/array/find.d.cts +26 -0
  171. package/types/array/find.d.ts +14 -6
  172. package/types/array/group-by.d.cts +58 -0
  173. package/types/array/group-by.d.ts +49 -5
  174. package/types/array/index-of.d.cts +26 -0
  175. package/types/array/index-of.d.ts +14 -6
  176. package/types/array/index.d.cts +239 -95
  177. package/types/array/index.d.ts +7 -6
  178. package/types/array/insert.d.cts +16 -0
  179. package/types/array/insert.d.ts +10 -5
  180. package/types/array/models.d.cts +14 -11
  181. package/types/array/models.d.ts +14 -12
  182. package/types/array/shuffle.d.cts +8 -0
  183. package/types/array/shuffle.d.ts +2 -2
  184. package/types/array/sort.d.cts +24 -0
  185. package/types/array/sort.d.ts +10 -10
  186. package/types/array/splice.d.cts +22 -0
  187. package/types/array/splice.d.ts +4 -4
  188. package/types/array/to-map.d.cts +61 -0
  189. package/types/array/to-map.d.ts +42 -20
  190. package/types/array/to-record.d.cts +61 -0
  191. package/types/array/to-record.d.ts +42 -20
  192. package/types/array/unique.d.cts +21 -0
  193. package/types/array/unique.d.ts +10 -6
  194. package/types/colour/base.d.cts +153 -0
  195. package/types/colour/base.d.ts +2 -2
  196. package/types/colour/functions.d.cts +173 -0
  197. package/types/colour/functions.d.ts +3 -3
  198. package/types/colour/hex.d.cts +157 -0
  199. package/types/colour/hex.d.ts +4 -4
  200. package/types/colour/hsl.d.cts +157 -0
  201. package/types/colour/hsl.d.ts +16 -10
  202. package/types/colour/index.d.cts +28 -16
  203. package/types/colour/index.d.ts +1 -1
  204. package/types/colour/is.d.cts +170 -0
  205. package/types/colour/is.d.ts +3 -3
  206. package/types/colour/rgb.d.cts +157 -0
  207. package/types/colour/rgb.d.ts +15 -9
  208. package/types/emitter.d.cts +11 -8
  209. package/types/emitter.d.ts +11 -8
  210. package/types/function.d.cts +10 -10
  211. package/types/function.d.ts +11 -11
  212. package/types/index.d.cts +1120 -736
  213. package/types/index.d.ts +16 -16
  214. package/types/internal/array/callbacks.d.cts +11 -0
  215. package/types/internal/array/callbacks.d.ts +2 -0
  216. package/types/internal/array/find.d.cts +7 -0
  217. package/types/internal/array/find.d.ts +3 -0
  218. package/types/internal/value/handle.d.cts +37 -0
  219. package/types/internal/{value-handle.d.ts → value/handle.d.ts} +1 -1
  220. package/types/is.d.ts +1 -1
  221. package/types/logger.d.cts +13 -21
  222. package/types/logger.d.ts +13 -21
  223. package/types/math.d.cts +1 -1
  224. package/types/math.d.ts +1 -1
  225. package/types/models.d.cts +4 -4
  226. package/types/models.d.ts +1 -4
  227. package/types/number.d.cts +2 -2
  228. package/types/number.d.ts +2 -2
  229. package/types/query.d.cts +2 -2
  230. package/types/query.d.ts +3 -3
  231. package/types/queue.d.cts +1 -1
  232. package/types/queue.d.ts +1 -1
  233. package/types/random.d.cts +8 -12
  234. package/types/random.d.ts +8 -12
  235. package/types/sized.d.cts +6 -6
  236. package/types/sized.d.ts +6 -6
  237. package/types/string/case.d.cts +28 -0
  238. package/types/string/index.d.cts +30 -27
  239. package/types/string/index.d.ts +3 -3
  240. package/types/string/template.d.cts +50 -0
  241. package/types/string/template.d.ts +4 -1
  242. package/types/value/clone.d.cts +8 -0
  243. package/types/value/clone.d.ts +4 -2
  244. package/types/value/compare.d.cts +8 -0
  245. package/types/value/diff.d.cts +25 -0
  246. package/types/value/equal.d.cts +12 -0
  247. package/types/value/get.d.cts +1319 -0
  248. package/types/value/get.d.ts +1 -1
  249. package/types/value/index.d.cts +8 -6
  250. package/types/value/index.d.ts +2 -2
  251. package/types/value/merge.d.cts +72 -0
  252. package/types/value/merge.d.ts +2 -2
  253. package/types/value/set.d.cts +1011 -0
  254. package/types/value/set.d.ts +1 -1
  255. package/types/value/smush.d.cts +1368 -0
  256. package/types/value/smush.d.ts +2 -2
  257. package/types/value/unsmush.d.cts +141 -0
  258. package/types/value/unsmush.d.ts +2 -2
  259. package/dist/js/array/count.mjs +0 -8
  260. package/dist/js/array/exists.mjs +0 -8
  261. package/dist/js/array/filter.mjs +0 -8
  262. package/dist/js/array/find.mjs +0 -8
  263. package/dist/js/array/group-by.mjs +0 -33
  264. package/dist/js/array/index-of.mjs +0 -8
  265. package/dist/js/array/index.mjs +0 -34
  266. package/dist/js/array/insert.mjs +0 -22
  267. package/dist/js/array/models.mjs +0 -0
  268. package/dist/js/array/splice.mjs +0 -9
  269. package/dist/js/array/to-map.mjs +0 -27
  270. package/dist/js/array/to-record.mjs +0 -8
  271. package/dist/js/array/unique.mjs +0 -8
  272. package/dist/js/colour/index.mjs +0 -30
  273. package/dist/js/index.mjs +0 -17
  274. package/dist/js/internal/array-callbacks.mjs +0 -19
  275. package/dist/js/internal/array-find.mjs +0 -51
  276. package/dist/js/logger.mjs +0 -69
  277. package/dist/js/models.mjs +0 -0
  278. package/dist/js/string/index.mjs +0 -44
  279. package/dist/js/value/index.mjs +0 -23
  280. package/src/js/internal/array-callbacks.ts +0 -28
  281. package/types/internal/array-callbacks.d.ts +0 -2
  282. package/types/internal/array-find.d.ts +0 -4
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[];
@@ -0,0 +1,37 @@
1
+ // Generated by dts-bundle-generator v9.5.1
2
+
3
+ /**
4
+ Represents an object with `unknown` value. You probably want this instead of `{}`.
5
+
6
+ Use case: You have an object whose keys and values are unknown to you.
7
+
8
+ @example
9
+ ```
10
+ import type {UnknownRecord} from 'type-fest';
11
+
12
+ function toJson(object: UnknownRecord) {
13
+ return JSON.stringify(object);
14
+ }
15
+
16
+ toJson({hello: 'world'});
17
+ //=> '{"hello":"world"}'
18
+
19
+ function isObject(value: unknown): value is UnknownRecord {
20
+ return typeof value === 'object' && value !== null;
21
+ }
22
+
23
+ isObject({hello: 'world'});
24
+ //=> true
25
+
26
+ isObject('hello');
27
+ //=> false
28
+ ```
29
+
30
+ @category Type
31
+ @category Object
32
+ */
33
+ export type UnknownRecord = Record<PropertyKey, unknown>;
34
+ export type PlainObject = UnknownRecord;
35
+ export declare function handleValue(data: PlainObject, path: string, value: unknown, get: boolean, ignoreCase: boolean): unknown;
36
+
37
+ export {};
@@ -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,20 +2,18 @@
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
- (...data: any[]): void;
11
10
  };
12
11
  /**
13
- * Logs the value and shows all its properties
12
+ * Log the value and shows all its properties
14
13
  */
15
14
  get dir(): {
16
15
  (item?: any, options?: any): void;
17
16
  (obj: any, options?: import("util").InspectOptions): void;
18
- (item?: any, options?: any): void;
19
17
  };
20
18
  /**
21
19
  * Is logging to the console enabled? _(defaults to `true`)_
@@ -26,55 +24,49 @@ declare class Logger {
26
24
  */
27
25
  set enabled(value: boolean);
28
26
  /**
29
- * Logs any number of values at the "error" log level
27
+ * Log any number of values at the "error" log level
30
28
  */
31
29
  get error(): {
32
30
  (...data: any[]): void;
33
31
  (message?: any, ...optionalParams: any[]): void;
34
- (...data: any[]): void;
35
32
  };
36
33
  /**
37
- * Logs any number of values at the "info" log level
34
+ * Log any number of values at the "info" log level
38
35
  */
39
36
  get info(): {
40
37
  (...data: any[]): void;
41
38
  (message?: any, ...optionalParams: any[]): void;
42
- (...data: any[]): void;
43
39
  };
44
40
  /**
45
- * Logs any number of values at the "log" log level
41
+ * Log any number of values at the "log" log level
46
42
  */
47
43
  get log(): {
48
44
  (...data: any[]): void;
49
45
  (message?: any, ...optionalParams: any[]): void;
50
- (...data: any[]): void;
51
46
  };
52
47
  /**
53
- * 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
54
49
  */
55
50
  get table(): {
56
51
  (tabularData?: any, properties?: string[]): void;
57
52
  (tabularData: any, properties?: readonly string[]): void;
58
- (tabularData?: any, properties?: string[]): void;
59
53
  };
60
54
  /**
61
- * 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
62
56
  */
63
57
  get trace(): {
64
58
  (...data: any[]): void;
65
59
  (message?: any, ...optionalParams: any[]): void;
66
- (...data: any[]): void;
67
60
  };
68
61
  /**
69
- * Logs any number of values at the "warn" log level
62
+ * Log any number of values at the "warn" log level
70
63
  */
71
64
  get warn(): {
72
65
  (...data: any[]): void;
73
66
  (message?: any, ...optionalParams: any[]): void;
74
- (...data: any[]): void;
75
67
  };
76
68
  /**
77
- * - Starts a logged timer with a label
69
+ * - Start a logged timer with a label
78
70
  * - Returns a `Time`-object for logging the current duration of the timer and stopping the timer _(and logging the total duration)_
79
71
  */
80
72
  time(label: string): Time;
@@ -83,13 +75,13 @@ declare class Time {
83
75
  private readonly state;
84
76
  constructor(label: string);
85
77
  /**
86
- * - Logs the current duration of the timer
87
- * - Ignored if logging is disabled
78
+ * - Log the current duration of the timer
79
+ * - _(Ignored if logging is disabled)_
88
80
  */
89
81
  log(): void;
90
82
  /**
91
- * - Stops the timer and logs the total duration
92
- * - 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)_
93
85
  */
94
86
  stop(): void;
95
87
  }
package/types/logger.d.ts CHANGED
@@ -3,20 +3,18 @@ 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
- (...data: any[]): void;
12
11
  };
13
12
  /**
14
- * Logs the value and shows all its properties
13
+ * Log the value and shows all its properties
15
14
  */
16
15
  get dir(): {
17
16
  (item?: any, options?: any): void;
18
17
  (obj: any, options?: import("util").InspectOptions): void;
19
- (item?: any, options?: any): void;
20
18
  };
21
19
  /**
22
20
  * Is logging to the console enabled? _(defaults to `true`)_
@@ -27,55 +25,49 @@ declare class Logger {
27
25
  */
28
26
  set enabled(value: boolean);
29
27
  /**
30
- * Logs any number of values at the "error" log level
28
+ * Log any number of values at the "error" log level
31
29
  */
32
30
  get error(): {
33
31
  (...data: any[]): void;
34
32
  (message?: any, ...optionalParams: any[]): void;
35
- (...data: any[]): void;
36
33
  };
37
34
  /**
38
- * Logs any number of values at the "info" log level
35
+ * Log any number of values at the "info" log level
39
36
  */
40
37
  get info(): {
41
38
  (...data: any[]): void;
42
39
  (message?: any, ...optionalParams: any[]): void;
43
- (...data: any[]): void;
44
40
  };
45
41
  /**
46
- * Logs any number of values at the "log" log level
42
+ * Log any number of values at the "log" log level
47
43
  */
48
44
  get log(): {
49
45
  (...data: any[]): void;
50
46
  (message?: any, ...optionalParams: any[]): void;
51
- (...data: any[]): void;
52
47
  };
53
48
  /**
54
- * 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
55
50
  */
56
51
  get table(): {
57
52
  (tabularData?: any, properties?: string[]): void;
58
53
  (tabularData: any, properties?: readonly string[]): void;
59
- (tabularData?: any, properties?: string[]): void;
60
54
  };
61
55
  /**
62
- * 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
63
57
  */
64
58
  get trace(): {
65
59
  (...data: any[]): void;
66
60
  (message?: any, ...optionalParams: any[]): void;
67
- (...data: any[]): void;
68
61
  };
69
62
  /**
70
- * Logs any number of values at the "warn" log level
63
+ * Log any number of values at the "warn" log level
71
64
  */
72
65
  get warn(): {
73
66
  (...data: any[]): void;
74
67
  (message?: any, ...optionalParams: any[]): void;
75
- (...data: any[]): void;
76
68
  };
77
69
  /**
78
- * - Starts a logged timer with a label
70
+ * - Start a logged timer with a label
79
71
  * - Returns a `Time`-object for logging the current duration of the timer and stopping the timer _(and logging the total duration)_
80
72
  */
81
73
  time(label: string): Time;
@@ -84,13 +76,13 @@ declare class Time {
84
76
  private readonly state;
85
77
  constructor(label: string);
86
78
  /**
87
- * - Logs the current duration of the timer
88
- * - Ignored if logging is disabled
79
+ * - Log the current duration of the timer
80
+ * - _(Ignored if logging is disabled)_
89
81
  */
90
82
  log(): void;
91
83
  /**
92
- * - Stops the timer and logs the total duration
93
- * - 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)_
94
86
  */
95
87
  stop(): void;
96
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
  /**
@@ -0,0 +1,28 @@
1
+ // Generated by dts-bundle-generator v9.5.1
2
+
3
+ /**
4
+ * Convert a string to camel case _(thisIsCamelCase)_
5
+ */
6
+ export declare function camelCase(value: string): string;
7
+ /**
8
+ * Capitalise the first letter of a string _(and lowercase the rest)_
9
+ */
10
+ export declare function capitalise(value: string): string;
11
+ /**
12
+ * Convert a string to kebab case _(this-is-kebab-case)_
13
+ */
14
+ export declare function kebabCase(value: string): string;
15
+ /**
16
+ * Convert a string to pascal case _(ThisIsPascalCase)_
17
+ */
18
+ export declare function pascalCase(value: string): string;
19
+ /**
20
+ * Convert a string to snake case _(this_is_snake_case)_
21
+ */
22
+ export declare function snakeCase(value: string): string;
23
+ /**
24
+ * Convert a string to title case _(capitalising every word)_
25
+ */
26
+ export declare function titleCase(value: string): string;
27
+
28
+ export {};