MCPcopy
hub / github.com/webpack/tapable / pify

Function pify

test/SyncBailHook.test.js:9–16  ·  view source on GitHub ↗
(fn)

Source from the content-addressed store, hash-verified

7const SyncBailHookTest = require("../lib/SyncBailHook");
8
9function pify(fn) {
10 return new Promise((resolve, reject) => {
11 fn((err, result) => {
12 if (err) reject(err);
13 else resolve(result);
14 });
15 });
16}
17
18describe("SyncBailHook", () => {
19 it("should allow to create sync bail hooks", async () => {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…