Skip to content

Commit

Permalink
fix(utils): flatten type 개선
Browse files Browse the repository at this point in the history
  • Loading branch information
ssi02014 committed Jul 5, 2024
1 parent 03dbe70 commit aed8a90
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/docs/utils/array/flatten.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ type FlatArray<Arr, Depth extends number> = {
}[Depth extends -1 ? "done" : "recur"];
```
```ts title="typescript"
const flatten: <T, D extends number>(
const flatten: <T, D extends number = 1>(
arr: T[] | readonly T[],
depth?: D // default: 1
) => FlatArray<T[], D>[];
Expand Down
2 changes: 1 addition & 1 deletion packages/utils/src/array/flatten/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const flatten = <T, D extends number>(
export const flatten = <T, D extends number = 1>(
arr: T[] | readonly T[],
depth = 1 as D
) => {
Expand Down

0 comments on commit aed8a90

Please sign in to comment.