Comparing version 1.6.2 to 1.6.3
49
index.js
@@ -113,3 +113,3 @@ const { Readable, Writable } = require('streamx') | ||
function onresponse (id, result) { | ||
function onresponse (id, err, result) { | ||
const req = reqs[id] | ||
@@ -128,19 +128,5 @@ used-- | ||
if (result < 0) { | ||
callback(createError(result), result, null) | ||
} else { | ||
callback(null, result) | ||
} | ||
callback(err, result) | ||
} | ||
function createError (errno) { | ||
const [code, message] = process.errnos.get(errno) | ||
const err = new Error(code + ': ' + message) | ||
err.errno = errno | ||
err.code = code | ||
return err | ||
} | ||
function open (path, flags, mode, cb) { | ||
@@ -180,6 +166,3 @@ if (typeof path !== 'string') { | ||
const res = binding.openSync(path, flags, mode) | ||
if (res < 0) throw createError(res) | ||
return res | ||
return binding.openSync(path, flags, mode) | ||
} | ||
@@ -214,6 +197,3 @@ | ||
const res = binding.closeSync(fd) | ||
if (res < 0) throw createError(res) | ||
return res | ||
return binding.closeSync(fd) | ||
} | ||
@@ -401,8 +381,3 @@ | ||
const data = new Array(Stats.length) | ||
const res = binding.statSync(path, data) | ||
if (res < 0) throw createError(res) | ||
return new Stats(...data) | ||
return new Stats(...binding.statSync(path)) | ||
} | ||
@@ -436,8 +411,3 @@ | ||
const data = new Array(Stats.length) | ||
const res = binding.lstatSync(path, data) | ||
if (res < 0) throw createError(res) | ||
return new Stats(...data) | ||
return new Stats(...binding.lstatSync(path)) | ||
} | ||
@@ -479,8 +449,3 @@ | ||
const data = new Array(Stats.length) | ||
const res = binding.fstatSync(fd, data) | ||
if (res < 0) throw createError(res) | ||
return new Stats(...data) | ||
return new Stats(...binding.fstatSync(fd)) | ||
} | ||
@@ -487,0 +452,0 @@ |
{ | ||
"name": "bare-fs", | ||
"version": "1.6.2", | ||
"version": "1.6.3", | ||
"description": "Native file system for Javascript", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
80987
907