Socket
Socket
Sign inDemoInstall

memfs

Package Overview
Dependencies
Maintainers
1
Versions
152
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

memfs - npm Package Compare versions

Comparing version 2.1.0 to 2.1.1

CONTRIBUTING.md

12

lib/index.test.js

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc