@oscarpalmer/atoms 0.186.0 → 0.186.2

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.
@@ -35,9 +35,21 @@ declare function getArray<Value extends PlainObject>(value: Value): Value[keyof
35
35
  *
36
36
  * @example
37
37
  * ```typescript
38
- * getArray(123); // => [123]
38
+ * getArray([123]); // => [123]
39
39
  * ```
40
40
  */
41
41
  declare function getArray<Item>(value: Item[]): Item[];
42
+ /**
43
+ * Get an array from an unknown value
44
+ *
45
+ * @param value Value to convert to an array
46
+ * @returns Array of value
47
+ *
48
+ * @example
49
+ * ```typescript
50
+ * getArray(123); // => [123]
51
+ * ```
52
+ */
53
+ declare function getArray<Value>(value: Value): Value[];
42
54
  //#endregion
43
55
  export { getArray };
package/dist/index.d.mts CHANGED
@@ -1305,10 +1305,22 @@ declare function getArray<Value extends PlainObject>(value: Value): Value[keyof
1305
1305
  *
1306
1306
  * @example
1307
1307
  * ```typescript
1308
- * getArray(123); // => [123]
1308
+ * getArray([123]); // => [123]
1309
1309
  * ```
1310
1310
  */
1311
1311
  declare function getArray<Item>(value: Item[]): Item[];
1312
+ /**
1313
+ * Get an array from an unknown value
1314
+ *
1315
+ * @param value Value to convert to an array
1316
+ * @returns Array of value
1317
+ *
1318
+ * @example
1319
+ * ```typescript
1320
+ * getArray(123); // => [123]
1321
+ * ```
1322
+ */
1323
+ declare function getArray<Value>(value: Value): Value[];
1312
1324
  //#endregion
1313
1325
  //#region src/array/insert.d.ts
1314
1326
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oscarpalmer/atoms",
3
- "version": "0.186.0",
3
+ "version": "0.186.2",
4
4
  "description": "Atomic utilities for making your JavaScript better.",
5
5
  "keywords": [
6
6
  "helper",
package/src/array/get.ts CHANGED
@@ -42,11 +42,24 @@ export function getArray<Value extends PlainObject>(value: Value): Value[keyof V
42
42
  *
43
43
  * @example
44
44
  * ```typescript
45
- * getArray(123); // => [123]
45
+ * getArray([123]); // => [123]
46
46
  * ```
47
47
  */
48
48
  export function getArray<Item>(value: Item[]): Item[];
49
49
 
50
+ /**
51
+ * Get an array from an unknown value
52
+ *
53
+ * @param value Value to convert to an array
54
+ * @returns Array of value
55
+ *
56
+ * @example
57
+ * ```typescript
58
+ * getArray(123); // => [123]
59
+ * ```
60
+ */
61
+ export function getArray<Value>(value: Value): Value[];
62
+
50
63
  export function getArray(value: unknown, indiced?: unknown): unknown[] {
51
64
  if (Array.isArray(value)) {
52
65
  return value;