pathwatcher
Advanced tools
Comparing version 1.3.2 to 1.5.0
@@ -22,5 +22,11 @@ (function() { | ||
function Directory(path, symlink) { | ||
this.path = path; | ||
function Directory(directoryPath, symlink) { | ||
this.symlink = symlink != null ? symlink : false; | ||
if (directoryPath) { | ||
directoryPath = path.normalize(directoryPath); | ||
if (directoryPath.length > 1 && directoryPath[directoryPath.length - 1] === path.sep) { | ||
directoryPath = directoryPath.substring(0, directoryPath.length - 1); | ||
} | ||
} | ||
this.path = directoryPath; | ||
this.on('first-contents-changed-subscription-will-be-added', (function(_this) { | ||
@@ -27,0 +33,0 @@ return function() { |
@@ -28,8 +28,11 @@ (function() { | ||
function File(path, symlink) { | ||
this.path = path; | ||
function File(filePath, symlink) { | ||
this.symlink = symlink != null ? symlink : false; | ||
if (fs.isDirectorySync(this.path)) { | ||
throw new Error("" + this.path + " is a directory"); | ||
if (fs.isDirectorySync(filePath)) { | ||
throw new Error("" + filePath + " is a directory"); | ||
} | ||
if (filePath) { | ||
filePath = path.normalize(filePath); | ||
} | ||
this.path = filePath; | ||
this.cachedContents = null; | ||
@@ -36,0 +39,0 @@ this.handleEventSubscriptions(); |
@@ -5,3 +5,3 @@ { | ||
"description": "Watch files and directories for changes", | ||
"version": "1.3.2", | ||
"version": "1.5.0", | ||
"licenses": [ | ||
@@ -8,0 +8,0 @@ { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
50594
615