Skip to content

Commit

Permalink
Update types.
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmillr committed Apr 17, 2019
1 parent 463f011 commit 610557f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import sep from 'path';

type AnymatchFn = (testString: string) => boolean;
type AnymatchPattern = string|RegExp|AnymatchFn;
type AnymatchMatcher = AnymatchPattern|Array<AnymatchPattern>
declare function anymatch(matchers: AnymatchMatcher, testString: string|Array<any>): boolean;
declare function anymatch(matchers: AnymatchMatcher, testString: string|Array<any>, returnIndex: true): number;
declare function anymatch(matchers: AnymatchMatcher): (testString: string|Array<any>) => boolean;
declare function anymatch(matchers: AnymatchMatcher): (testString: string|Array<any>, returnIndex: true) => number;
type AnymatchMatcher = AnymatchPattern|AnymatchPattern[]
declare function anymatch(matchers: AnymatchMatcher, testString: string|any[]): boolean;
declare function anymatch(matchers: AnymatchMatcher, testString: string|any[], returnIndex: true): number;
declare function anymatch(matchers: AnymatchMatcher): (testString: string|any[]) => boolean;
declare function anymatch(matchers: AnymatchMatcher): (testString: string|any[], returnIndex: true) => number;
export = anymatch;
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ const matchPatterns = (patterns, negatedGlobs, path, returnIndex) => {
/**
* @param {AnymatchMatcher} matchers
* @param {Array|string} testString
* @param {Boolean=} returnIndex
* @param {boolean=} returnIndex
* @returns {boolean|number|Function}
*/
const anymatch = (matchers, testString, returnIndex = false) => {
Expand Down

0 comments on commit 610557f

Please sign in to comment.