MCPcopy
hub / github.com/scality/cloudserver / promisify

Function promisify

tests/unit/api/objectGetAttributes.js:26–34  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24
25// Promisify helper for functions with non-standard callback signatures
26const promisify = fn => (...args) => new Promise((resolve, reject) => {
27 fn(...args, (err, ...results) => {
28 if (err) {
29 reject(err);
30 } else {
31 resolve(results);
32 }
33 });
34});
35
36const bucketPutAsync = promisify(bucketPut);
37const bucketPutVersioningAsync = promisify(bucketPutVersioning);

Callers 15

routeBackbeat.jsFile · 0.85
utils.jsFile · 0.85
objectGetLegalHoldFunction · 0.85
bucketGetFunction · 0.85
routeBackbeat.jsFile · 0.85
load.jsFile · 0.85
arnPrefix.jsFile · 0.85
helpers.jsFile · 0.85
beforeMigration.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected