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

sane

Package Overview
Dependencies
Maintainers
1
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 1.0.2 to 1.0.3

2

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

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -53,5 +53,10 @@ 'use strict';

} else {
matched = true;
// Make sure we honor the dot option if even we're not using globs.
if (!dot) {
matched = minimatch(relativePath, '**/*', {dot: false});
} else {
matched = true;
}
}
return matched;
};

@@ -206,3 +206,3 @@ 'use strict';

if (!this.dirRegistery[dir]) {
throw new Error('Unable to find directory in registery: ' + dir);
return;
}

@@ -209,0 +209,0 @@

@@ -286,2 +286,45 @@ var os = require('os');

describe('sane(dir, {dot: false})', function() {
beforeEach(function () {
var Watcher = getWatcherClass(mode);
this.watcher = new Watcher(
testdir,
{ dot: false }
);
});
afterEach(function(done) {
this.watcher.close(done);
});
it('should ignore dot files', function (done) {
var i = 0;
this.watcher.on('change', function(filepath, dir) {
assert.ok(filepath.match(/file_(1|2)/), 'only file_1 and file_2');
assert.equal(dir, testdir);
if (++i == 2) done();
});
this.watcher.on('ready', function() {
fs.writeFileSync(jo(testdir, 'file_1'), 'wow');
fs.writeFileSync(jo(testdir, '.file_9'), 'wow');
fs.writeFileSync(jo(testdir, '.file_3'), 'wow');
fs.writeFileSync(jo(testdir, 'file_2'), 'wow');
});
});
it('should ignore dot dirs', function(done) {
this.watcher.on('change', function(filepath, dir) {
assert.ok(filepath.match(/file_1/), 'only file_1 got : ' + filepath);
assert.equal(dir, testdir);
done();
});
this.watcher.on('ready', function() {
fs.mkdirSync(jo(testdir, '.lol'));
fs.writeFileSync(jo(testdir, '.lol', 'file'), 'wow');
fs.writeFileSync(jo(testdir, '.file_3'), 'wow');
fs.writeFileSync(jo(testdir, 'file_1'), 'wow');
});
});
});
describe('sane shortcut alias', function () {

@@ -288,0 +331,0 @@ beforeEach(function () {

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