File tree Expand file tree Collapse file tree 3 files changed +5
-32
lines changed Expand file tree Collapse file tree 3 files changed +5
-32
lines changed Original file line number Diff line number Diff line change 90
90
Is hosted on [ Deno Doc] ( https://doc.deno.land/https://deno.land/x/eloq/mod.ts )
91
91
📄
92
92
93
- ## Support
94
-
95
- Open an Issue, I will check it a soon as possible 👀
96
-
97
- If you want to hurry me up a bit
98
- [ send me a tweet] ( https://twitter.com/UltiRequiem ) 😆
99
-
100
- Consider [ supporting me on Patreon] ( https://patreon.com/UltiRequiem ) if you like
101
- my work 🙏
102
-
103
- Don't forget to start the repo ⭐
104
-
105
- ## Versioning
106
-
107
- We use [ Semantic Versioning] ( http://semver.org ) . For the versions available, see
108
- the [ tags] ( https://github.com/UltiRequiem/eloquent-javascript/tags ) 🏷️
109
-
110
- ## Authors
111
-
112
- [ Eliaz Bobadilla] ( https://ultirequiem.com ) - Creator and Maintainer 💪
113
-
114
- See also the full list of
115
- [ contributors] ( https://github.com/UltiRequiem/eloquent-javascript/contributors )
116
- who participated in this project ✨
117
-
118
93
## Licence
119
94
120
95
Licensed under the MIT License 📄
Original file line number Diff line number Diff line change 1
- export type FilterCallback < T = never > = (
1
+ export type FilterPredicate < T > = (
2
2
item : T ,
3
3
index : number ,
4
4
array : readonly T [ ] ,
5
5
) => unknown ;
6
6
7
- export function filter < T > ( array : readonly T [ ] , test : FilterCallback < T > ) {
8
- const result = [ ] ;
7
+ export function filter < T > ( array : readonly T [ ] , test : FilterPredicate < T > ) {
8
+ const result : T [ ] = [ ] ;
9
9
10
10
const entries = array . entries ( ) ;
11
11
Original file line number Diff line number Diff line change @@ -4,10 +4,8 @@ export type ForEachCallback<T> = (
4
4
array : readonly T [ ] ,
5
5
) => void ;
6
6
7
- export function forEach < T > ( array : T [ ] , callback : ForEachCallback < T > ) {
8
- const entries = array . entries ( ) ;
9
-
10
- for ( const [ index , value ] of entries ) {
7
+ export function forEach < T > ( array : readonly T [ ] , callback : ForEachCallback < T > ) {
8
+ for ( const [ index , value ] of array . entries ( ) ) {
11
9
callback ( value , index , array ) ;
12
10
}
13
11
}
You can’t perform that action at this time.
0 commit comments