Skip to content

Commit

Permalink
Use instanceof instead of Duck typing
Browse files Browse the repository at this point in the history
  • Loading branch information
Wzb3422 committed Jun 27, 2020
1 parent f314751 commit b340a71
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export async function mapLimit<V>(input: any, limit: number, iteratee: any): Pro
return [];
}

const isArray = input.length !== undefined;
const isArray = input instanceof Array;
const size = (() => {
if (isArray) {
return input.length;
Expand Down

0 comments on commit b340a71

Please sign in to comment.