File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change
1
+ type TPredicate = ( value : any ) => boolean
1
2
/**
2
3
* finds array index of array object which matches predicate
3
4
* @param array {Array}
4
5
* @param predicate {Function}
5
6
* @returns {number } || {undefined}
6
7
*/
7
- export const findIndex = ( array : any [ ] , predicate : Function ) => {
8
+ export const findIndex = ( array : any [ ] , predicate : TPredicate ) : number => {
8
9
const length = array == null ? 0 : array . length ;
9
10
if ( ! length ) {
10
11
return - 1 ;
@@ -41,7 +42,7 @@ export const compact = (array: any[]) => {
41
42
* @param predicate {Function}
42
43
* @returns {any } || {undefined}
43
44
*/
44
- export const find = ( array : any [ ] , predicate : Function ) => {
45
+ export const find = ( array : any [ ] , predicate : TPredicate ) => {
45
46
const length = array == null ? 0 : array . length ;
46
47
if ( ! length ) {
47
48
return undefined ;
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ export default class MethodNotFoundError implements Error {
15
15
constructor (
16
16
public methodName : string ,
17
17
public openrpcDocument : OpenRPC ,
18
- public receievedParams : any [ ] | object = [ ] ,
18
+ public receievedParams : any [ ] | Record < string , unknown > = [ ] ,
19
19
) {
20
20
const msg = [
21
21
`Method Not Found Error for OpenRPC API named "${ openrpcDocument . info . title } "` ,
You can’t perform that action at this time.
0 commit comments