@aiszlab/relax 1.3.13 → 1.3.14

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.
@@ -1 +1 @@
1
- export type First<T> = T extends [infer D, ...Array<unknown>] ? D : undefined;
1
+ export type First<T, R = undefined> = T extends [infer D, ...Array<unknown>] ? D : R;
@@ -1 +1 @@
1
- export type Last<T> = T extends [...Array<unknown>, infer D] ? D : undefined;
1
+ export type Last<T, R = undefined> = T extends [...Array<unknown>, infer D] ? D : R;
@@ -0,0 +1,6 @@
1
+ import { type First } from "../types";
2
+ /**
3
+ * @description
4
+ * first element of array
5
+ */
6
+ export declare const first: <T = unknown>(value: T) => First<T, T>;
@@ -0,0 +1,6 @@
1
+ import { type Last } from "../types";
2
+ /**
3
+ * @description
4
+ * last element of array
5
+ */
6
+ export declare const last: <T = unknown>(value: T) => Last<T, T>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aiszlab/relax",
3
- "version": "1.3.13",
3
+ "version": "1.3.14",
4
4
  "description": "react utils collection",
5
5
  "exports": {
6
6
  ".": {