🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

bare-fs

Package Overview
Dependencies
Maintainers
3
Versions
89
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bare-fs - npm Package Compare versions

Comparing version
4.5.4
to
4.5.5
+1
-1
binding.c

@@ -293,3 +293,3 @@ #include <assert.h>

js_value_t *value; \
err = js_create_int64(env, time.tv_sec * 1e3 + time.tv_nsec / 1e6, &value); \
err = js_create_int64(env, time.tv_sec * 1000 + time.tv_nsec / 1000000, &value); \
assert(err == 0); \

@@ -296,0 +296,0 @@ \

+162
-69

@@ -15,4 +15,2 @@ const FIFO = require('fast-fifo')

class FileRequest {
static _free = []
static borrow() {

@@ -74,12 +72,7 @@ if (this._free.length > 0) return this._free.pop()

[Symbol.dispose]() {
this.return()
}
_reset() {
const { promise, resolve, reject } = Promise.withResolvers()
this._promise = promise
this._resolve = resolve
this._reject = reject
this._promise = new Promise((resolve, reject) => {
this._resolve = resolve
this._reject = reject
})
this._retain = null

@@ -94,2 +87,4 @@ }

FileRequest._free = []
function ok(result, cb) {

@@ -135,3 +130,3 @@ if (typeof result === 'function') {

using req = FileRequest.borrow()
const req = FileRequest.borrow()

@@ -150,2 +145,4 @@ let fd

})
} finally {
req.return()
}

@@ -162,3 +159,3 @@

using req = FileRequest.borrow()
const req = FileRequest.borrow()

@@ -173,2 +170,4 @@ try {

})
} finally {
req.return()
}

@@ -178,3 +177,3 @@ }

async function close(fd, cb) {
using req = FileRequest.borrow()
const req = FileRequest.borrow()

@@ -188,2 +187,4 @@ let err = null

err = new FileError(e.message, { operation: 'close', code: e.code, fd })
} finally {
req.return()
}

@@ -195,3 +196,3 @@

function closeSync(fd) {
using req = FileRequest.borrow()
const req = FileRequest.borrow()

@@ -202,2 +203,4 @@ try {

throw new FileError(e.message, { operation: 'close', code: e.code, fd })
} finally {
req.return()
}

@@ -214,3 +217,3 @@ }

using req = FileRequest.borrow()
const req = FileRequest.borrow()

@@ -228,2 +231,4 @@ let err = null

})
} finally {
req.return()
}

@@ -237,3 +242,3 @@

using req = FileRequest.borrow()
const req = FileRequest.borrow()

@@ -248,2 +253,4 @@ try {

})
} finally {
req.return()
}

@@ -290,3 +297,3 @@ }

using req = FileRequest.borrow()
const req = FileRequest.borrow()

@@ -301,2 +308,4 @@ let bytes

err = new FileError(e.message, { operation: 'read', code: e.code, fd })
} finally {
req.return()
}

@@ -308,3 +317,3 @@

function readSync(fd, buffer, offset = 0, len = buffer.byteLength - offset, pos = -1) {
using req = FileRequest.borrow()
const req = FileRequest.borrow()

@@ -315,2 +324,4 @@ try {

throw new FileError(e.message, { operation: 'read', code: e.code, fd })
} finally {
req.return()
}

@@ -327,3 +338,3 @@ }

using req = FileRequest.borrow()
const req = FileRequest.borrow()

@@ -338,2 +349,4 @@ let bytes

err = new FileError(e.message, { operation: 'readv', code: e.code, fd })
} finally {
req.return()
}

@@ -347,3 +360,3 @@

using req = FileRequest.borrow()
const req = FileRequest.borrow()

@@ -354,2 +367,4 @@ try {

throw new FileError(e.message, { operation: 'readv', code: e.code, fd })
} finally {
req.return()
}

@@ -399,3 +414,3 @@ }

using req = FileRequest.borrow()
const req = FileRequest.borrow()

@@ -410,2 +425,4 @@ let bytes

err = new FileError(e.message, { operation: 'write', code: e.code, fd })
} finally {
req.return()
}

@@ -435,3 +452,3 @@

using req = FileRequest.borrow()
const req = FileRequest.borrow()

@@ -442,2 +459,4 @@ try {

throw new FileError(e.message, { operation: 'write', code: e.code, fd })
} finally {
req.return()
}

@@ -454,3 +473,3 @@ }

using req = FileRequest.borrow()
const req = FileRequest.borrow()

@@ -465,2 +484,4 @@ let bytes

err = new FileError(e.message, { operation: 'writev', code: e.code, fd })
} finally {
req.return()
}

@@ -474,3 +495,3 @@

