1.0.0 • Published 2 years ago

promisive v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Promisive

Recursive Promise.all that works on object and array

test npm-publish npm

import { promisive } from "promisive";

await promisive({
  a: {
    b: [
      Promise.resolve({
        a: [{ a: Promise.resolve(1) }],
      }),
      Promise.resolve({
        a: [{ a: Promise.resolve(2) }],
      }),
    ],
  },
});

// this will resolve to

{
  "a": {
    "b": [
      {
        "a": [
          {
            "a": 1
          }
        ]
      },
      {
        "a": [
          {
            "a": 2
          }
        ]
      }
    ]
  }
}

License

MIT