Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const promise = new Promise(resolve => {
const func = original || service[method];
const args = service.methods[method].map((value) => hookObject[value]);
const result = func.apply(service, args);
if (!isPromise(result)) {
throw new Error(`Service method '${hookObject.method}' for '${hookObject.path}' service must return a promise`);
}
resolve(result);
});