using req = FileRequest.borrow()
const req = FileRequest.borrow()

@@ -481,2 +502,4 @@ try {

throw new FileError(e.message, { operation: 'writev', code: e.code, fd })
} finally {
req.return()
}

@@ -488,3 +511,3 @@ }

using req = FileRequest.borrow()
const req = FileRequest.borrow()

@@ -505,2 +528,4 @@ let st

})
} finally {
req.return()
}

@@ -514,3 +539,3 @@

using req = FileRequest.borrow()
const req = FileRequest.borrow()

@@ -527,2 +552,4 @@ try {

})
} finally {
req.return()
}

@@ -534,3 +561,3 @@ }

using req = FileRequest.borrow()
const req = FileRequest.borrow()

@@ -551,2 +578,4 @@ let st

})
} finally {
req.return()
}

@@ -560,3 +589,3 @@

using req = FileRequest.borrow()
const req = FileRequest.borrow()

@@ -573,2 +602,4 @@ try {

})
} finally {
req.return()
}

@@ -578,3 +609,3 @@ }

async function fstat(fd, cb) {
using req = FileRequest.borrow()
const req = FileRequest.borrow()

@@ -591,2 +622,4 @@ let st

err = new FileError(e.message, { operation: 'fstat', code: e.code, fd })
} finally {
req.return()
}

@@ -598,3 +631,3 @@

function fstatSync(fd) {
using req = FileRequest.borrow()
const req = FileRequest.borrow()

@@ -607,2 +640,4 @@ try {

throw new FileError(e.message, { operation: 'fstat', code: e.code, fd })
} finally {
req.return()
}

@@ -619,3 +654,3 @@ }

using req = FileRequest.borrow()
const req = FileRequest.borrow()

@@ -629,2 +664,4 @@ let err = null

err = new FileError(e.message, { operation: 'ftruncate', code: e.code, fd })
} finally {
req.return()
}

@@ -638,3 +675,3 @@

using req = FileRequest.borrow()
const req = FileRequest.borrow()

@@ -645,2 +682,4 @@ try {

throw new FileError(e.message, { operation: 'ftruncate', code: e.code, fd })
} finally {
req.return()
}

@@ -654,3 +693,3 @@ }

using req = FileRequest.borrow()
const req = FileRequest.borrow()

@@ -668,2 +707,4 @@ let err = null

})
} finally {
req.return()
}

@@ -679,3 +720,3 @@

using req = FileRequest.borrow()
const req = FileRequest.borrow()

@@ -690,2 +731,4 @@ try {

})
} finally {
req.return()
}

@@ -697,3 +740,3 @@ }

using req = FileRequest.borrow()
const req = FileRequest.borrow()

@@ -707,2 +750,4 @@ let err = null

err = new FileError(e.message, { operation: 'fchmod', code: e.code, fd })
} finally {
req.return()
}

@@ -716,3 +761,3 @@

using req = FileRequest.borrow()
const req = FileRequest.borrow()

@@ -723,2 +768,4 @@ try {

throw new FileError(e.message, { operation: 'fchmod', code: e.code, fd })
} finally {
req.return()
}

@@ -733,3 +780,3 @@ }

using req = FileRequest.borrow()
const req = FileRequest.borrow()

@@ -747,2 +794,4 @@ let err = null

})
} finally {
req.return()
}

@@ -759,3 +808,3 @@

using req = FileRequest.borrow()
const req = FileRequest.borrow()

@@ -770,2 +819,4 @@ try {

})
} finally {
req.return()
}

@@ -816,3 +867,3 @@ }

using req = FileRequest.borrow()
const req = FileRequest.borrow()

@@ -830,2 +881,4 @@ let err = null

})
} finally {
req.return()
}

@@ -868,3 +921,3 @@

using req = FileRequest.borrow()
const req = FileRequest.borrow()

@@ -879,2 +932,4 @@ try {

})
} finally {
req.return()
}

@@ -886,3 +941,3 @@ }

using req = FileRequest.borrow()
const req = FileRequest.borrow()

@@ -900,2 +955,4 @@ let err = null

})
} finally {
req.return()
}

@@ -909,3 +966,3 @@

using req = FileRequest.borrow()
const req = FileRequest.borrow()

@@ -920,2 +977,4 @@ try {

})
} finally {
req.return()
}

@@ -1011,3 +1070,3 @@ }

using req = FileRequest.borrow()
const req = FileRequest.borrow()

@@ -1025,2 +1084,4 @@ let err = null

})
} finally {
req.return()
}

@@ -1034,3 +1095,3 @@

using req = FileRequest.borrow()
const req = FileRequest.borrow()

