mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-12-03 19:51:53 +00:00
array-find-index: Provide this type (#13452)
* array-find-index: Provide `this` type * Also turn on --strictNullChecks
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import * as arrayFindIndex from 'array-find-index';
|
||||
import arrayFindIndex = require("array-find-index");
|
||||
|
||||
arrayFindIndex(['rainbow', 'unicorn', 'pony'], x => x === 'unicorn');
|
||||
|
||||
|
||||
Vendored
+3
-8
@@ -1,13 +1,8 @@
|
||||
// Type definitions for array-find-index
|
||||
// Type definitions for array-find-index 1.0
|
||||
// Project: https://github.com/sindresorhus/array-find-index
|
||||
// Definitions by: Sam Verschueren <https://github.com/samverschueren>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare namespace arrayFindIndex {
|
||||
type Predicate = (element: any, index: number, array: any[]) => boolean;
|
||||
}
|
||||
declare function arrayFindIndex(arr: any[], predicate: arrayFindIndex.Predicate): number;
|
||||
declare function arrayFindIndex(arr: any[], predicate: arrayFindIndex.Predicate, ctx: any): number;
|
||||
|
||||
declare function arrayFindIndex<T>(arr: T[], predicate: (element: T, index: number, array: T[]) => boolean): number;
|
||||
declare function arrayFindIndex<T, U>(arr: T[], predicate: (this: U, element: T, index: number, array: T[]) => boolean, ctx: U): number;
|
||||
export = arrayFindIndex;
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
"module": "commonjs",
|
||||
"target": "es6",
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": false,
|
||||
"strictNullChecks": false,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "../tslint.json" }
|
||||
Reference in New Issue
Block a user