Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

sane

Package Overview
Dependencies
Maintainers
2
Versions
58
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sane - npm Package Compare versions

Comparing version 2.0.0 to 2.1.0

4

package.json
{
"name": "sane",
"version": "2.0.0",
"version": "2.1.0",
"description": "Sane aims to be fast, small, and reliable file system watcher.",

@@ -37,3 +37,3 @@ "main": "index.js",

"walker": "~1.0.5",
"watch": "~0.10.0"
"watch": "~0.18.0"
},

@@ -40,0 +40,0 @@ "devDependencies": {

@@ -92,2 +92,3 @@ 'use strict';

endCallback,
errorCallback,
ignored

@@ -101,2 +102,3 @@ ) {

.on('file', normalizeProxy(fileCallback))
.on('error', errorCallback)
.on('end', function() {

@@ -103,0 +105,0 @@ if (platform === 'win32') {

@@ -59,2 +59,3 @@ 'use strict';

this.emit.bind(this, 'ready'),
this.emit.bind(this, 'error'),
this.ignored

@@ -61,0 +62,0 @@ );

@@ -43,2 +43,3 @@ 'use strict';

this.register = this.register.bind(this);
this.checkedEmitError = this.checkedEmitError.bind(this);

@@ -51,2 +52,3 @@ this.watchdir(this.root);

this.emit.bind(this, 'ready'),
this.checkedEmitError,
this.ignored

@@ -139,2 +141,27 @@ );

/**
* Determine if a given FS error can be ignored
*
* @private
*/
function isIgnorableFileError(error) {
return (
error.code === 'ENOENT' ||
// Workaround Windows node issue #4337.
(error.code === 'EPERM' && platform === 'win32')
);
}
/**
* Emit "error" event if it's not an ignorable event
*
* @param error
* @private
*/
NodeWatcher.prototype.checkedEmitError = function(error) {
if (!isIgnorableFileError(error)) {
this.emit('error', error);
}
};
/**
* Watch a directory.

@@ -158,10 +185,3 @@ *

// Workaround Windows node issue #4337.
if (platform === 'win32') {
watcher.on('error', function(error) {
if (error.code !== 'EPERM') {
throw error;
}
});
}
watcher.on('error', this.checkedEmitError);

@@ -229,6 +249,3 @@ if (this.root !== dir) {

if (error) {
if (
error.code === 'ENOENT' ||
(platform === 'win32' && error.code === 'EPERM')
) {
if (isIgnorableFileError(error)) {
found = true;

@@ -363,2 +380,3 @@ callback(file);

function endCallback() {},
this.checkedEmitError,
this.ignored

@@ -365,0 +383,0 @@ );

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