@@ -1045,2 +1106,4 @@ try {

})
} finally {
req.return()
}

@@ -1053,3 +1116,3 @@ }

using req = FileRequest.borrow()
const req = FileRequest.borrow()

@@ -1068,2 +1131,4 @@ let err = null

})
} finally {
req.return()
}

@@ -1078,3 +1143,3 @@

using req = FileRequest.borrow()
const req = FileRequest.borrow()

@@ -1090,2 +1155,4 @@ try {

})
} finally {
req.return()
}

@@ -1103,3 +1170,3 @@ }

using req = FileRequest.borrow()
const req = FileRequest.borrow()

@@ -1118,2 +1185,4 @@ let err = null

})
} finally {
req.return()
}

@@ -1128,3 +1197,3 @@

using req = FileRequest.borrow()
const req = FileRequest.borrow()

@@ -1140,2 +1209,4 @@ try {

})
} finally {
req.return()
}

@@ -1206,3 +1277,3 @@ }

using req = FileRequest.borrow()
const req = FileRequest.borrow()

@@ -1225,2 +1296,4 @@ let res

})
} finally {
req.return()
}

@@ -1239,3 +1312,3 @@

using req = FileRequest.borrow()
const req = FileRequest.borrow()

@@ -1256,2 +1329,4 @@ try {

})
} finally {
req.return()
}

@@ -1273,3 +1348,3 @@ }

using req = FileRequest.borrow()
const req = FileRequest.borrow()

@@ -1292,2 +1367,4 @@ let res

})
} finally {
req.return()
}

@@ -1306,3 +1383,3 @@

using req = FileRequest.borrow()
const req = FileRequest.borrow()

@@ -1323,2 +1400,4 @@ try {

})
} finally {
req.return()
}

@@ -1329,3 +1408,3 @@ }

if (isWindows) {
if (type === 'junction') target = path.resolve(filepath, '..', target)
if (type === constants.UV_FS_SYMLINK_JUNCTION) target = path.resolve(filepath, '..', target)

@@ -1377,5 +1456,5 @@ if (path.isAbsolute(target)) return path.toNamespacedPath(target)

target = normalizeSymlinkTarget(target)
target = normalizeSymlinkTarget(target, type, filepath)
using req = FileRequest.borrow()
const req = FileRequest.borrow()

@@ -1394,2 +1473,4 @@ let err = null

})
} finally {
req.return()
}

@@ -1432,5 +1513,5 @@

target = normalizeSymlinkTarget(target)
target = normalizeSymlinkTarget(target, type, filepath)
using req = FileRequest.borrow()
const req = FileRequest.borrow()

@@ -1446,2 +1527,4 @@ try {

})
} finally {
req.return()
}

@@ -1461,3 +1544,3 @@ }

using req = FileRequest.borrow()
const req = FileRequest.borrow()

@@ -1478,2 +1561,4 @@ let dir

})
} finally {
req.return()
}

@@ -1490,3 +1575,3 @@

using req = FileRequest.borrow()
const req = FileRequest.borrow()

@@ -1503,2 +1588,4 @@ try {

})
} finally {
req.return()
}

@@ -1794,3 +1881,3 @@ }

isCharacterDevice() {
return (this.mode & constants.S_IFCHR) === constants.S_IFCHR
return (this.mode & constants.S_IFMT) === constants.S_IFCHR
}

@@ -1828,3 +1915,3 @@

using req = FileRequest.borrow()
const req = FileRequest.borrow()

@@ -1845,2 +1932,4 @@ let entries

})
} finally {
req.return()
}

@@ -1871,3 +1960,3 @@

using req = FileRequest.borrow()
const req = FileRequest.borrow()

@@ -1885,2 +1974,4 @@ let entries

})
} finally {
req.return()
}

@@ -1906,3 +1997,3 @@

async close(cb) {
using req = FileRequest.borrow()
const req = FileRequest.borrow()

@@ -1920,2 +2011,4 @@ let err = null

})
} finally {
req.return()
}

@@ -1929,3 +2022,3 @@

closeSync() {
using req = FileRequest.borrow()
const req = FileRequest.borrow()

@@ -1940,2 +2033,4 @@ try {

})
} finally {
req.return()
}

@@ -2098,7 +2193,6 @@

err = null
try {
await close(this.fd)
} catch (e) {
err = e
err = err || e
}

@@ -2152,7 +2246,6 @@

err = null
try {
await close(this.fd)
} catch (e) {
err = e
err = err || e
}

@@ -2159,0 +2252,0 @@

{
"name": "bare-fs",
"version": "4.5.4",
"version": "4.5.5",
"description": "Native file system operations for Javascript",

@@ -5,0 +5,0 @@ "exports": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet