Skip to content

Incorrect mapper fn generated for keys in async-map #133

Description

@tylergannon

Hi there! I'm just notifying you of a potential bug ... I haven't proven that it actually manifests, but... I'm in the process of porting this repo to Typescript, and the type checker noticed this:

In throughs/asyncMap, just as with regular throughs/map, if a string key or a RegExp is given, then util/prop() is used to generate a mapping function. However, the function returned by prop() is (val: T) => U whereas asyncMap expects a function of type
(val: T, cb: (err: any, mappedVal: U) => void) => void.

If I'm reading this correctly, when given a string or regex, asyncMap should break silently at line 32 because the callback will never be called.

If I've misinterpreted this, then my apologies for taking up your time.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions