10000 map does not work with iterables other than strings, arrays and plain objects · Issue #52 · blend/promise-utils · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
map does not work with iterables other than strings, arrays and plain objects #52
Open
@gurpreetatwal

Description

@gurpreetatwal

The JSDoc on map indicates that input can be an iterable, however it doesn't seem to work with other objects that implement the iterable protocol including built-in ones like Set.

Test Case

const P = require('blend-promise-utils');

const main = async function () {
  const numbers = new Set([1, 2, 3]);
  await P.map(numbers, function (number) {
    console.log(number);
  });
};

main();
Expected output
1
2
3
Actual output

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

      0