New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

mock-fs

Package Overview
Dependencies
Maintainers
1
Versions
87
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mock-fs - npm Package Compare versions

Comparing version 3.3.0 to 3.4.0

node/fs-4.0.0.js

5

changelog.md
# Change Log
## 3.4.0
* Support for Node 4.x (thanks @AlexMeah, see[#65][#65]).
## 3.3.0

@@ -92,1 +96,2 @@

[#57]: https://github.com/tschaub/mock-fs/pull/57
[#65]: https://github.com/tschaub/mock-fs/pull/65

5

lib/index.js

@@ -21,3 +21,4 @@ 'use strict';

'2.x.x': 'fs-2.0.0.js',
'3.x.x': 'fs-3.0.0.js'
'3.x.x': 'fs-3.0.0.js',
'4.x.x': 'fs-4.0.0.js'
};

@@ -27,3 +28,3 @@ var nodeVersion = process.versions.node;

Object.keys(versions).forEach(function (version) {
Object.keys(versions).forEach(function(version) {
if (semver.satisfies(nodeVersion, version)) {

@@ -30,0 +31,0 @@ fsName = versions[version];

20

package.json
{
"name": "mock-fs",
"description": "A configurable mock file system. You know, for testing.",
"version": "3.3.0",
"version": "3.4.0",
"main": "lib/index.js",

@@ -33,14 +33,14 @@ "homepage": "https://github.com/tschaub/mock-fs",

"devDependencies": {
"bench-it": "^0.3.0",
"chai": "^3.0.0",
"eslint": "^0.23.0",
"eslint-config-tschaub": "^1.0.0",
"glob": "~3.2.8",
"mocha": "^2.2.5",
"rimraf": "~2.2.6"
"bench-it": "^0.4.0",
"chai": "^3.3.0",
"eslint": "^1.6.0",
"eslint-config-tschaub": "^2.0.0",
"glob": "^5.0.15",
"mocha": "^2.3.3",
"rimraf": "^2.4.3"
},
"dependencies": {
"rewire": "~2.3.4",
"semver": "^4.2.0"
"rewire": "^2.3.4",
"semver": "^5.0.3"
}
}

@@ -27,41 +27,41 @@ 'use strict';

switch (str) {
case 'r' :
return constants.O_RDONLY;
case 'rs' :
return constants.O_RDONLY | constants.O_SYNC;
case 'r+' :
return constants.O_RDWR;
case 'rs+' :
return constants.O_RDWR | constants.O_SYNC;
case 'r' :
return constants.O_RDONLY;
case 'rs' :
return constants.O_RDONLY | constants.O_SYNC;
case 'r+' :
return constants.O_RDWR;
case 'rs+' :
return constants.O_RDWR | constants.O_SYNC;
case 'w' :
return constants.O_TRUNC | constants.O_CREAT | constants.O_WRONLY;
case 'wx' : // fall through
case 'xw' :
return constants.O_TRUNC | constants.O_CREAT | constants.O_WRONLY |
constants.O_EXCL;
case 'w' :
return constants.O_TRUNC | constants.O_CREAT | constants.O_WRONLY;
case 'wx' : // fall through
case 'xw' :
return constants.O_TRUNC | constants.O_CREAT | constants.O_WRONLY |
constants.O_EXCL;
case 'w+' :
return constants.O_TRUNC | constants.O_CREAT | constants.O_RDWR;
case 'wx+': // fall through
case 'xw+':
return constants.O_TRUNC | constants.O_CREAT | constants.O_RDWR |
constants.O_EXCL;
case 'w+' :
return constants.O_TRUNC | constants.O_CREAT | constants.O_RDWR;
case 'wx+': // fall through
case 'xw+':
return constants.O_TRUNC | constants.O_CREAT | constants.O_RDWR |
constants.O_EXCL;
case 'a' :
return constants.O_APPEND | constants.O_CREAT | constants.O_WRONLY;
case 'ax' : // fall through
case 'xa' :
return constants.O_APPEND | constants.O_CREAT | constants.O_WRONLY |
constants.O_EXCL;
case 'a' :
return constants.O_APPEND | constants.O_CREAT | constants.O_WRONLY;
case 'ax' : // fall through
case 'xa' :
return constants.O_APPEND | constants.O_CREAT | constants.O_WRONLY |
constants.O_EXCL;
case 'a+' :
return constants.O_APPEND | constants.O_CREAT | constants.O_RDWR;
case 'ax+': // fall through
case 'xa+':
return constants.O_APPEND | constants.O_CREAT | constants.O_RDWR |
constants.O_EXCL;
default:
throw new Error('Unsupported flag: ' + str);
case 'a+' :
return constants.O_APPEND | constants.O_CREAT | constants.O_RDWR;
case 'ax+': // fall through
case 'xa+':
return constants.O_APPEND | constants.O_CREAT | constants.O_RDWR |
constants.O_EXCL;
default:
throw new Error('Unsupported flag: ' + str);
}
};

@@ -7,5 +7,5 @@ 'use strict';

function numFiles(dir, items, callback) {
var total = items.length,
files = 0,
completed = 0;
var total = items.length;
var files = 0;
var completed = 0;

@@ -12,0 +12,0 @@ if (total === 0) {

@@ -231,4 +231,3 @@ /* eslint-env mocha */

it('retrieves stats of files relative to symbolic linked directories',
function() {
it('retrieves stats of files relative to symbolic linked directories', function() {
var binding = new Binding(system);

@@ -358,4 +357,3 @@ var stats = binding.stat(path.join('mock-dir', 'dir-link', 'a.txt'));

it('calls callback with file list for link to symbolic linked dir',
function(done) {
it('calls callback with file list for link to symbolic linked dir', function(done) {
var binding = new Binding(system);

@@ -370,4 +368,3 @@ binding.readdir(path.join('mock-dir', 'dir-link2'), function(err, items) {

it('calls callback with file list for symbolic linked dir (sync)',
function() {
it('calls callback with file list for symbolic linked dir (sync)', function() {
var binding = new Binding(system);

@@ -408,4 +405,3 @@ var items = binding.readdir(path.join('mock-dir', 'dir-link'));

var binding = new Binding(system);
binding.readdir(path.join('mock-dir', 'one-link.txt'),
function(err, items) {
binding.readdir(path.join('mock-dir', 'one-link.txt'), function(err, items) {
assert.instanceOf(err, Error);

@@ -417,7 +413,5 @@ assert.isUndefined(items);

it('calls callback with error for link to symbolic link to file',
function(done) {
it('calls callback with error for link to symbolic link to file', function(done) {
var binding = new Binding(system);
binding.readdir(path.join('mock-dir', 'one-link2.txt'),
function(err, items) {
binding.readdir(path.join('mock-dir', 'one-link2.txt'), function(err, items) {
assert.instanceOf(err, Error);

@@ -424,0 +418,0 @@ assert.isUndefined(items);

Sorry, the diff of this file is not supported yet

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