Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function checkSocket() {
if (this._fd === -1) {
const e = new Error('[Errno ' + errno.EBADF + '] ' + errno.strerror(errno.EBADF));
e.errno = errno.EBADF;
throw e;
}
}
function checkFile() {
if (this._f === null) {
const e = new Error('[Errno ' + errno.EBADF + '] ' + errno.strerror(errno.EBADF));
e.errno = errno.EBADF;
throw e;
}
}