Socket
Socket
Sign inDemoInstall

fs-jetpack

Package Overview
Dependencies
4
Maintainers
1
Versions
61
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.6.4 to 0.6.5

4

CHANGELOG.md

@@ -0,1 +1,5 @@

0.6.5 (2015-06-19)
-------------------
* `exists()` can handle ENOTDIR error.
0.6.3 and 0.6.4 (2015-04-18)

@@ -2,0 +6,0 @@ -------------------

4

lib/exists.js

@@ -23,3 +23,3 @@ "use strict";

} catch (err) {
if (err.code !== 'ENOENT') {
if (err.code !== 'ENOENT' && err.code !== 'ENOTDIR') {
throw err;

@@ -41,3 +41,3 @@ }

if (err) {
if (err.code === 'ENOENT') {
if (err.code === 'ENOENT' || err.code === 'ENOTDIR') {
deferred.resolve(false);

@@ -44,0 +44,0 @@ } else {

{
"name": "fs-jetpack",
"description": "Better file system API",
"version": "0.6.4",
"version": "0.6.5",
"author": "Jakub Szwacz <jakub@szwacz.com>",

@@ -6,0 +6,0 @@ "dependencies": {

@@ -1,2 +0,2 @@

fs-jetpack [![Build Status](https://travis-ci.org/szwacz/fs-jetpack.svg?branch=master)](https://travis-ci.org/szwacz/fs-jetpack)
fs-jetpack [![Build Status](https://travis-ci.org/szwacz/fs-jetpack.svg?branch=master)](https://travis-ci.org/szwacz/fs-jetpack) [![Build status](https://ci.appveyor.com/api/projects/status/er206e91fpuuqf58?svg=true)](https://ci.appveyor.com/project/szwacz/fs-jetpack)
==========

@@ -3,0 +3,0 @@

@@ -73,2 +73,26 @@ "use strict";

describe("edge cases", function () {
it("ENOTDIR error changes into 'false'", function (done) {
// We have here malformed path: /some/dir/file.txt/some_dir
// (so file is in the middle of path, not at the end).
// This leads to ENOTDIR error, but technically speaking this
// path doesn't exist so let's just return false.
fse.outputFileSync('text.txt', 'abc');
// SYNC
var exists = jetpack.exists('text.txt/something');
expect(exists).toBe(false);
// ASYNC
jetpack.existsAsync('text.txt/something')
.then(function (exists) {
expect(exists).toBe(false);
done();
});
});
});
});
SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc