@oscarpalmer/atoms 0.186.0 → 0.186.1

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.
@@ -39,5 +39,17 @@ declare function getArray<Value extends PlainObject>(value: Value): Value[keyof
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: unknown): unknown[];
42
54
  //#endregion
43
55
  export { getArray };
package/dist/index.d.mts CHANGED
@@ -1309,6 +1309,18 @@ declare function getArray<Value extends PlainObject>(value: Value): Value[keyof
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: unknown): unknown[];
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.1",
4
4
  "description": "Atomic utilities for making your JavaScript better.",
5
5
  "keywords": [
6
6
  "helper",
package/src/array/get.ts CHANGED
@@ -47,6 +47,19 @@ export function getArray<Value extends PlainObject>(value: Value): Value[keyof V
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: unknown): unknown[];
62
+
50
63
  export function getArray(value: unknown, indiced?: unknown): unknown[] {
51
64
  if (Array.isArray(value)) {
52
65
  return value;