Skip to content

Commit

Permalink
feat: add array.deepFirst and array.deepLast properties
Browse files Browse the repository at this point in the history
  • Loading branch information
jorenrui committed Mar 23, 2024
1 parent da36e44 commit aaf8a23
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/helpers/array.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,14 @@ export class MiniArray extends Array {
return this.at(-1)
}

get deepFirst() {
return this.deepFlat().first
}

get deepLast() {
return this.deepFlat().last
}

deepFlat() {
return this.flat(Infinity)
}
Expand Down

0 comments on commit aaf8a23

Please sign in to comment.