Comparing version 2.1.0 to 2.1.1
@@ -5,3 +5,3 @@ "use strict"; | ||
var chai_1 = require("chai"); | ||
var fs = require("fs"); | ||
var constants_1 = require("./constants"); | ||
var memfs = require('./index'); | ||
@@ -15,7 +15,7 @@ var lists_1 = require("fs-monkey/lib/util/lists"); | ||
it('Exports constants', function () { | ||
chai_1.expect(memfs.F_OK).to.equal(fs.F_OK); | ||
chai_1.expect(memfs.R_OK).to.equal(fs.R_OK); | ||
chai_1.expect(memfs.W_OK).to.equal(fs.W_OK); | ||
chai_1.expect(memfs.X_OK).to.equal(fs.X_OK); | ||
chai_1.expect(memfs.constants).to.eql(fs.constants); | ||
chai_1.expect(memfs.F_OK).to.equal(constants_1.constants.F_OK); | ||
chai_1.expect(memfs.R_OK).to.equal(constants_1.constants.R_OK); | ||
chai_1.expect(memfs.W_OK).to.equal(constants_1.constants.W_OK); | ||
chai_1.expect(memfs.X_OK).to.equal(constants_1.constants.X_OK); | ||
chai_1.expect(memfs.constants).to.eql(constants_1.constants); | ||
}); | ||
@@ -22,0 +22,0 @@ it('Exports constructors', function () { |
@@ -154,2 +154,38 @@ "use strict"; | ||
}; | ||
Node.prototype.canRead = function (uid, gid) { | ||
if (uid === void 0) { uid = process_1.default.getuid(); } | ||
if (gid === void 0) { gid = process_1.default.getgid(); } | ||
if (this.perm & 4 /* IROTH */) { | ||
return true; | ||
} | ||
if (gid === this.gid) { | ||
if (this.perm & 32 /* IRGRP */) { | ||
return true; | ||
} | ||
} | ||
if (uid === this.uid) { | ||
if (this.perm & 256 /* IRUSR */) { | ||
return true; | ||
} | ||
} | ||
return false; | ||
}; | ||
Node.prototype.canWrite = function (uid, gid) { | ||
if (uid === void 0) { uid = process_1.default.getuid(); } | ||
if (gid === void 0) { gid = process_1.default.getgid(); } | ||
if (this.perm & 2 /* IWOTH */) { | ||
return true; | ||
} | ||
if (gid === this.gid) { | ||
if (this.perm & 16 /* IWGRP */) { | ||
return true; | ||
} | ||
} | ||
if (uid === this.uid) { | ||
if (this.perm & 128 /* IWUSR */) { | ||
return true; | ||
} | ||
} | ||
return false; | ||
}; | ||
return Node; | ||
@@ -156,0 +192,0 @@ }(events_1.EventEmitter)); |
{ | ||
"name": "memfs", | ||
"version": "2.1.0", | ||
"version": "2.1.1", | ||
"description": "In-memory file-system with Node's fs API.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
Sorry, the diff of this file is too big to display
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
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
No License Found
License(Experimental) License information could not be found.
Found 1 instance in 1 package
185385
33
0
4214
2