Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (!timeoutMs) timeoutMs = 100;
var timeout = timeoutPromise(error, timeoutMs);
return Promise.race([onResolvedOrRejected(promise, function () {
return timeout.clear();
}), timeout]);
};
function forEach(xs, f) {
for (var i = 0, l = xs.length; i < l; i++) {
f(xs[i], i);
}
}
if (!util._errnoException) {
var uv;
util._errnoException = function (err, syscall) {
if (util.isUndefined(uv)) try {
uv = process.binding('uv');
} catch (e) {}
var errname = uv ? uv.errname(err) : '';
var e = new Error(syscall + ' ' + errname);
e.code = errname;
e.errno = errname;
e.syscall = syscall;
return e;
};
}
}
if (!error) error = 'timeout';
if (!timeoutMs) timeoutMs = 100;
var timeout = timeoutPromise(error, timeoutMs);
return Promise.race([onResolvedOrRejected(promise, function () {
return timeout.clear();
}), timeout]);
};
function forEach(xs, f) {
for (var i = 0, l = xs.length; i < l; i++) {
f(xs[i], i);
}
}
if (!util._errnoException) {
var uv;
util._errnoException = function (err, syscall) {
if (util.isUndefined(uv)) try {
uv = process.binding('uv');
} catch (e) {}
var errname = uv ? uv.errname(err) : '';
var e = new Error(syscall + ' ' + errname);
e.code = errname;
e.errno = errname;
e.syscall = syscall;
return e;
};
}